1

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.

  • Any idea for a contour? – Simply Beautiful Art Jul 26 '17 at 23:16
  • For the function there exist two singularities: +i, -i. -1 lies interior of unit circle, so if C is given as a region that does not contain the singularities, I would apply the Cauchy integral formula. However, the C is not given in the problem and to be honest I really do not know where I should proceed. – Hwi Moon Jul 26 '17 at 23:20
  • Add on the integral with integrand $i\sin(x)/(x^2+1),$ then apply your residue theorems to the integral with integrand $e^{ix}/(x^2+1).$ – Chickenmancer Jul 26 '17 at 23:20
  • @Chickenmancer I think the intention was to use $\cos(x)=\Re(e^{ix})$ instead, but that works too. – Simply Beautiful Art Jul 26 '17 at 23:22
  • 3
    The first example in the Wikipedia page seems to be the integral you want, taking $t=1$ and using the hint you mentioned https://en.wikipedia.org/wiki/Residue_theorem – Reveillark Jul 26 '17 at 23:22
  • @Reveillark Oh right, how lucky of us lol – Simply Beautiful Art Jul 26 '17 at 23:22
  • @Reveillark When $t=1,$ they're one in the same, so I obviously agree :P – Chickenmancer Jul 26 '17 at 23:23
  • So I must apply the Residue Theorem, is that correct? – Hwi Moon Jul 26 '17 at 23:24
  • @HwiMoon The Residue Theorem certainly solves the problem. There might be other ways of doing it (introducing a parameter and differentiating under the integral sign might do the trick), but using residues is probably the most straightforward method. – Reveillark Jul 26 '17 at 23:29

4 Answers4

5

METHODOLOGY $1$: Complex Analysis

Note that the function $\frac{e^{iz}}{z^2+1}$ has poles at $\pm i$. Then, by Cauchy's Integral Formula we have for $R>1$

$$\begin{align} \oint_{C_R}\frac{e^{iz}}{z^2+1}\,dz&=\int_{-R}^R \frac{e^{ix}}{x^2+1}\,dx+\int_0^\pi \frac{e^{iRe^{i\phi}}}{(Re^{i\phi})^1+1}\,iRe^{i\phi}\,d\phi\tag1\\\\ &=2\pi i \frac{e^{i(i)}}{2i}\\\\ &=\pi/e \end{align}$$

As $R\to \infty$, the second integral on the right-hand side of $(1)$ approaches $0$. Therefore, we find that

$$\int_{-\infty}^\infty \frac{e^{ix}}{x^2+1}\,dx=\frac{\pi}{e} \tag2$$

Taking the real part of both sides of $(2)$ and exploiting the even symmetry yields

$$\bbox[5px,border:2px solid #C0A000]{\int_0^\infty \frac{\cos(x)}{x^2+1}\,dx=\frac{\pi}{2e}}$$


METHODOLOGY $2$: Real Analysis

Let $f(a)$ be given by the convergent improper integral

$$f(a)=\int_0^\infty \frac{\cos(ax)}{x^2+1}\,dx \tag3$$

Since the integral $\int_0^\infty \frac{x\sin(ax)}{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

$$\begin{align} f'(a)&=-\int_0^\infty \frac{x\sin(ax)}{x^2+1}\,dx\\\\ &=-\int_0^\infty \frac{(x^2+1-1)\sin(ax)}{x(x^2+1)}\,dx\\\\ &=-\int_0^\infty \frac{\sin(ax)}{x}\,dx+\int_0^\infty \frac{\sin(ax)}{x(x^2+1)}\,dx\\\\ &=-\frac{\pi}{2}+\int_0^\infty \frac{\sin(ax)}{x(x^2+1)}\,dx\tag4 \end{align}$$

Again, since the integral $\int_0^\infty \frac{\cos(ax)}{x^2+1}\,dx$ converges uniformly for all $a$, we may differentiate under the integral in $(4)$ to obtain

$$f''(a)=\int_0^\infty \frac{\cos(ax)}{x^2+1}\,dx=f(a)\tag 5$$

Solving the second-order ODE in $(5)$ reveals

$$f(a)=C_1 e^{a}+C_2 e^{-a}$$

Using $f(0)=\pi/2$ and $f'(0)=-\pi/2$, we find that $C_1=0$ and $C_2=\frac{\pi}{2}$ and hence $f(a)=\frac{\pi e^{-a}}{2}$. Setting $a=1$ yields the coveted result

$$\bbox[5px,border:2px solid #C0A000]{\int_0^\infty \frac{\cos(x)}{x^2+1}\,dx=\frac{\pi}{2e}}$$

as expected!

Mark Viola
  • 179,405
3

Use the Fourier transform: $$\frac{2}{\pi}\int_{-\infty}^{\infty}\frac{e^{i\nu x}}{x^{2}+1}dx=e^{-\left|\nu\right|}$$

Just set $\nu=1$, divide by $\frac{2}{\pi}$, and take the real part of both sides.

MCS
  • 2,209
3

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}}.$$

Marco Cantarini
  • 33,062
  • 2
  • 47
  • 93
0

Another approach: A combination of Feynman's Trick and Laplace Transforms:

\begin{equation} J = \int_{-\infty}^{\infty}\frac{\cos(x)}{x^2 + 1}\:dx \end{equation}

Here let:

\begin{equation} I(t) = \int_{-\infty}^{\infty}\frac{\cos(xt)}{x^2 + 1}\:dx \end{equation}

We see $I(1) = J$ and $I(0) = \pi$. Here we take the Laplace Transform w.r.t. '$t$':

\begin{align} \mathscr{L}\left[I(t)\right] &= \int_{-\infty}^{\infty}\frac{\mathscr{L}\left[\cos(xt)\right]}{x^2 + 1}\:dx = \int_{-\infty}^{\infty} \frac{s}{s^2 + x^2}\cdot\frac{1}{x^2 + 1}\:dx \\ &=\frac{s}{s^2 - 1}\int_{-\infty}^{\infty}\left[\frac{1}{x^2 + 1} - \frac{1}{x^2 + s^2} \right]\:dx \\ &= \frac{s}{s^2 - 1} \left[ \arctan(x) - \frac{1}{s}\arctan\left(\frac{x}{s} \right)\right]_{-\infty}^{\infty} \\ &= \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] \\ &= \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} \end{align}

We now take the inverse Laplace Transform:

\begin{align} I(t) = \mathscr{L}^{-1}\left[ \frac{\pi}{s + 1}\right] = \pi e^{-t} \end{align}

And finally:

\begin{equation} J = I(1) = \pi e^{-1} = \frac{\pi}{e} \end{equation}

Now this is essentially residue analysis, but I've found it to be a useful technique for integrals of this type.