<s>[INST] Help with indefinite integration I am learning indefinite integration, yet am having problems understanding and recognizing where to substitute what. a good trick is to attempt  convert algebraic expressions into trigonometric and vice versa. However, despite doing so, I am unable to solve the integral. For example, in attempting to integrate:
$$\sqrt\frac{1-\sqrt x}{1+ \sqrt x}$$
I substituted $x = \cos^2 t$ in order to convert it to a trigonometric equation. However, I am still unable to solve the integral. 
 [/INST] Let 
\begin{align}
I = \int \sqrt{\frac{1 - \sqrt{x}}{1+\sqrt{x}}} \, dx
\end{align}
and make the substitution $x = t^{2}$ to obtain
\begin{align}
I = 2 \, \int \sqrt{\frac{1-t}{1+t}} \, t \, dt.
\end{align}
Now let $t = \cos(2\theta)$ to obtain
\begin{align}
I &= -4 \, \int \sqrt{\frac{1- \cos(2\theta)}{1+\cos(2\theta)}} \, \, \cos(2\theta) \,  \sin(2\theta) \, d\theta \\
&= -2 \, \int \sqrt{\frac{2 \sin^{2}\theta}{2 \cos^{2}\theta}} \, \sin(4\theta) \, d\theta \\
&= -2 \, \int \tan(\theta) \, \sin(4\theta) \, d\theta = 2 \theta - 2 \sin(2\theta) + \frac{\sin(4\theta)}{2}.
\end{align}
Reviewing the substitutions it is evident that $2\theta = \cos^{-1}(\sqrt{x})$ and that
\begin{align}
I = \cos^{-1}(\sqrt{x}) - 2 \, \sqrt{1-x} + \sqrt{x(1-x)} + c_{0}
\end{align}
</s>