How to prove that $ \arctan x + 2 \arctan(\sqrt{1 + x^2} - x) = \frac{\pi}{2} $

You may set $x=\tan\theta$ (for some $\theta\in\left(-\pi/2,\pi/2\right)$) and check that $$2\arctan\left(\frac{1-\sin\theta}{\cos\theta}\right) = \frac{\pi}{2}-\theta $$ holds, or that $$ 2\arctan\left(\frac{1-\cos\theta}{\sin\theta}\right)=\theta $$ holds for any $\theta\in(0,\pi)$. Since $1-\cos\theta=2\sin^2\frac{\theta}{2}$ and $\sin\theta=2\sin\frac{\theta}{2}\cos\frac{\theta}{2}$ this is equivalent to $$ 2 \arctan\tan\frac{\theta}{2} = \theta $$ for any $\theta\in(0,\pi)$, which is fairly obvious.


We have \begin{eqnarray*} \tan^{-1}(A) + \tan^{-1}(B) + \tan^{-1}(C) = \tan^{-1} \left( \frac{A+B+C-ABC}{1-AB-BC-CA} \right). \end{eqnarray*} If the RHS is to give $ \pi/2$ then we require the denominator to be zero, so \begin{eqnarray*} 1-2x( \sqrt{1+x^2} -x) -(\sqrt{1+x^2} -x)^2=0 \end{eqnarray*} Which is easily verified.


Taking a derivative of the expression and you will get $$ \newcommand{\Bold}[1]{\mathbf{#1}}\frac{2 \, {\left(\frac{x}{\sqrt{x^{2} + 1}} - 1\right)}}{{\left(x - \sqrt{x^{2} + 1}\right)}^{2} + 1} + \frac{1}{x^{2} + 1} = 0 . $$ So the expression must be a constant. Taking $x=0$ and you will get $\pi/2$. No need to think.