Integral $\int \frac{x^2}{x^4+x^2+1}\ dx$ I have taken $(x^4+x^2+1)=u$ to differentiate it w.r.t. $x$ to get
$$\int \frac{x}{2u(2x^2+1)}\ du$$
 A: $$((x^2+1)+x)((x^2+1) -x) = x^4 + 2x^2 + 1 - x^2 = x^4 + x^2 + 1$$
Then use partial fraction method.
Edit: More hints,
$$((x^2+1)+x) + ((x^2+1) -x) = 2(x^2+1)$$
$$\int\frac{dx}{a^2+x^2} = \frac{1}{a}\tan^{-1}\frac{x}{a}$$
A: $$\dfrac{2x^2}{x^4+x^2+1}=\dfrac{x^2+1}{x^4+x^2+1}+\dfrac{x^2-1}{x^4+x^2+1}$$
$$=\dfrac{1+\dfrac1{x^2}}{x^2+1+\dfrac1{x^2}}+\dfrac{1-\dfrac1{x^2}}{x^2+1+\dfrac1{x^2}}$$
For the first integral:
As $\displaystyle\int\left(1+\dfrac1{x^2}\right)dx=x-\dfrac1x,$
write $x^2+1+\dfrac1{x^2}=1+\left(x-\dfrac1x\right)^2+2$
Can you handle the second integral?
A: If you are interested in the integral over $\mathbb{R}^+$, Glasser's Master Theorem allows a rapid evaluation:
$$ \int_{0}^{+\infty}\frac{x^2\,dx}{x^4+x^2+1}\stackrel{\text{parity}}{=}\frac{1}{2}\int_{-\infty}^{+\infty}\frac{dx}{\left(x-\frac{1}{x}\right)^2+3}\stackrel{\text{G.M.T}}{=}\frac{1}{2}\int_{-\infty}^{+\infty}\frac{dx}{x^2+3}=\color{blue}{\frac{\pi}{2\sqrt{3}}}.$$
A: By decomposition:
$$\frac{4x^2}{x^4+x^2+1}=\frac{2x}{x^2-x+1}-\frac{2x}{x^2+x+1}
\\=\frac{2x-1}{x^2-x+1}+\frac1{(x-\frac12)^2+\frac34}-\frac{2x+1}{x^2+x+1}+\frac1{(x+\frac12)^2+\frac34}.$$
The corresponding antiderivatives are
$$\log(x^2\pm x+1)$$ and $$\sqrt{\tfrac43}\arctan\left(\sqrt{\tfrac43}(x\pm\tfrac12)\right).$$
