# How to calculate $\int\sqrt{\frac{1-\sqrt x}{1+\sqrt x}} dx$?

How to calculate?

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

I try to let $x=\cos^2 t$, then

$$\sqrt{\frac{1-\sqrt x}{1+\sqrt x}}=\tan\frac t2,\; dx=-2\sin t\cos t\,\mathrm dt$$

so $$\int\sqrt{\frac{1-\sqrt x}{1+\sqrt x}} \mathrm dx=-2 \int\tan\frac t2\sin t\cos t\,\mathrm dt$$

Thanks a lot!

You're almost there!

Just substitute: $$\tan \frac{t}{2} = \frac{1-\cos t}{\sin t}$$

Let $u = \dfrac{1 - \sqrt{x}}{1 + \sqrt{x}}$, then solve for $x = \left(\dfrac{1-u}{1+u}\right)^2$, and you can take it from here by finding $dx$ in terms of $du$.

After this, you want to make another round of substitution: $t = \sqrt{u}$, then:

$u = t^2 \Rightarrow du = 2tdt$, and you are back to integrating rational function. You can then proceed to "fraction decomposition" in variable $t$.

The best solution has already been given. Else you could have tried the double angle formulae $\sin(t) = \frac{2T}{1+T^2}$ and $\cos=\frac{1-T^2}{1+T^2}$ where $T=\tan(t/2)$ However the resulting integral requires integration by parts.

The solution given already is much faster!