Integral with binomial to a power $\int\frac{1}{(x^4+1)^2}dx$ I have to solve the following integral:
$$\int\frac{1}{(x^4+1)^2}dx$$
I tried expanding it and then by partial fractions but I ended with a ton of terms and messed up. I also tried getting the roots of the binomial for the partial fractions but I got complex roots and got stuck. Is there a trick for this kind of integral or some kind of helpful substitution? Thanks. 
EDIT:
I did the following:
Let $x^2=\tan\theta$, then $x = \sqrt{\tan\theta}$ and $dx=\frac{\sec^2\theta}{2x}d\theta$ 
Then:
$$I=\int\frac{1}{(x^4+1)^2}dx = \int\frac{1}{(\tan^2\theta+1)^2} \frac{\sec^2\theta}{2x}d\theta=\int\frac{1}{\sec^4\theta} \frac{\sec^2\theta}{2x}d\theta$$
$$I=\frac{1}{2}\int{\frac{1}{\sec^2\theta \sqrt{\tan\theta}}}d\theta$$.
After this I don't know how to proceed. 

Hints:
$$\frac1{(x^4+1)^2}=\frac{x^4+1-x^4}{(x^4+1)^2}=\frac1{x^4+1}-\frac{x^4}{(x^4+1)^2}$$ and by parts
$$4\int\frac{x^3x}{(x^4+1)^2}dx=-\frac x{x^4+1}+\int\frac{dx}{x^4+1}.$$
This way we can get rid of the square at the denominator, and we are left with
$$\frac1{x^4+1}.$$
Now using the factorization of the quartic binomial,
$$\frac{\sqrt8}{x^4+1}=\frac{x+\sqrt2}{x^2+\sqrt2x+1}-\frac{x-\sqrt2}{x^2-\sqrt2x+1}.$$
Here, by completing the square, we can handle the terms $\sqrt2x$ in the denominators, and solve with terms $\log(x^2\pm\sqrt2x+1)$ and $\arctan(\sqrt2x\pm1)$.
