How to solve the improper integral $\int_{-\infty}^{\infty} \frac{x^2}{x^6+9}dx$ (possible trig substitution) $$\int_{-\infty}^{\infty} \frac{x^2}{x^6+9}dx$$ I'm a bit puzzled as how to go about solving this integral. I can see that it isn't undefined on -infinity to infinity. But I just need maybe a hint on how to go about solving the problem.
 A: Hint: put $\;u = x^3$, so $\,du \;=\; 3x^2\, dx \;\implies\; x^2\, dx \;= \;\frac 13\, du$
This gives you $$\frac 13 \int_{-\infty}^\infty \frac {du}{u^2 + (3)^2} $$
Look familiar?:
Using one more substitution, let $\quad u =3\tan(\theta),\quad du =3\sec^2(\theta)\,d\theta, \quad \theta=\arctan\left(\frac{u}{3}\right)$
And determine the corresponding bounds for integrating.
A: It is natural to let $u=x^3$. But note that the substitution $x^3=3u$ is more efficient. 
A: With complex analysis: define the complex function
$$f(z)=\frac{z^2}{z^6+9}\;\;,\;\;\text{with simple poles at}\,\,\,z_k:=\sqrt[6] 9\,\,e^{\frac{\pi i}{6}(1+2k)}\;\;,\;k=0,1,2,3,4,5$$
Note that the only poles on the upper half plane are the first three ones $\,z_0,\,z_1,\,z_2\,$ , with residues
$$Res_{z=z_0}(f)=Res_{z=z_2}(f)=-\frac{i}{18}\;\;,\;\;\;Res_{z=z_1}(f)=\frac{i}{18}$$
Choosing the contour
$$C_R:=[-R,R]\cup\gamma_R:=\{z\in\Bbb C\;;\;|z|=R\,,\,\Im (z)\ge 0\}$$
we get, by Cauchy's Integral Theorem, that
$$(**)\;\;\;\;\;\;\;2\pi i\left(\sum_{k=0}^2 Res_{z=z_k}(f)\right)=\frac{\pi}{9}=\oint_{C_R}f(z)\,dz=\int\limits_{-R}^Rf(x)\,dx+\int\limits_{\gamma_R} f(z)\,dz$$
But
$$\left|\int\limits_{\gamma_R} f(z)\,dz\right|\le\max_{z\in \gamma_R}\frac{|z|^2}{|z^6+9|}\pi R\le\frac{\pi R^3}{R^6-9}\xrightarrow[R\to\infty]{}0$$
Thus passing to the limit in (**) above we get
$$\int\limits_{-\infty}^\infty\frac{x^2}{x^6+9}dx=\frac{\pi}{9}$$
