I've been attempting to find a formula for $\int\tan(x)^{1/n}dx, n\in\Bbb N$.
I started out by performing the substitution $$u=\tan(x)^{1/n}$$
$$dx=\frac {nu^{n-1}}{1+u^{2n}}du$$ to transform the integral into $$n\int \frac{u^n}{1+u^{2n}}du$$
This is a relatively simple rational function, so it should be possible to solve via a partial fraction expansion. For the simple case where $n=2$, I was able to rewrite the integral as $$\frac{\sqrt2}{2}\left(\int\frac{u}{u^2-\sqrt2u+1}du - \int\frac{u}{u^2+\sqrt2u+1}du\right)$$
Which can then be solved by completing the square to yield $$\frac{\sqrt2}{4}\ln\left(\left(\sqrt{\tan{x}}-\frac{\sqrt2}{2}\right)^2+\frac{1}{2}\over\left(\sqrt{\tan{x}}+\frac{\sqrt2}{2}\right)^2+\frac{1}{2}\right)+\frac{\sqrt2}{2}\left(\arctan\left({\sqrt{2\tan{x}}-1}\right)+\arctan\left({\sqrt{2\tan{x}}+1}\right)\right)+C$$
However, I can't figure out how to factor the denominator for the partial fraction expansion of the general case. It will always be a product of $n$ irreducible quadratic factors, clearly, but I don't know how to locate them. I have managed to find the complex linear factors, using Euler's identity to find that they're of the form $$x\pm e^{im\pi\over{2n}}$$ where m is allowed to vary from 1 to $2n$. How can I combine these linear factors into real, irreducible quadratics for use in my partial fraction expansion? Alternatively, is there a simpler method of evaluating this integral? Any help would be vastly appreciated.