Integration – Computing \int_{-\infty}^{\infty} \frac{\cos x}{x^{2} + a^{2}}dx Using Residue Calculus

complex-analysisdefinite integralsintegrationresidue-calculus

I need to find $\displaystyle\int_{-\infty}^{\infty} \frac{\cos x}{x^{2} + a^{2}}\ dx$ where $a > 0$. To do this, I set $f(z) = \displaystyle\frac{\cos z}{z^{2} + a^{2}}$ and integrate along the semi-circle of radius $R$. For the residue at $ia$ I get $\displaystyle\frac{\cos(ia)}{2ia}$. Then letting $R \rightarrow \infty$, the integral over the arc is zero, so I get $\displaystyle\int_{-\infty}^{\infty} \frac{\cos x}{x^{2} + a^{2}}\ dx = 2 \pi i \frac{\cos(ia)}{2ia} = \frac{\pi \cos(ia)}{a}$. But this is supposed to be $\displaystyle\frac{\pi e^{-a}}{a}$, so I am doing something wrong.

In a similar problem, I have to evaluate $\displaystyle\int_{-\infty}^{\infty} \frac{x \sin x}{x^{2} + a^{2}}\ dx$ and get $\pi i \sin(ia)$ whereas this is supposed to be $\pi e^{-a}$. I think I am getting some detail wrong in both cases. Can anyone enlighten me?

Best Answer

Let $\gamma$ be the path along the real axis then circling back counter-clockwise through the upper half-plane, letting the circle get infinitely big. $$ \begin{align} \int_{-\infty}^\infty\frac{\cos(x)}{x^2+a^2}\mathrm{d}x\tag{1} &=\Re\left(\int_{-\infty}^\infty\frac{\exp(ix)}{x^2+a^2}\mathrm{d}x\right)\\\tag{2} &=\Re\left(\int_{\gamma}\frac{\exp(ix)}{x^2+a^2}\mathrm{d}x\right)\\\tag{3} &=\Re\left(2\pi i\,\mathrm{Res}\left(\frac{\exp(ix)}{x^2+a^2},ia\right)\right)\\\tag{4} &=\Re\left(2\pi i\,\lim_{z\to ia}\frac{\exp(ix)}{x+ia}\right)\\\tag{5} &=\Re\left(2\pi i\,\frac{\exp(-a)}{2ia}\right)\\[3pt] &=\frac{\pi \exp(-a)}{a}\tag6 \end{align} $$ $(1)$: $\Re(\exp(ix))=\cos(x)$
$(2)$: The integral along the circle back through the upper half-plane vanishes as the circle gets bigger.
$(3)$: There is only one singularity of $\dfrac{\exp(ix)}{x^2+a^2}$ in the upper half-plane, at $x=ia$. The integral along $\gamma$ is the residue of $\dfrac{\exp(ix)}{x^2+a^2}$ at $x=ia$.
$(4)$: The singularity of $\dfrac{\exp(ix)}{x^2+a^2}$ at $x=ia$ is a simple pole. We can compute the residue as $\displaystyle\lim_{x\to ia}(x-ia)\frac{\exp(ix)}{x^2+a^2}=\lim_{x\to ia}\frac{\exp(ix)}{x+ia}$.
$(5)$: plug in $x=ia$.
$(6)$: evaluate


Following the same strategy, $$ \begin{align} \int_{-\infty}^\infty\frac{x\sin(x)}{x^2+a^2}\mathrm{d}x &=\Im\left(\int_{-\infty}^\infty\frac{x\exp(ix)}{x^2+a^2}\mathrm{d}x\right)\\ &=\Im\left(\int_{\gamma}\frac{x\exp(ix)}{x^2+a^2}\mathrm{d}x\right)\\ &=\Im\left(2\pi i\,\mathrm{Res}\left(\frac{x\exp(ix)}{x^2+a^2},ia\right)\right)\\ &=\Im\left(2\pi i\,\lim_{z\to ia}\frac{x\exp(ix)}{x+ia}\right)\\ &=\Im\left(2\pi i\,\frac{ia\exp(-a)}{2ia}\right)\\[6pt] &=\pi \exp(-a) \end{align} $$