Derivative of cot(x)

If you use a definition of $\cot$ that is not defined for $\frac \pi 2$ like $\cot x=\frac 1 {\tan x}$, then the proof that you make will not prove the derivative for $x=\frac \pi 2$. Meanwhile, if you do not make that assumption and use the general properties of $\cot$ like the $\cot$ addition identity or $\cot x=\frac{\cos x}{\sin x}$, then you will have a more robust proof.

People probably use $\cot x=\frac 1 {\tan x}$ because it's easy and leads to the right answer, even if it does not prove the derivative for $x=\frac \pi 2$.


No, you don't get the derivative at $\pi/2$; however, the cotangent function is continuous at $\pi/2$ and $$ \lim_{x\to\pi/2}\cot'(x)= \lim_{x\to\pi/2}-\frac{1}{\sin^2(x)}=-1 $$ so you can say that $$ \cot'(\pi/2)=-1=-\frac{1}{\sin^2(\pi/2)} $$ It's a standard application of l'Hôpital's theorem: continuity of the function at the point ensures the hypotheses of the theorem hold.

More generally, suppose you have a function $f$ that is continuous on $(x_0-\delta,x_0+\delta)$ and differentiable on $(x_0-\delta,x_0)\cup(x_0,x_0+\delta)$; if $f'$ has a removable singularity at $x_0$, then $f$ is also differentiable on $x_0$ and $$ f'(x_0)=\lim_{x\to x_0}f'(x) $$

A classical example is $$ f(x)=\begin{cases} x^3\sin\frac{1}{x} & \text{if $x\ne0$}\\ 0 & \text{if $x=0$} \end{cases} $$ Since, for $x\ne0$, $$ f'(x)=3x^2\sin\frac{1}{x}-x\cos\frac{1}{x} $$ and $$ \lim_{x\to0}f(x)=0,\qquad \lim_{x\to0}f'(x)=0, $$ we can say that $f$ is also differentiable at $0$ and $f'(0)=0$ (which can also be verified by the definition).

Note that the converse is not true; the function might be differentiable at $x_0$ without the derivative having a removable singularity. Just change $x^3$ into $x^2$ in the above example to get an instance of this.