Finding an antiderivative $\newcommand{\dx}{\,\mathrm dx}$
I need to find the following:

$$\int \sqrt{\frac{1-x}{1+x}} \cdot \frac 1x \dx$$

Firstly, it has to be that $x\in (-1, 0)\cup  (0,1]$. From this, it is implied that $1+x>0$. Also, it holds that $1-x \ge 0$.
What I did is that I multiplied both numerator and denominator by $\sqrt{1+x}$. Thus, we have:
$$ \int \frac{\sqrt{1-x^2}}{1+x}\cdot \frac 1x\dx \begin{array}[t]{l}
\displaystyle\, \,\overset{x = \sin t}{=} \int \frac{\cos t}{1+\sin t}\cdot \frac{1}{\sin t}\cdot \cos t \, \mathrm dt\\[3ex]
\quad = \displaystyle \int \frac{\cos^2 t}{(1+\sin t)\sin t}\,\mathrm dt\\[3ex]
\quad = \displaystyle \int \frac{1-\sin^2 t}{(1+\sin t)\sin t}\, \mathrm dt\\[3ex]
\quad = \displaystyle \int \frac{(1-\sin t)(1+\sin t)}{(1+\sin t)\sin t}\, \mathrm dt = \displaystyle \int \frac{1}{\sin t} - 1\, \mathrm dt.
\end{array}$$
Thus, the final answer is:
$$\log\left| \tan \left(\frac{\arcsin x}{2}\right)\right| - \arcsin x + C,$$
since $\int \frac{1}{\sin t} \, \mathrm dt = \log\left| \tan \left(\frac {t}{2}\right) \right| + c.$
The answer given in the textbook is:
$$ \log\left|\frac{\sqrt{1-x}-\sqrt{1+x}}{\sqrt{1-x}+\sqrt{1+x}}\right| + 2\arctan \left(\sqrt{\frac{1-x}{1+x}}\right) +constant$$

I have derived that the arguments in the logarithms are the same, but it seems difficult to connect $\arcsin x $ with $2\arctan \left(\sqrt{\frac{1-x}{1+x}}\right).$

Let $x=\cos2y\implies0\le2y\le\pi$
$\sqrt{\dfrac{1-x}{1+x}}=\tan y$
$\implies2\arctan\sqrt{\dfrac{1-x}{1+x}}=2y=\arccos x=\dfrac\pi2-\arcsin x$
But why don't we try with
$$\sqrt{\dfrac{1-x}{1+x}}=u\implies x=\dfrac{1-u^2}{1+u^2}$$
