The derivative of the cotangent function is equal to minus cosecant squared, -csc2(x). This derivative can be proved using limits and trigonometric identities.
In this article, we will learn how to derive the trigonometric function cotangent. We will see how to prove this derivative, a graphical comparison of cotangent and some examples.
CALCULUS

Relevant for…
Learning about the proof and graphs of the derivative of cotangent.
CALCULUS

Relevant for…
Learning about the proof and graphs of the derivative of cotangent.
Proof of the Derivative of the Cotangent Function
The trigonometric function cotangent of an angle is defined as the ratio of adjacent side to the opposite side of an angle in a right triangle. Illustrating it through a figure, we have

where C is 90°. For the sample right triangle, getting the cotangent of angle A can be evaluated as
$latex \cot{(A)} = \frac{b}{a}$
where A is the angle, b is its adjacent side, and a is its opposite side.
Before learning the proof of the derivative of the cotangent function, you are hereby recommended to learn the Pythagorean theorem, Soh-Cah-Toa & Cho-Sha-Cao, and the first principle of limits as prerequisites.
To review, any function can be derived by equating it to the limit of
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\frac{f(x+h)-f(x)}{h}}$$
Suppose we are asked to get the derivative of
$latex f(x) = \cot{(x)}$
we have
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\frac{ \cot{(x+h)} – \cot{(x)} }{h}}$$
Analyzing our equation, we can observe that both the first and second terms in the numerator of the limit are cotangents of a sum of two angles x and h and a cotangent of angle x. With this observation, we can try to apply the defining relation identities for cotangent, cosine, and sine. Applying this, we have
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\frac{ \frac{\cos{(x+h)}}{\sin{(x+h)}} – \frac{\cos{(x)}}{\sin{(x)}} }{h}}$$
Algebraically re-arranging by applying some rules of fractions, we have
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\frac{ \frac{\cos{(x+h)}\sin{(x)} – \sin{(x+h)}\cos{(x)}}{\sin{(x+h)}\sin{(x)}} }{h}}$$
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\frac{ \sin{(x)}\cos{(x+h)} – \cos{(x)}\sin{(x+h)} }{h\sin{(x+h)}\sin{(x)}}}$$
Looking at the re-arranged numerator, we can try to apply the sum and difference identities for sine and cosine, also called Ptolemy’s identities.
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\frac{ \sin{(x-(x+h))} }{h\sin{(x+h)}\sin{(x)}}}$$
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\frac{ \sin{(x-x-h)} }{h\sin{(x+h)}\sin{(x)}}}$$
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\frac{ \sin{(-h)} }{h\sin{(x+h)}\sin{(x)}}}$$
Based on the trigonometric identities of a sine of a negative angle, it is equal to negative sine of that same angle but in positive form. Applying this to our numerator, we have
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\frac{ -\sin{(h)} }{h\sin{(x+h)}\sin{(x)}}}$$
Re-arranging by applying the limit of product of two functions, we have
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\left( \frac{ \sin{(h)} }{h} \cdot \frac{-1}{\sin{(x+h)}\sin{(x)}} \right)}$$
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\left( \frac{ \sin{(h)} }{h} \cdot \left(-\frac{1}{\sin{(x+h)}\sin{(x)}}\right) \right)}$$
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\left( \frac{ \sin{(h)} }{h} \right)} \cdot \lim \limits_{h \to 0} {\left(-\frac{1}{\sin{(x+h)}\sin{(x)}} \right)}$$
In accordance with the limits of trigonometric functions, the limit of trigonometric function $latex \sin{(\theta)}$ to $latex \theta$ as $latex \theta$ approaches zero is equal to one. The same can be applied to $latex \sin{(h)}$ over $latex h$. Applying, we have
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {1} \cdot \lim \limits_{h \to 0} {\left(-\frac{1}{\sin{(x+h)}\sin{(x)}} \right)}$$
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\left(-\frac{1}{\sin{(x+h)}\sin{(x)}} \right)}$$
Finally, we have successfully made it possible to evaluate the limit of whatever is left in the equation. Evaluating by substituting the approaching value of $latex h$, we have
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\left(-\frac{1}{\sin{(x+h)}\sin{(x)}} \right)}$$
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\left(-\frac{1}{\sin{(x+(0))}\sin{(x)}} \right)}$$
$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\left(-\frac{1}{\sin{(x)}\sin{(x)}} \right)}$$
$$\frac{d}{dx} f(x) = -\frac{1}{\sin{(x)}\sin{(x)}}$$
We know that by the defining relation identities, the reciprocal of the trigonometric function sine is cosecant. Applying, we have
$$\frac{d}{dx} f(x) = – \left( \frac{1}{\sin{(x)}} \cdot \frac{1}{\sin{(x)}} \right)$$
$$\frac{d}{dx} f(x) = – (\csc{(x)} \cdot \csc{(x)})$$
$$\frac{d}{dx} f(x) = -(\csc^{2}{(x)})$$
$$\frac{d}{dx} f(x) = -\csc^{2}{(x)}$$
Therefore, the derivative of the trigonometric function ‘cotangent‘ is:
$$\frac{d}{dx} (\cot{(x)}) = -\csc^{2}{(x)}$$
Graph of Cotangent of x VS. The Derivative of Cotangent of x
Given the function
$latex f(x) = \cot{(x)}$
its graph is

