Define $$I_n=\oint_C\frac{dz}{(z-n)^2+\pi^2},$$ where $n$ is a positive integer. The contour C runs along the real axis from −100 to 100 and returns on the upper semicircle, counterclockwise as shown. Find $\sum_{n=1}^5I_n$ as an integer.
Factor the denominator as $(z-n-i\pi)(z-n+i\pi)$. For each $n=1,\ldots,5$, the pole $n+i\pi$ is inside the upper semicircle, since $\sqrt{n^2+\pi^2}<100$, while $n-i\pi$ is outside. The enclosed residue is $1/(2i\pi)$, so the residue theorem gives $I_n=2\pi i/(2i\pi)=1$. Summing the five integrals gives 5.
More Complex analysis: Cauchy-Riemann conditions, Cauchy's theorem, singularities, residue theorem and applications questions