Integration of $\int_{-\infty}^\infty \dfrac{x^2 }{x^4 + a^4}\,dx$. $$\int_\infty^\infty \dfrac{x^2 }{x^4 + a^4}\,dx$$
The following question was given with the limits $\infty$ to $\infty$ but I believe that it was a typo and the lower limit would be $- \infty $ but with that, the question would become 
$$\int_{-\infty}^\infty \dfrac{x^2 }{x^4 + a^4}\,dx$$
And I was perplexed how to solve that. If I take $x^3=t$ then the numerator would become $dt$ but in the denominator I have $x^4$ and I couldn't convert it to $x^3$. So I don't know how to solve it 
 A: Hint. Assume $a \ne0$. One may write
$$
\begin{align}
\int_{-\infty}^\infty \dfrac{x^2 }{x^4 + a^4}\,dx&=\int_{-\infty}^\infty \dfrac{1 }{x^2 + \frac{a^4}{x^2}}\,dx
\\\\&=\int_{-\infty}^\infty \dfrac{1 }{\left(x -\frac{a^2}{x}\right)^2+2a^2}\,dx
\\\\&=\int_{-\infty}^\infty \dfrac{1 }{x^2+2a^2}\,dx
\\\\&=\frac{\pi\:\sqrt{2}}{2}\cdot\frac{1}{|a|}
\end{align}
$$ where we have used
$$
\int_{-\infty}^\infty f\left(x -\frac{a^2}{x}\right)dx=\int_{-\infty}^\infty f(x)\:dx
$$ proved here.
A: Consider the standard semi circle contour in the upper half of the complex plane, with $\gamma_r=\{re^{ix},x\in(0,\pi)\}$ and $\delta_r=[-r,r]$.  It thus follows swiftly that, assuming $a>0$:
$$\lim_{r\to\infty}\int_{\gamma_r}\frac{z^2}{z^4+a^4}\ dz=0$$
$$\begin{align}\lim_{r\to\infty}\oint\frac{z^2}{z^4+a^4}\ dz&=\lim_{r\to\infty}\int_{\delta_r}\frac{z^2}{z^4+a^4}\ dz\\&=\int_{-\infty}^{+\infty}\frac{x^2}{x^4+a^4}\ dx\\& =2\pi i\left(\frac1{4ae^{\pi i/4}}+\frac1{4ae^{3\pi i/4}}\right)\\&=\frac\pi{a\sqrt2}\end{align}$$
