<s>[INST] 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 .     
 [/INST] Note
$$ \int {x^2 +  1 \over x^4 + x^2 + 1} dx=\int {1+\frac1{x^2} \over x^2 + \frac1{x^2} + 1} dx=\int\frac{1}{(x-\frac1x)^2+3}d(x-\frac1x).$$
Now letting $u=x-\frac1x$, you can easily solve the problem
</s>