How to solve $\int \frac{x^4 + 1 }{x^6 + 1}$? 
How to solve $\int \frac{x^4 + 1 }{x^6 + 1}$ ?  

The numerator is a irreducible polynomial so I can't use partial fractions.
I tried the substitutions $t = x^2, t=x^4$ and for the formula $\int u\,dv = uv - \int v\,du$ I tried using: $u=\frac{x^4 + 1 }{x^6 + 1} , \,dv=\,dx \\ u=\frac{1}{x^6 + 1} , \,dv= (x^4 + 1) \,dx \\u=x^4 + 1 , \,dv=\frac{\,dx}{x^6 + 1}$  
But I always get more complicated integrals.
Any hints are appreciated! 

OK it is a rational function so we preform a partial fraction decomposition.
The first step is to factor the denominator into linear and quadratic factors.
$$x^6+1=(x^2+1)(x^4-x^2+1)=(x^2+1)((x+1)^2-x^2))=
(x^2+1)(x^2-x+1)(x^2+x+1)$$
Now we find
$$\frac{x^4+1}{x^6+1}=\frac{2}{3}\frac{1}{x^2+1}+\frac{1}{6}\frac{1}{x^2-x+1}+\frac{1}{6}\frac{1}{x^2+x+1}$$
So we have 
$$\frac{2}{3}\int \frac{dx}{x^2+1}+\frac{1}{6}\int\frac{dx}{(x-\frac{1}{2})^2+
\frac{3}{4}}+\frac{1}{6}\int\frac{dx}{(x+\frac{1}{2})^2+\frac{3}{4}}$$
Giving $$\frac{2}{3}\arctan x+\frac{1}{3\sqrt{3}}\arctan \frac{2}{\sqrt{3}}(x-\frac{1}{2})+\frac{1}{3\sqrt{3}}\arctan \frac{2}{\sqrt{3}}(x+\frac{1}{2})$$
in the highly unlikely event that I made no mistakes.
