# Evaluate the integral \int_{-\infty}^{\infty}\frac{\cos(x)}{x^2+1}dx

Evaluate the integral ${\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}\frac{\mathrm{cos}\left(x\right)}{{x}^{2}+1}dx$
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

Thomas White

Method 1:
Note that the function $\frac{{e}^{iz}}{{z}^{2}+1}$ has poles at $±i$. Then, by Cauchy's Integral Formula we have for $R>1$
${\oint }_{{C}_{R}}\frac{{e}^{iz}}{{z}^{2}+1}dz={\int }_{-R}^{R}\frac{{e}^{ix}}{{x}^{2}+1}dx+\int \frac{{e}^{iR{e}^{i\varphi }}}{\left(R{e}^{i\varphi {\right)}^{1}+1}}iR{e}^{i\varphi }d\varphi$ (1)
$=2\pi i\frac{{e}^{i\left(i\right)}}{2i}$
$=\frac{\pi }{e}$
As $R\to \mathrm{\infty }$, the second integral on the right-hand side of (1) approaches 0. Therefore, we find that
${\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}\frac{{e}^{ix}}{{x}^{2}+1}dx=\frac{\pi }{e}$ (2)
Tacking the real part of both sides of (2) and exploiting the even symmetry yields
${\int }_{0}^{\mathrm{\infty }}\frac{\mathrm{cos}\left(x\right)}{{x}^{2}+1}dx=\frac{\pi }{2e}$
Method 2:
Let $f\left(a\right)$ be given by the convergent improper integral
$f\left(a\right)={\int }_{0}^{\mathrm{\infty }}\frac{\mathrm{cos}\left(ax\right)}{{x}^{2}+1}dx$ (3)
Since the integral ${\int }_{0}^{\mathrm{\infty }}\frac{x\mathrm{sin}\left(ax\right)}{{x}^{2}+1}dx$ is uniformly convergent for $|a|\ge \delta >0$, we may differentiate under the integral in (3) for $|a|>\delta >0$ to obtain
${f}^{\prime }\left(a\right)=-{\mathrm{\infty }}_{0}^{\mathrm{\infty }}\frac{x\mathrm{sin}\left(ax\right)}{{x}^{2}+1}dx$
$=-{\int }_{0}^{\mathrm{\infty }}\frac{\left({x}^{2}+1-1\right)\mathrm{sin}\left(ax\right)}{x\left({x}^{2}+1\right)}dx$
$=-{\int }_{0}^{\mathrm{\infty }}\frac{\mathrm{sin}\left(ax\right)}{x}dx+{\int }_{0}^{\mathrm{\infty }}\frac{\mathrm{sin}\left(ax\right)}{x\left({x}^{2}+1\right)}dx$
$=-\frac{\pi }{2}+{\int }_{0}^{\mathrm{\infty }}\frac{\mathrm{sin}\left(ax\right)}{x\left({x}^{2}+1\right)}dx$
Again, since the integ

###### Not exactly what you’re looking for?
Alex Sheppard
We may also see that
$I={\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}\frac{\mathrm{cos}\left(x\right)}{1+{x}^{2}}dx=2{\int }_{0}^{\mathrm{\infty }}\frac{\mathrm{cos}\left(x\right)}{1+{x}^{2}}dx$
$={\int }_{0}^{\mathrm{\infty }}\frac{{e}^{ix}+{e}^{-ix}}{1+{x}^{2}}dx=\frac{{e}^{-1}}{2}\left({\int }_{0}^{\mathrm{\infty }}\frac{{e}^{1+ix}+{e}^{1-ix}}{1+ix}dx+{\int }_{0}^{\mathrm{\infty }}\frac{{e}^{1+ix}+{e}^{1-ix}}{1-ix}dx\right)$
$=\frac{{e}^{-1}}{2i}\left({\int }_{0}^{\mathrm{\infty }}\frac{1}{x}\left(\frac{ix{e}^{1+ix}}{1+ix}+\frac{ix{e}^{1-ix}}{1-ix}\right)dx+{\int }_{0}^{\mathrm{\infty }}\frac{1}{x}\left(\frac{ix{e}^{1-ix}}{1+ix}+\frac{ix{e}^{1+ix}}{1-ix}\right)dx\right)$
and now applying the complex version of Frullanis
###### Not exactly what you’re looking for?
karton

Another approach: A combination of Feynman's Trick and Laplace Transforms:
$J={\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}\frac{\mathrm{cos}\left(x\right)}{{x}^{2}+1}dx$
Here let:
$I\left(t\right)={\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}\frac{\mathrm{cos}\left(xt\right)}{{x}^{2}+1}dx$
We see $I\left(1\right)=J$ and $I\left(0\right)=\pi$. Here we take the Laplace Transform w.r.t. 't':
$L\left[I\left(t\right)\right]={\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}\frac{L\left[\mathrm{cos}\left(xt\right)\right]}{{x}^{2}+1}dx={\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}\frac{s}{{s}^{2}+{x}^{2}}\cdot \frac{1}{{x}^{2}+1}dx\phantom{\rule{0ex}{0ex}}=\frac{s}{{s}^{2}-1}{\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}\left[\frac{1}{{x}^{2}+1}-\frac{1}{{x}^{2}+{s}^{2}}\right]dx\phantom{\rule{0ex}{0ex}}=\frac{s}{{s}^{2}-1}\left[\mathrm{arctan}\left(x\right)-\frac{1}{s}\mathrm{arctan}\left(\frac{x}{s}\right){\right]}_{-\mathrm{\infty }}^{\mathrm{\infty }}\phantom{\rule{0ex}{0ex}}=\frac{s}{{s}^{2}-1}\left[\left(\frac{\pi }{2}-\frac{1}{s}\cdot \frac{\pi }{2}\right)-\left(-\frac{\pi }{2}-\frac{1}{s}\cdot -\frac{\pi }{2}\right)\right]\phantom{\rule{0ex}{0ex}}=\frac{s}{{s}^{2}-1}\left[\pi -\pi \frac{1}{s}\right]=\frac{s}{{s}^{2}-1}\cdot \frac{s-1}{s}\pi =\frac{\pi }{s+1}$
We now take the inverse Laplace Transform:
$I\left(t\right)={L}^{-1}\left[\frac{\pi }{s+1}\right]=\pi {e}^{-t}$
And finally:
$J=I\left(1\right)=\pi {e}^{-1}=\frac{\pi }{e}$
Now this is essentially residue analysis, but I've found it to be a useful technique for integrals of this type.