Evaluate
$$\displaystyle \int_{-\infty}^{\infty} \frac{\cos x}{x^2+1}~dx$$
Evaluate
$$\displaystyle \int_{-\infty}^{\infty} \frac{\cos x}{x^2+1}~dx$$
Use Residue Theorem.
$$\int_{-\infty}^{\infty}\frac{\cos x}{x^2+1}dx=\Re\int_C\frac{e^{iz}}{z^2+1}dz=\Re 2\pi iRes|_{z=i}=\Re 2\pi i\frac{e^{-1}}{2i}=\frac{\pi}{e}.$$
Hints:
$$C_R:=[-R,R]\cup \Gamma_R:=\{z\in\Bbb C\;;\;z=Re^{it}\,,\;0\le t\le \pi\,\,,\,\,R>0\}$$
$$\left|\;\int\limits_{\Gamma_R}\frac{e^{iz}}{z^2+1}dz\;\right|\le \sup_{z\in\Gamma_R}\frac{e^{-R\sin t}}{R^2-1}R\pi\xrightarrow[R\to\infty]{}0\;,\;\;\text{since}\;\;R\sin t>0$$
$$\int\limits_{-R}^R\frac{e^{ix}}{x^2+1}dx\xrightarrow[R\to\infty]{}\int\limits_{-\infty}^\infty\frac{\cos t+i\sin t}{x^2+1}dx$$
$$\oint\limits_{C_R}f(z):=\frac{e^{iz}}{z^2+1}\,dz=2\pi iRes_{z=i}(f)=2\pi i\frac{e^{-1}}{2i}=\frac{\pi}{e}$$
Now put together the above, use Cauchy's Residue theorem and stuff.
Since the simplest route has already been taken, I'll take another. The function $x\mapsto e^{-|x|}$ is integrable on $\mathbb{R}$, and it's Fourier transform is easily computed as $$ \begin{align} \int_{-\infty}^\infty e^{-|x|}e^{-itx}\,dx& = \int_0^\infty e^{-x(1+it)}\,dx + \int_{-\infty}^0 e^{x(1-it)}\,dx \\ & = \frac{1}{1+it} + \frac{1}{1-it} \\ & = \frac{2}{1+t^2} \end{align} $$ This Fourier transform is integrable. So by the Fourier inversion formula, $$ \int_{-\infty}^\infty \frac{2}{1+t^2}e^{ixt}\,dt = 2\pi e^{-|x|}. $$ Take $x = 1$ and divide both sides by $2$.
Well that integral has poles at $z=i, -i$. You can integrate along a semicircle of radius $R>i$, use Cauchy's residue formula and let $R \rightarrow \infty$ and hope that the integral along the arc goes to $0$.
$$f(x)=\frac1{1+x^2}\quad \quad \hat f(\xi)=\pi e^{-|\xi|}\\ \mathcal F[f(x)e^{inx}]=\hat f(\xi-n)$$ Note that $f\in L^1(\Bbb R)$, so $\hat f$ is continuous: $$\int_{-\infty}^{+\infty}\frac{\cos x}{1+x^2}\,\mathrm dx = \frac12\int_{-\infty}^{+\infty}\lim_{\xi\to 0}\frac{e^{ix}}{1+x^2}e^{-ix\xi}\,\,\mathrm dx+\frac12\int_{-\infty}^{+\infty}\lim_{\xi\to 0}\frac{e^{-ix}}{1+x^2}e^{-ix\xi}\,\,\mathrm dx=\\ \frac{\pi}2\lim_{\xi\to0}(e^{-|\xi-1|}+e^{-|\xi+1|})=\frac{\pi}e$$