<s>[INST] Complex integration of $\int_{-\infty}^\infty \frac{dx}{(x^2+1)^2(x^2+16)}$ Complex integration of $\int_{-\infty}^\infty \frac{dx}{(x^2+1)^2(x^2+16)}$.
I see that the poles are at $i,-i,4i,-4i$ and only $i,4i$ are in the upper half plane. Then $\int_{-\infty}^\infty \frac{dx}{(x^2+1)^2(x^2+16)}= 2\pi i[ Res(f(x),i)+Res(f(x),4i)]$.
$Res(f(x),4i)=\frac{1}{(x^2+1)^2} |_{4i} = 1/225$ since 4i is of order 1.
$Res(f(x),4i)=\frac{d}{dx}[\frac{1}{x^2+16}]|_i=\frac{-2x}{(x^2+16)^2}|_i=-2i/225$ since i is a pole of order 2.
This gives that the integral is $2\pi i(\frac{1}{225}+\frac{2i}{225})$ but the answer isn't right. It should be $\frac{3\pi}{100}$ according to wolfram.
 [/INST] By residues, $\int_{-\infty}^{+\infty}\frac{dz}{z^2+1}=\pi $.
It follows that for any $r\in\mathbb{R}^+$ we also have $\int_{-\infty}^{+\infty}\frac{dz}{z^2+r^2}=\frac{\pi}{r}.$
If $A,B,C$ are three distinct real numbers $\geq 1$, by partial fraction decomposition we have
$$ \frac{1}{(x^2+A^2)(x^2+B^2)(x^2+C^2)} = \frac{1}{(x^2+A^2)(B^2-A^2)(C^2-A^2)}+\ldots$$
hence the integral over $\mathbb{R}$ of the LHS equals
$$ \frac{\pi}{A(-A^2+B^2)(-A^2+C^2)}+\frac{\pi}{B(-B^2+A^2)(-B^2+C^2)}+\frac{\pi}{C(-C^2+A^2)(-C^2+B^2)}$$
whose limit as $B\to A$ equals
$$ \frac{(2A+C)\pi}{2A^3 C(A+C)^2}.$$
Now you just have to replace $A$ with $1$ and $C$ with $4$ in the previous expression to get $\color{red}{\frac{3\pi}{100}}$.
</s>