# Calculating ${\int_{-\infty}^{\infty} \frac{\cos(\omega x)}{x^{2} + 25}\,{\rm d}x}$ using contour integration

I want to calculate $\displaystyle{ \int_{-\infty}^{\infty}\frac{\cos\left(\omega x\right)}{x^{2} + 25}\,{\rm d}x\,, \quad}$ for $\omega \in \mathbb{R}$

I thought of integrating along the line segment $\left[-R, R\right]$ and the semicircle $C = \left\{z: \left\vert z\right\vert = R, \; \Im z\geq 0\right\}$. In my book this is said to be a wrong method, but I don't understand why ( I even get the same result ).

Can someone explain me why this is wrong, and how it should be done instead?

-
Hint: You will need to integrate around two semi-circles that correspond to each of the poles at $x=\pm 5i$ and then calculate the appropriate residues. One may use a symmetry of the integrand as well to simplify the problem. –  Riemann1337 Oct 26 '13 at 9:31
@Riemann1337 The poles are at $z=\pm 5i$. And I think that this is the same as what I did (which is wrong). –  user102815 Oct 26 '13 at 9:35
@user102815 Emulate what was done here. –  Git Gud Oct 26 '13 at 9:35
Hello, welcome to Math.SE. I have changed the formatting of the title so as to make it take up less vertical space -- this is a policy to ensure that the scarce space on the main page is distributed evenly over the questions. See here for more information. Please take this into consideration for future questions. Thanks in advance. –  Lord_Farin Oct 26 '13 at 9:37
The result doesn't change if you write, in the integrand, $\large\left\vert \omega\right\vert$ instead of $\large\omega$ since the $\large\cos$ function is even. You can concentrate in just one case ( one semicircle ). –  Felix Marin Oct 26 '13 at 9:40

The problem lies with the fact that the cosine blows up along a semicircle in the upper or lower half plane. To do this correctly, you can break the cosine into complex exponentials, each of which satisfies Jordan's lemma on one or the other semicircular contour, as I demonstrate below.

Because cosine is even, we may assume that $\omega > 0$. Rewrite the integral as

$$\frac12 \int_{-\infty}^{\infty} dx \frac{e^{i \omega x} + e^{-i \omega x}}{x^2+25}$$

Break the integral in two. Now first consider the following contour integral

$$\oint_{C_+} dz \frac{e^{i \omega z}}{z^2+25}$$

where $C_+$ is a semicircle of radius $R$ in the upper half-plane. The contour integral is equal to

$$\int_{-R}^R dx \frac{e^{i \omega x}}{x^2+25} + i R \int_0^{\pi} d\theta \, e^{i \theta} \frac{e^{-\omega R \sin{\theta}} e^{i \omega R \cos{\theta}}}{R^2 e^{i 2 \theta}+25}$$

As $R \to \infty$ the second integral has a magnitude bounded from above by

$$\frac{2}{R} \int_0^{\pi/2} d\theta \, e^{-\omega R \sin{\theta}} \le \frac{2}{R} \int_0^{\pi/2} d\theta \, e^{-2 \omega R \theta/\pi} \le \frac{\pi}{2 \omega R^2}$$

Thus the second integral vanishes as $R \to \infty$. By the residue theorem, the contour integral is also equal to $i 2 \pi$ times the residue at the pole $z=5 i$. Therefore,

$$\int_{-\infty}^{\infty} dx \frac{e^{i \omega x}}{x^2+25} = i 2 \pi \frac{e^{i \omega (5 i)}}{2 \cdot 5 i} = \frac{\pi}{5} e^{-5 \omega}$$

Now consider the following contour integral:

$$\oint_{C_-} dz \frac{e^{-i \omega z}}{z^2+25}$$

where $C_-$ is a semicircle of radius $R$ in the lower half-plane. The contour integral is equal to

