How to calculate $\int_{-\infty}^\infty\frac{x^2+2x}{x^4+x^2+1}dx$? I want to calculate the following integral: $$I:=\displaystyle\int_{-\infty}^\infty\underbrace{\frac{x^2+2x}{x^4+x^2+1}}_{=:f(x)}dx$$ Of course, I could try to determine $\int f(x)\;dx$ in terms of integration by parts. However, I don't think that's the way one should do this. So, what's the trick to calculate $I$?

As noted in the comments, the integral is:
$$I=\int_{-\infty}^{\infty} \frac{x^2}{x^4+x^2+1}\,dx=2\int_0^{\infty} \frac{x^2}{x^4+x^2+1}\,dx\,\,\,(*)$$
With the change of variables $x\mapsto 1/x$, 
$$I=2\int_{0}^{\infty} \frac{1}{x^4+x^2+1}\,dx\,\,\,\,\,\,(**)$$
Add $(*)$ and $(**)$ i.e
$$2I=2\int_0^{\infty} \frac{1+x^2}{x^4+x^2+1}\,dx \Rightarrow I=\int_0^{\infty} \frac{1+\frac{1}{x^2}}{x^2+\frac{1}{x^2}+1}\,dx$$
Rewrite the denominator as $\left(x-\dfrac{1}{x}\right)^2+3$ and use the substitution $x-\dfrac{1}{x}=t$,
$$\Rightarrow I=\int_{-\infty}^{\infty} \frac{dt}{t^2+3}=\boxed{\dfrac{\pi}{\sqrt{3}}}$$
