<s>[INST] Difficult integral involving tangent and square root functions How do I go about integrating this function:
$$\int{\sqrt{\tan{x}}} \,dx$$
 [/INST] Subbing $x=\arctan{u^2}$, $dx = (2 u)/(1+u^4) du$ produces 
$$2 \int du \frac{u^2}{1+u^4}$$
It turns out that 
$$1+u^4=(1+\sqrt{2} u+u^2)(1-\sqrt{2} u+u^2)$$
so that we may invoke partial fractions.  The result is that the integral becomes
$$\frac1{\sqrt{2}} \int du \left (\frac{u}{1-\sqrt{2} u+u^2} - \frac{u}{1+\sqrt{2} u+u^2} \right )$$
which is equal to
$$\frac1{\sqrt{2}} \int du \left (\frac{u-\frac1{\sqrt{2}}}{\frac12 + \left (u-\frac1{\sqrt{2}}\right )^2} - \frac{u+\frac1{\sqrt{2}}}{\frac12 + \left (u+\frac1{\sqrt{2}}\right )^2} \right )\\+ \frac12 \int du \left (\frac1{\frac12 + \left (u-\frac1{\sqrt{2}}\right )^2}-\frac1{\frac12 + \left (u+\frac1{\sqrt{2}}\right )^2} \right )$$
which evaluates to
$$\frac{1}{2 \sqrt{2}} \log{\left (\frac{1-\sqrt{2} u+u^2}{1+\sqrt{2} u+u^2} \right )} -\frac1{\sqrt{2}} \arctan{\left (\frac1{u^2} \right )}+C$$
Back substitute $u=\sqrt{\tan{x}}$ and you are done.  Note that there is some simplification that may be made by observing that
$$\frac1{\tan{x}}=\tan{\left (\frac{\pi}{2}-x \right )}$$
</s>