$$\int_{R}^{-R} dx \frac{e^{-i \omega x}}{x^2+25} + i R \int_{\pi}^{2 \pi} d\theta \, e^{i \theta} \frac{e^{\omega R \sin{\theta}} e^{-i \omega R \cos{\theta}}}{R^2 e^{i 2 \theta}+25}$$

Note that $\sin{(\pi+\theta)}=-\sin{\theta}$. As $R \to \infty$ the second integral has a magnitude bounded from above by

$$\frac{2}{R} \int_0^{\pi/2} d\theta \, e^{-\omega R \sin{\theta}} \le \frac{2}{R} \int_0^{\pi/2} d\theta \, e^{-2 \omega R \theta/\pi} \le \frac{\pi}{2 \omega R^2}$$

Thus the second integral vanishes as $R \to \infty$. By the residue theorem, the contour integral is also equal to $i 2 \pi$ times the residue at the pole $z=-5 i$. Therefore,

$$-\int_{-\infty}^{\infty} dx \frac{e^{i \omega x}}{x^2+25} = i 2 \pi \frac{e^{-i \omega (-5 i)}}{2 \cdot (-5 i)} = -\frac{\pi}{5} e^{-5 \omega}$$

Therefore, putting this all together, and considering the fact that the integrand is even with respect to $\omega$, we have

$$\int_{-\infty}^{\infty} dx \frac{\cos{\omega x}}{x^2+25} =\frac{\pi}{5} e^{-5 |\omega|}$$

-


The solutions of ${\rm I}''\pars{\omega} - {\rm I}\pars{\omega} = 0$ are lineal combination of $\expo{-5\omega}$ and $\expo{5\omega}$. The solution is written as $${\rm I}\pars{\omega} = \Theta\pars{-5\omega}\pars{A\expo{-5\omega} + B\expo{5\omega}} + \Theta\pars{\omega}\pars{C\expo{-5\omega} + D\expo{5\omega}}$$ where $A, B, C$ and $D$ are constants ( independent de $\omega$ ). The solution is an even function of $\omega$ which requires $A = D$ and $B = C$. That condition reduces ${\rm I}\pars{\omega}$ to: \begin{align} {\rm I}\pars{\omega} &= \Theta\pars{-\omega}\pars{A\expo{5\verts{\omega}} + B\expo{-5\verts{\omega}}} + \Theta\pars{\omega}\pars{B\expo{-5\verts{\omega}} + A\expo{5\verts{\omega}}} = A\expo{5\verts{\omega}} + B\expo{-5\verts{\omega}} \end{align} The boundary condition ${\rm I}\pars{0} = \pi/5$ leads to $A + B = \pi/5$. Then, $${\rm I}\pars{\omega} = 2A\sinh\pars{5\verts{\omega}} + {1 \over 5}\,\pi\expo{-5\verts{\omega}} \quad\mbox{and}\quad {\rm I}'\pars{\omega} = 5\bracks{2A\cosh\pars{5\verts{\omega}} - {1 \over 5}\,\pi\expo{-5\verts{\omega}}}\sgn\pars{\omega}$$ The differential equation leads to the condition $$\lim_{\epsilon \to 0^{+}} \int_{-\epsilon}^{\epsilon}{\rm I}''\pars{\omega}\,\dd\omega = -2\pi \quad\imp\quad \lim_{\epsilon \to 0^{+}} \bracks{{\rm I}'\pars{\epsilon} - {\rm I}'\pars{-\epsilon}} = -2\pi$$ $$-2\pi = 5\pars{2A - {\pi \over 5}} - 5\pars{-2A + {\pi \over 5}} = 20A - 2\,\pi\ \imp\ A = 0\ \imp\ {\rm I}\pars{\omega} = {1 \over5}\,\pi\expo{-5\verts{\omega}}$$

Then $${\large \int_{-\infty}^{\infty}{\cos\pars{\omega x} \over x^{2} + 25}\,\dd x = {1 \over5}\,\pi\expo{-5\verts{\omega}}}$$

-