How to evaluate $\int{\sqrt{\tan(x)}\,dx}$ This might be a simple question, but how do you evaluate $\int{\sqrt{\tan(x)}\,dx}$ ? I've tried substitution with $u=\tan(x)$, that introduced a $\sec^2(x)$, I've also tried integration by parts, still stuck... 
 A: Take $u=\sqrt{\tan(x)}$ so that $\sec^2 x = \tan^2 x + 1 = (u^2)^2 + 1 = u^4 + 1$. hence :
$$(u^4 + 1) \, dx = 2u \, du $$
Thus:
$$dx = \frac{2u \, du}{u^4 + 1}$$
By substitution in the first integral:
$$\int (\tan x)^{1/2} \, dx =\int u \frac{2u \, du}{1 + u^4} =\int \frac{2u^2 \, du}{u^4 + 1}$$
And everything now is a matter of rational function integration, and can be solved using partial fractions. A s a hint for the next steps the denominator can be factored as $(u^2 - \sqrt{2} u + 1)(u^2 + \sqrt{2}u + 1)$
A: First attempt: let $u^2=\tan x$.  This gives the integral
$$I=\int \frac{2u^2}{u^4+1}\,du$$
which can be integrated by factorising the denominator and using partial fractions.  However the factorisation involves surds and is rather messy.
Better: let $u^2=2\tan x$.  This gives
$$I=\frac1{\sqrt2}\int \frac{4u^2}{u^4+4}\,du
   =\frac1{\sqrt2}\int \frac{u}{u^2-2u+2}-\frac{u}{u^2+2u+2}\,du\ .$$
Observe that except for the constant out the front, no surds are involved.  Now substitute $v=u-1$ for the first bit and $v=u+1$ for the second bit.  You will need to be careful with the algebra, but it's not all that bad.
