Proving $\arctan(\sqrt{x^2+1}-x)=\frac{\pi}{4}-\frac{1}{2}\arctan(x)$

How to prove the following identity:

$$(\forall x\in\mathbb{R}): \quad \arctan(\sqrt{x^2+1}-x)=\dfrac{\pi}{4}-\dfrac{1}{2}\arctan(x)$$

The knowing method is to prove that both sides are in $$]-\frac{\pi}{2}, \frac{\pi}{2}[$$ and they have the same value tooked by the function $$\tan$$; but this looked to be out of reach, because there is no general identity giving $$\tan(\frac{\alpha}{2})$$ in words of $$\tan(\alpha)$$

• "there is no general identity giving $\tan(\frac\alpha2)$ in words of $\tan(\alpha)$" ummmmm.... the half angle identities? – YiFan Oct 8 '19 at 23:40
• @YiFan, I mean an identity giving $\tan(\frac{\alpha}{2})$ in terms of $\tan(\alpha)$, this the only way that helps proving the equality. – hachemy Oct 8 '19 at 23:49
• Have a look at these demonstrations, solely based on geometrical definition of tangent dfnu.xyz/en/exercises-and-dialogues/losing-it-on-a-tangent – dfnu Oct 9 '19 at 12:36

Let $$\theta=\arctan(\sqrt{x^2+1}-x),$$ then $$\tan\theta=\sqrt{x^2+1}-x$$ and we can easily solve this for $$x,$$ as $$x=\dfrac{1-\tan^2\theta}{2\tan\theta}=\cot 2\theta=\tan\left(\dfrac{\pi}2-2\theta\right)$$ which implies $$\theta=\dfrac{\pi}4-\dfrac12\arctan(x).$$
Let arccot$$(x)=2y,x=\cot2y,0<2y<\pi$$
$$\sqrt{1+x^2}-x=+\csc2y-\cot2y=\tan y$$
$$\arctan(x)=\dfrac\pi2-$$arccot$$(x)=\dfrac\pi2-2y$$