Better way of finding $\int {x^2 + 1 \over x^4 + x^2 + 1} dx$. 
$$\int {x^2 +  1 \over x^4 + x^2 + 1} dx$$


By separating partial fractions, 
$${Ax + B \over x^2 - x + 1}  + {Cx + D \over x^2 + x + 1}  = {x^2 + 1 \over x^4 + x^2 + 1} \\ \implies (Ax + B)(x^2 + x + 1) + (Cx + D)(x^2 - x + 1) = x^2 + 1$$
I get $$\begin{cases} A = -1/2 \\ 
 B = 1/2\\
 C = 1/2 \\
D = 1/2\end{cases}$$
For which the integrand becomes 
$${1 \over 2}\int {1 - x\over x^2 - x + 1} dx + {1\over2} \int {x + 1\over x^2 + x + 1} dx$$
Now these two are easy enough to solve but still very tedious, not to mention that partial fractions was also very tedious.
Is there a  less cumbersome way to solve this ? I tried to change the integrand of form $1 + 1/x^2$ so that I substitute $u = 1 - 1/x$ but was unsuccessful .     

Here is a funny way that I noticed by chance. I don't see really why it would work, it popped out when I played with the function. In any case, I think someone might get something out of it, so I post it.
We first notice that
$$
\frac{1+x^2}{1+x^2+x^4}-\frac{a}{b+x^2}=\frac{b-a+(1+b-a)x^2+(1-a)x^4}{b+(1+b)x^2+(1+b)x^4+x^6}
$$
If we choose $b=3$ then the denominator becomes
$$
3+(2x+x^3)^2,
$$
and the right-hand side becomes
$$
\frac{3-a+(4-a)x^2+(1-a)x^4}{3+(2x+x^3)^2}
$$
If we next choose $a=1$ the numerator magically becomes the derivative of $2x+x^3$! 
Thus, we conclude that
$$
\begin{aligned}
\int\frac{1+x^2}{1+x^2+x^4}\,dx
&=\int\Bigl(\frac{1}{3+x^2}+\frac{2+3x^2}{3+(2x+x^3)^2}\Bigr)\,dx\\
&=\frac{1}{\sqrt{3}}\Bigl(\arctan\frac{x}{\sqrt{3}}+\arctan\frac{2x+x^3}{\sqrt{3}}\Bigr)+C.
\end{aligned}
$$
