Integrate $\int \frac{1}{1+x+x^4}dx$ 
Find $$\int \frac{{\rm d}x}{1+x+x^4}.$$

WA gives a result, which introduces complex numbers. But according to the algebraic fundamental theorem, any rational fraction can be integrated over the real number field. 
How to do this?

Factorize
$$x^4 +x+ 1= \left(x^2+ax+\frac{a^3-1}{2a}\right)\left(x^2-ax+\frac{a^3+1}{2a}\right)$$
where $a$ satisfies $a^6-4a^2-1=0$, or
$$a=\frac2{\sqrt[4]3}\sqrt{\cos\left(
\frac13\cos^{-1}\frac{3\sqrt3}{16} \right)}
$$
Then, decompose the integrand
$$\frac1{1+x+x^4}
= \frac a{2a^6+1} \bigg(\frac{2a^2x+2a^3+1}{x^2+ax+\frac{a^3-1}{2a}}
-\frac{2a^2x-2a^3+1}{x^2-ax+\frac{a^3+1}{2a}} \bigg)$$
and integrate
\begin{align}
&\int \frac{dx}{1+x+x^4}\\
=&\ \frac a{2a^6+1} \int \bigg(\frac{a^2(2x+a)+ a^3+1}{x^2+ax+\frac{a^3-1}{2a}}
-\frac{a^2(2x-a)-a^3+1}{x^2-ax+\frac{a^3+1}{2a}} \bigg)dx\\
=&\ \frac {a^{3/2}}{a^6+\frac12} \bigg( 
\frac {a^3+1}{\sqrt{a^3-2}}\tan^{-1}\frac{\sqrt a(2x+a)}{\sqrt{a^3-2}}
+\frac {a^3-1}{\sqrt{a^3+2}}\tan^{-1}\frac{\sqrt a(2x-a)}{\sqrt{a^3+2}}\\
&\hspace{20mm} + \frac{a^{3/2}}2\ln \frac{x^2+ax+\frac{a^3-1}{2a}}{x^2-ax+\frac{a^3+1}{2a}}  \bigg)+C
\end{align}
