Integrate with square root in square $\int \left(1 + \sqrt{\frac{x-1}{x+1}}\right)^2 dx$
How would you attack this? I've tried variable substitution with $t = \sqrt{\frac{x-1}{x+1}}$

Expand the square
$$\int {\left( {1 + \frac{{x - 1}}{{x + 1}}} \right)dx + 2\int {\sqrt {\frac{{x - 1}}{{x + 1}}} } } dx$$
Rearrange the first integral and collect $2$
$$2\left[ {\int {\left( {1 - \frac{1}{{x + 1}}} \right)} \;dx + \int {\sqrt {\frac{{x - 1}}{{x + 1}}} dx} } \right]$$
First integral is easy; for the second substitute $\dfrac{x-1}{x+1}=t$ 
Solve for $x$ and substitute
$$x = \frac{{t + 1}}{{1 - t}};\quad dx = \frac{{2\,dt}}{{{{\left( {t - 1} \right)}^2}}}$$
$$\int {\sqrt {\frac{{x - 1}}{{x + 1}}} \,dx}  = \int {\frac{{2\sqrt t }}{{{{\left( {t - 1} \right)}^2}}}} \;dt$$
Substitute again $u=\sqrt{t};\;t=u^2;\;dt=2u\,du$
$$\int {\frac{{2u \cdot 2u\,du}}{{{{\left( {{u^2} - 1} \right)}^2}}}}  = \int {\frac{{4{u^2}\,du}}{{{{\left( {{u^2} - 1} \right)}^2}}}} $$
use partial fraction to get
$$\frac{{4{u^2}}}{{{{\left( {{u^2} - 1} \right)}^2}}} = \frac{1}{{{{\left( {u + 1} \right)}^2}}} + \frac{1}{{{{\left( {u - 1} \right)}^2}}} + \frac{1}{{u - 1}} - \frac{1}{{u + 1}}$$
and integrate
$$\int {\frac{{4{u^2}}}{{{{\left( {{u^2} - 1} \right)}^2}}}} \,du = \int {\frac{{du}}{{{{\left( {u + 1} \right)}^2}}}}  + \int {\frac{{du}}{{{{\left( {u - 1} \right)}^2}}}}  + \int {\frac{{du}}{{u - 1}}}  - \int {\frac{{du}}{{u + 1}}} $$
$$ - \frac{1}{{u + 1}} + \frac{1}{{1 - u}} + \ln \left( {u - 1} \right) - \ln \left( {u + 1} \right) + C=$$
$$=\frac{{2u}}{{1 - {u^2}}} + \ln \frac{{u - 1}}{{u + 1}} + C = \frac{{2u}}{{1 - {u^2}}} + \ln \left( {1 - \frac{2}{{u + 1}}} \right) + C=$$
$$=\frac{{2\sqrt {\frac{{x - 1}}{{x + 1}}} }}{{1 - \frac{{x - 1}}{{x + 1}}}} + \ln \frac{{\sqrt {\frac{{x - 1}}{{x + 1}}}  - 1}}{{\sqrt {\frac{{x - 1}}{{x + 1}}}  + 1}} + C$$
Simplified result should be
$$2\left( {x+\ln \left( {\sqrt {\frac{{x - 1}}{{x + 1}}}  - \frac{x}{{x + 1}}} \right) + \left( {x + 1} \right)\sqrt {\frac{{x - 1}}{{x + 1}}} } \right) + C$$
