Help with integrating $\int \frac{dx}{1+\sqrt{\tan(x)}}$ Starting off with subbing $u^2 = \tan(x)$ to remove the square root, I got:

*

*$$\int \frac{2u}{(1+u)(1+u^4)} du$$ (Deriving that $\sec^2(x) = 1+u^4$)

Then by applying the partial fractions method, I get:


*$$\int \frac{-1}{1+u} du + \int \frac{u^3-u^2+u+1}{1+u^4} du$$
The first integral is manageable but for the second one I had to split the individual terms in the numerator into their own fractions to further obtain:


*$$\int \frac{u^3}{1+u^4}du +\int \frac{u}{1+u^4}du + \int \frac{1-u^2}{1+u^4}du $$
Now, the first two I could solve however it is the last one that I am unable to move forward with;
$$ \int \frac{1-u^2}{1+u^4}du $$

Since the other parts of your integrand are simple, we look at the remaining part as requested.  Note that
$$\frac{1-z^2}{1+z^4} = \frac{z^2(z^{-2} - 1)}{z^2(z^{-2} + z^2)} = \frac{-(1 - z^{-2})}{(z + z^{-1})^2 - 2}. \tag{1}$$
Hence the substitution $$v = z + z^{-1}, \quad dv = 1 - z^{-2} \, dz, \tag{2}$$ yields
$$\begin{align}
\int \frac{1-z^2}{1+z^4} \, dz &= -\int \frac{dv}{v^2 - 2} \\
&= \frac{1}{2\sqrt{2}} \int \frac{1}{v + \sqrt{2}} - \frac{1}{v - \sqrt{2}} \, dv \\
&= \frac{1}{2\sqrt{2}} \log \left| \frac{v + \sqrt{2}}{v - \sqrt{2}} \right| + C \\
&= \frac{1}{2\sqrt{2}} \log \left| \frac{z^2 + \sqrt{2}z + 1}{z^2 - \sqrt{2}z + 1} \right| + C.
\tag{3} \end{align}$$
