Evaluate the integral $\int\limits_{-\infty}^\infty \frac{\cos(x)}{x^2+1}dx$. Evaluate the integral $\displaystyle\int\limits_{-\infty}^\infty \frac{\cos(x)}{x^2+1} dx$. 
Hint: $\cos(x) = \Re(\exp(ix))$
Hi, I am confused that if I need to use the Residue Theorem in order to solve this, and I am not sure where I should start. 

We may also see that $$I=\int_{-\infty}^{\infty}\frac{\cos\left(x\right)}{1+x^{2}}dx=2\int_{0}^{\infty}\frac{\cos\left(x\right)}{1+x^{2}}dx$$ $$ =\int_{0}^{\infty}\frac{e^{ix}+e^{-ix}}{1+x^{2}}dx=\frac{e^{-1}}{2}\left(\int_{0}^{\infty}\frac{e^{1+ix}+e^{1-ix}}{1+ix}dx+\int_{0}^{\infty}\frac{e^{1+ix}+e^{1-ix}}{1-ix}dx\right)$$ $$ =\frac{e^{-1}}{2i}\left(\int_{0}^{\infty}\frac{1}{x}\left(\frac{ixe^{1+ix}}{1+ix}+\frac{ixe^{1-ix}}{1-ix}\right)dx+\int_{0}^{\infty}\frac{1}{x}\left(\frac{ixe^{1-ix}}{1+ix}+\frac{ixe^{1+ix}}{1-ix}\right)dx\right)$$ and now applying the complex version of Frullani's theorem to the functions $$f\left(x\right)=\frac{xe^{1-x}}{1-x},\,g\left(x\right)=\frac{xe^{1-x}}{1+x}$$ we get $$I=\frac{e^{-1}}{i}\log\left(-1\right)=\color{red}{\pi e^{-1}}.$$
