Computing the integral $\int \sqrt{\frac{x-1}{x+1}}\,\mathrm dx $ How do I compute the next integral:
$$\int \sqrt{\frac{x-1}{x+1}}\,\mathrm dx \;?$$
 A: Let $\sqrt{\dfrac{x-1}{x+1}} = t$. We then get that
$$\dfrac{x-1}{x+1} = t^2 \implies x-1 = t^2(x+1) \implies x = \dfrac{1+t^2}{1-t^2} \implies dx = \dfrac{4t}{(1-t^2)^2}dt$$
Hence, we get that
$$\int \sqrt{\dfrac{x-1}{x+1}} dx = \int \dfrac{4t^2}{(1-t^2)^2} dt$$ I trust you can take it from here via the method of partial fractions.
A: As for calculus, $x\ge1$ or $x<-1$
WLOG $x=\sec2u,0\le2u<\pi$
$\tan2u=\pm\sqrt{x^2-1}$
The plus sign needs to be considered if  $\tan2u\ge0$ if $0\le2u\le\dfrac\pi2$
$$I=\int\sqrt{\dfrac{x-1}{x+1}}dx=2\int\tan u\sec2u\tan2u\ du$$
$$=\int\dfrac{4\sin^2u}{\cos^22u}du$$
As $\cos2t=1-2\sin^2t,$
$$I=2\int(\sec^22u-\sec2u)du$$
Use How do I integrate $\sec(x)$?
A: We cannot have $-1\le x\le1$
Let $\displaystyle I=\int \sqrt{\frac{x-1}{x+1}}\,\mathrm dx ,J=\int \sqrt{\frac{x+1}{x-1}}\,\mathrm dx$
$\displaystyle I+J=\int\frac{|x-1|+|x+1|}{\sqrt{x^2-1}}\,\mathrm dx, I-J=\int\frac{|x-1|-|x+1|}{\sqrt{x^2-1}}\,\mathrm dx$
Case $\#1:$
If  $\displaystyle x>1,I+J=\int\frac{x-1+x+1}{\sqrt{x^2-1}}\,\mathrm dx, I-J=\int\frac{x-1-x+1}{\sqrt{x^2-1}}\,\mathrm dx$
For $\displaystyle I+J,$ set $\sqrt{x^2-1}=u$
For $\displaystyle I-J,$ set $x=\sec t$
Case $\#2:$  Check if $x<-1?$
