What is the integral of arcsech x? On the internet it says $$\int\operatorname{sech}^{-1}xdx=x\operatorname{sech}^{-1}-2\tan^{-1}\left(\sqrt\frac{1-x}{1+x}\right),$$ but I couldn't find a single proof, and I don't see how that is the answer. Here are my thoughts:
\begin{align}
\int \operatorname{sech}^{-1}xdx&=x\operatorname{sech}^{-1}x-\int x\frac{-1}{x\sqrt{1-x^2}}dx\\&=x\operatorname{sech}^{-1}x+\int\frac{1}{\sqrt{1-x^2}}dx\\&=x\operatorname{sech}^{-1}x+\sin^{-1}x+c.
\end{align}
What is wrong with my calculation, and how to prove the right formula?
 A: Your answer is correct. Note that based on the domain of definition of $\text{sech}^{-1}(x)$ we must have $x\in (0,1]$. Therefore $${u\triangleq \sin^{-1}x\implies x=\sin u\quad,\quad 0<u\le {\pi\over 2}\\
\implies \sqrt{1-x\over 1+x}=\sqrt{1-\sin u\over 1+\sin u}=\sqrt{1-\cos \left({\pi\over 2}-u\right)\over 1+\cos \left({\pi\over 2}-u\right)}
\\=\sqrt{\sin^2 \left({\pi\over 4}-{u\over 2}\right)\over \cos^2 \left({\pi\over 4}-{u\over 2}\right)}
\\=\sqrt{\tan^2 \left({\pi\over 4}-{u\over 2}\right)}
\\=\tan \left({\pi\over 4}-{u\over 2}\right)
}$$therefore $$-\tan^{-1}\sqrt{1-x\over 1+x}={u\over 2}-{\pi\over 4}\implies -2\tan^{-1}\sqrt{1-x\over 1+x}={u}-{\pi\over 2}$$and hence$$\sin^{-1}x=-2\tan^{-1}\sqrt{1-x\over 1+x}+{\pi\over 2}\quad,\quad 0<x\le 1$$By substitution, the two answers are different in a ${\pi\over 2}$ offset which is absorbed in the integration constant and the answers are equivalent.
A: Consider that
$$\tan\left(2\arctan\sqrt{\frac{1-x}{1+x}}\right)=\frac{2\sqrt{\dfrac{1-x}{1+x}}}{1-{\dfrac{1-x}{1+x}}}=\frac{\sqrt{1-x^2}}{x}=\tan(\arccos(x))$$
and yo should see the relation between your expression and theirs.
