Show that $\int_{-\infty}^{\infty}\frac{\cos(x)}{(x^2+1)^2} dx = \frac{\pi}{e}$ using complex analysis 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.
 A: 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}$$

A: First rewrite $\cos(x) = \Re(e^{ix}) $ so you want to compute $\Re\int_{-\infty}^\infty \frac{e^{ix}}{(x^2+1)^2}dx.$ Now you can say this is equal to $\Re\int_{\mathcal{C}} \frac{e^{iz}}{(z^2+1)^2}dz$ where $\mathcal{C}$ is a counterclockwise oriented infinitely large closed rectangle in the upper half plane with its bottom on the real axis. This is true because the integrand decays rapidly to zero as $|z|\rightarrow\infty$ in the upper half plane.
Now since $\mathcal{C}$ is a closed contour, the integral can be computed by the Residue theorem. So you need to find the poles inside the contour and compute their residues. The denominator is $(z^2+1)^2 = (z+i)^2(z-i)^2,$ so it looks like the pole you need to find the residue of is the 2nd order pole at $z=i.$ So look up how to calculate the residue of a second order pole, and calculate it. 
(Basically, you need to expand $e^{iz}/(z+i)^2$ as a Taylor series about $i$. The residue will then be the coefficient of the $(z-i)^1$ term).
