TITLE: Show that $\int_{-\infty}^{\infty}\frac{\cos(x)}{(x^2+1)^2} dx = \frac{\pi}{e}$ using complex analysis
QUESTION [5 upvotes]: I am trying to show that $\int_{-\infty}^{\infty}\frac{\cos(x)}{(x^2+1)^2} dx = \frac{\pi}{e}$ by considering integration around a rectangle in the upper half complex plane and substitute $z = x$. But I am not sure how to proceed from here. Any help is appreciated.

REPLY [4 votes]: I wouldn't integrate along a rectangle, but rather along a semicircle running along the real axis and then being closed in the upper half plane.
Since $\sin x$ is odd, we have:
\begin{align}
\int_{-\infty}^\infty\frac{\cos(x)}{(x^2+1)^2}dx=\int_{-\infty}^\infty\frac{\cos(x)+i\sin(x)}{(x^2+1)^2}dx=\int_{-\infty}^\infty\frac{e^{ix}}{(x^2+1)^2}dx\\
\end{align}
Consider the contour integral, where the contour $\Gamma$ runs along the real axis from $-R$ to $R$ and is then closed in the upper half plane, which we can split into two parts:
$$\oint_\Gamma\frac{e^{iz}}{(z^2+1)^2}dz=\int_{-R}^R\frac{e^{ix}}{(x^2+1)^2}dx+\int_\text{Arc}\frac{e^{iz}}{(z^2+1)^2}dz$$
However, by the Residue Theorem, we have:
\begin{align}
\oint_\Gamma\frac{e^{iz}}{(z^2+1)^2}dz &= 2\pi i \text{ Res}\left(\frac{e^{iz}}{(z^2+1)^2},i\right)\\
&=2\pi i\lim\limits_{z\rightarrow i}\frac{d}{dz}\frac{e^{iz}}{(z+i)^2}\\
&=2\pi i\lim\limits_{z\rightarrow i}\frac{ie^{iz}(z+3i)}{(z+i)^3}\\
&=2\pi i\frac{ie^{-1}\cdot4i}{(2i)^3}\\
&=\frac{\pi}{e}
\end{align}
Thus we have:
$$\frac{\pi}{e}=\int_{-R}^R\frac{e^{ix}}{(x^2+1)^2}dx+\int_\text{Arc}\frac{e^{iz}}{(z^2+1)^2}dz$$
Taking the limit as $R\rightarrow\infty$, the integral along the arc of the semi-circle vanishes, because the positive imaginary part of $z$ leads to an exponential damping factor in the upper half plane.
Thus, we are left with our desired result:

$$\int_{-\infty}^\infty\frac{\cos(x)}{(x^2+1)^2}dx = \frac{\pi}{e}$$