When differentiating $latex f(x) = \cot{(x)}$, we get
$latex f'(x) = -\csc^{2}{(x)}$
and its graph is

Comparing their graphs, we have

Analyzing the differences of these functions through these graphs, you can observe that the original function $latex f(x) = \cot{(x)}$ has a domain of
$$(-2\pi,-\pi) \cup (-\pi,0) \cup (0,\pi) \cup (\pi,2\pi)$$
within the finite intervals of
$latex (-2\pi,2\pi)$
and exists within the range of
$latex (-\infty,\infty)$ or all real numbers
whereas the derivative $latex f'(x) = -\csc^{2}{(x)}$ has a domain of
$$(-2\pi,-\pi) \cup (-\pi,0) \cup (0,\pi) \cup (\pi,2\pi)$$
within the finite intervals of
$latex (-2\pi,2\pi)$
and exists within the range of
$latex (-\infty,-1]$ or $latex y \leq -1$
Examples
Here are some examples of how to derive a composite cotangent function.
EXAMPLE 1
What is the derivative of $latex f(x) = \cot(9x)$?
Solution
To derive this function, we consider that we have a composite function since the cotangent is applied to $latex 9x$.
Considering $latex u=9x$ as the inner function, we have $latex f(u)=\cot(u)$ and using the chain rule, we have:
$$\frac{dy}{dx}=\frac{dy}{du} \frac{du}{dx}$$
$$\frac{dy}{dx}=-\csc^2(u) \times 9$$
Finally, we substitute $latex u=9x$ back into the function and we have:
$$\frac{dy}{dx}=-9\csc^2(9x)$$
EXAMPLE 2
Derive the function $latex F(x) = \cot(7x^2-7)$
Solution
This function can be derived using the chain rule because it is a composite cotangent function.
Therefore, let’s start by writing the cotangent function as $latex f (u) = \cot(u)$, where $latex u = 7x^2-7$.
Now, let’s find the derivative of the outer function $latex f(u)=\cot(u)$:
$$\frac{d}{du} ( \cot(u) ) = -\csc^2(u)$$
Then, we find the derivative of the inner function $latex u=g(x)=7x^2-7$:
$$\frac{d}{dx}(g(x)) = \frac{d}{dx}(7x^2-7)$$
$$\frac{d}{dx}(g(x)) = 14x$$
To use the chain rule, we multiply the derivative of the outer function by the derivative of the inner function:
$$\frac{dy}{dx} = \frac{d}{du} (f(u)) \cdot \frac{d}{dx} (g(x))$$
$$\frac{dy}{dx} = -\csc^2(u) \cdot 14x$$
Finally, we substitute $latex y=7x^2-7$ back:
$$\frac{dy}{dx} = -\csc^2(7x^2-7) \cdot 14x$$
$$\frac{dy}{dx} = -14x\csc^2(7x^2-7)$$
EXAMPLE 3
Find the derivative of $latex f(x) = \cot(\sqrt{x})$
Solution
To derive this function, we use the chain rule and consider $latex u=\sqrt{x}$ as the inner function.
Then, we can find the derivative $latex \frac{du}{dx}$ by writing $latex u=\sqrt{x}$ as $latex u=x^{\frac{1}{2}}$:
$$\frac{du}{dx}=\frac{1}{2}x^{-\frac{1}{2}}$$
Now, we consider that $latex f(u)=\cot(u)$ and use the chain rule:
$$\frac{dy}{dx}=\frac{dy}{du} \frac{du}{dx}$$
$$\frac{dy}{dx}=-\csc^2(u) \times \frac{1}{2}x^{-\frac{1}{2}}$$
Substituting $latex u=\sqrt{x}$ back and simplifying, we have:
$$\frac{dy}{dx}=-\csc^2(\sqrt{x}) \times \frac{1}{2}x^{-\frac{1}{2}}$$
$$\frac{dy}{dx}=-\frac{1}{2\sqrt{x}}\csc^2(\sqrt{x})$$
Practice of derivatives of composite cotangent functions


See also
Interested in learning more about the derivatives of trigonometric functions? Take a look at these pages: