Using the residue theorem Is it possible to evaluate
$$\int_{-\infty}^\infty \frac{x^2}{(x^2+1)^2} \, dx $$
using the residue theorem, as opposed to Calc 1 methods? 
How can I get started using the residue theorem? What integrand can I use in terms of $z$? I think I need to use a half-disk.
 A: Use the integral $$\int_R \frac{z^2}{(z^2 + 1)^2} dz$$ where $R$ is a semicircle with base on the real interval $(-r, r)$ for some $r$. Then take $r \rightarrow \infty$ to get your integral (the integral over the part not on the real line goes to $0$ as $r \rightarrow \infty$). 
A: Write the function in a complex variable and find its poles. Then let the closed contour $C$ be consisting of the interval $[-R,R]$ and semicircle $C_R$ of radius $R>m$.
(m is a number obtained by inspecting the poles so that the semi circle contains all the poles that are in the upper half plane $\Im(z)>0$).
Then 
$$\oint_C f(z) dz=\int_{-R}^R f(x)dx+ \int_{C_R} f(z)dz$$
Evaluate the contour interval using the residues at the poles obtained earlier (check their order!) Since the deg of the numerator is 2 and deg of denominator is 4 (=deg num +2) it satisfies the hypothesis of a theorem that says the integral over $C_R$ goes to zero as $R \to \infty$. Taking the limit as $R \to \infty$, we have the original real integral equal to the value obtained by computing the contour integral with the residue theorem.
I think that's it, let me know if you want me to expand on details.
