Derivation of$~\int\sqrt{\frac{x-1}{x+1}}\,dx=4\int\frac{t^2}{\left(1-t^2\right)^2}\,dt~~\text{where}~~~t:=\sqrt{\frac{x-1}{x+1}}~$
You can go from the RHS to the LHS...
\begin{align*} 4\int \frac{t^2}{(1-t^2)^2}\,dt = & 4\int \dfrac{\frac{x-1}{x+1}}{\left(1-\frac{x-1}{x+1}\right)^2}\cdot \dfrac{1}{\sqrt{\frac{x-1}{x+1}}(1+x)^2} dx \\ = & \int \sqrt{\frac{x-1}{x+1}}\,dx \end{align*}
Or, from the LHS to the RHS:
Since you can easily see that $\displaystyle x = \frac{1+t^2}{1-t^2}, \quad \frac{dx}{dt} = \frac{4t}{(1-t^2)^2}$, you have that
$$ \int \sqrt{\frac{x-1}{x+1}}\,dx = \int t \cdot \frac{4t}{(1-t^2)^2}\, dt = 4 \int \frac{t^2}{(1-t^2)^2}\, dt. $$
Notice that if $x<-1$ or $x\geq 1$ $$ t = \sqrt{\frac{x-1}{x+1}} \iff (x+1) \,t^2 = x-1 \\ \iff x = \frac{1+t^2}{1-t^2} $$ Therefore $\mathrm d x = \frac{4\,t}{(1-t^2)^2}\, \mathrm d t$ and so $$ \int\sqrt{\frac{x-1}{x+1}} \mathrm d x = \int \frac{4\,t^2}{(1-t^2)^2}\mathrm d t $$