<s>[INST] Prove that $\tan^{-1}\frac{\sqrt{1+x^2}+\sqrt{1-x^2}}{\sqrt{1+x^2}-\sqrt{1-x^2}}=\frac{\pi}{4}+\frac 12 \cos^{-1}x^2$ Let the above expression be equal to $\phi$
$$\frac{\tan \phi +1}{\tan \phi-1}=\sqrt{\frac{1+x^2}{1-x^2}}$$
$$\frac{1+\tan^2\phi +2\tan \phi}{1+\tan^2 \phi-2\tan \phi}=\frac{1+x^2}{1-x^2}$$
$$\frac{1+\tan^2\phi}{2\tan \phi }=\frac{1}{x^2}$$
$$\sin 2\phi=x^2$$
$$\phi=\frac{\pi}{4}-\frac 12 \cos^{-1}x^2$$
Where am I going wrong?
 [/INST] Your mistake
$\sin y=a\stackrel{\text{to}}{\longrightarrow}\sin^{-1}(\sin y)=\begin{cases}2n\pi+y&y\in\text{I, IV quadrant}\\(2n-1)\pi-y&y\in\text{II, III quadrant}\end{cases}=\sin^{-1}a$
</s>