<s>[INST] 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!
 [/INST] Here's the easiest method:
$$\begin{aligned} I= \int \sqrt{\frac{1 - \sqrt x}{1 + \sqrt x}} \ dx &= \int \frac{1 - \sqrt x}{\sqrt{1 - x}}\ dx\\& = \int \frac{1}{\sqrt{1-x}} - \frac{\sqrt x}{\sqrt{1-x}}\ dx\\& = -2\sqrt{1-x} - \int \frac{\sqrt x}{\sqrt{1-x}}\ dx + c_1\end{aligned}$$
Putting $x= \cos^2(t)$ so that $dx = -2\sin(t) \cos(t)\ dt$
$$\begin{aligned} I & = -2\sqrt{1-x}  + \int \frac{\cos(t)}{\sin (t)}\cdot 2 \sin(t) \cos(t)\ dt +c_1\\& = -2\sqrt{1-x} + 2\int \cos^2(t)\ dt+c_1\\& = -2\sqrt{1-x} + \int 1 + \cos(2t)\ dt+c_1\\& = -2\sqrt{1-x} + 2\int \cos^2(t)\ dt+c_1\\& = -2\sqrt{1-x} + t +\frac{\sin(2t)}{2}  + C\\& = -2\sqrt{1-x} + \cos^{-1}(\sqrt x) + \sqrt{x - x^2}  + C\end{aligned}$$
</s>