Evaluate the integral using the theory of residues: $\int_{-\infty}^{\infty} \frac{dx}{(x^2+1)^2(x^2+16)}$ $$\int_{-\infty}^{\infty} \frac{dx}{(x^2+1)^2(x^2+16)}$$
My attempt:
We are integrating over the real axis, which is the real part of a set of complex numbers, so
$$=\int_{-\infty}^{\infty} \frac{dz}{(z^2+1)^2(z^2+16)}$$
$$=\int_{-\infty}^{\infty} \frac{dz}{((z+i)(z-i))^2(z+4i)(z-4i)}$$
But I notice that all of the singularities are imaginary! Should this give me pause? What should I do now?
 A: Consider the contour $\Gamma$ consisting of the line segment joining $(-\rho, 0)$ to $(\rho, 0)$ enclosed by the upper semicircle $C : |z| = \rho$. It is clear that $\Gamma$ is the boundary of a simple closed region.
Hence by the Residue Theorem, $\int_\Gamma f = 2\pi i \operatorname{Res}(f; \, z_i)$, where $f(z)=\frac{1}{(z^2+1)^2 (z^2+16)}$ and $z_i$ are the enumeration of the singularities in $\Gamma$.
On the other hand, $\int_\Gamma f = \int_{-\rho}^\rho f + \int_C f$. Rearranging and sending $\rho \to \infty$, we find that the integral to be computed is 
$$I=2\pi i \operatorname{Res}(f; \, z_i)-\int_C f.$$
It can be shown that the integral $\int_C f$ vanishes. Thus, all that remains to be done is to compute the residues of $f$ in $\Gamma$.
A: You should integrate over a semicircle contour of radius $R$ centered at the origin. Name this contour $\gamma$ and consider the integral
$$ \int_\gamma f(z)dz $$
which can be calculated using the residue theorem. On the other hand, we can break up the contour into separate pieces: $\gamma = [-R,R] \cup C_R$, where $C_R$ is the semicircular part of the contour. Doing this we see that
$$ \int_\gamma f(z)dz = \int_{-R}^R f(x)dx + \int_{C_R}f(z)dz $$
We know the expression on the left from the residue theorem, and you can prove that as you let $R \to \infty$ the integral over $C_R$ vanishes. What you are left with after this happens is the result you are looking for.
