# Why does $\cot(2\arctan(Ax))=\frac{1-(Ax)^2}{2Ax}$

This question is mostly out of curiosity, but I hope that the answer will advance my understanding of the trigonometric function. While playing around with trigonometric functions on WolframAlpha I stumbled upon this $$\cot(2\arctan(Ax))=\frac{1-(Ax)^2}{2Ax}$$ I suspect that one could prove this using the complex forms of the trigonometric functions $$\sin(z) = \dfrac{e^{iz}-e^{-iz}}{2i}$$ but I myself do not know the complex form of $$\arctan$$ so I am unable to do this.

Is there some nice geometric or algebraic proof that explains why $$\cot(2\arctan(Ax))=\frac{1-(Ax)^2}{2Ax}$$? Or maybe, is WolframAlpha wrong and does $$\cot(2\arctan(Ax))$$ just happen to be very close to $$\frac{1-(Ax)^2}{2Ax}$$?

We have the following fundamental trigonometric identity: $$\tan2t=\frac{2\tan t}{1-\tan^2t}$$ Take reciprocal on both sides: $$\frac1{\tan2t}=\frac{1-\tan^2t}{2\tan t}$$ Now substitute $$t=\arctan Ax$$ to get the identity in the question. ($$\cot x\equiv\frac1{\tan x}$$.)

Use the fact that $$\cot \theta=\dfrac{1}{\tan \theta}$$

And the double angle formula for tangent:

$$\tan 2\theta=\dfrac{2\tan \theta}{1-\tan^2 \theta}$$

Lastly, before I confuse myself let's do some replacement.

$$\tan^{-1} Ax=z$$

$$Ax=\tan z$$

Hence the full thing is:

$$=\left(\tan (2\tan^{-1} Ax) \right)^{-1}$$

$$=(\tan 2z)^{-1}= \dfrac{1-\tan^2 z}{2\tan z}$$

All good now, I hope.

Substitute $$\tan z$$ for $$Ax$$