Finding $\int_{-\infty}^\infty \frac{x^2}{x^4+1}\;dx$ $$\int_{-\infty}^\infty \frac{x^2}{x^4+1}\;dx$$
I'm trying to understand trigonometric substitution better, because I never could get a good handle on it.  All I know is that this integral is supposed to reduce to the integral of some power of cosine.  I tried $x^2=\tan\theta$, but I ended up with $\sin\theta\cos^3\theta$ as my integrand.  Can someone explain how to compute this?

Via contour integration $\oint_C \frac{z^{\alpha-1}}{{1+z}} dz$ it was shown that
$$\int_0^\infty \frac{y^{\alpha-1}}{1+y} dy = \frac{\pi}{\sin \pi \alpha}.$$
Let $y=x^4$ so that $dy = 4x^3 dx.$
$$\int_{-\infty}^\infty \frac{x^2}{1+x^4} dx =\frac{1}{4} \int_{-\infty}^\infty \frac{y^{-1/4}}{1+y} dy  = \frac{1}{2} \int_0^\infty \frac{y^{-1/4}}{1+y}dy=\frac{1}{2} \frac{\pi}{\sin \frac{3\pi}{4}}=\frac{\pi}{\sqrt{2}}.$$
