Originally Posted by

**mathfied** Evaluate by integrating around a suitable closed contour:

$\displaystyle \int_{-\infty}^{\infty} \frac{cos3x}{x^2 + 4}$

Let $\displaystyle f(z) = \frac{e^{3iz}}{z^2+4}$. By using a semi-circle contour with $\displaystyle R>2$ we find:

$\displaystyle \int_{-R}^R \frac{e^{3ix}}{x^2+4} dx + \int_0^{\pi} \frac{Rie^{i\theta}e^{iRe^{i\theta}}}{R^2e^{2i\the ta}+4}d\theta = \oint_{\Gamma} \frac{e^{3iz}}{z^2+4} dz$.

Now take limit $\displaystyle R\to \infty$, the middle integral is zero (by Jordan's lemma) while the RHS integral is computed by residue theorem:

$\displaystyle \int_{-\infty}^{\infty} \frac{e^{3ix}}{x^2+4}dx = 2\pi i\cdot \mbox{res}(f,2i)$.

It remains to compute $\displaystyle \mbox{res}(f,2i)$ note that this is a simple pole:

$\displaystyle \mbox{res}(f,2i) = \lim_{z\to 2i} (z-2i)\cdot \frac{e^{3iz}}{(z+2i)(z-2i)} = \frac{e^{-6}}{4i}$.

Thus,

$\displaystyle \int_{-\infty}^{\infty} \frac{e^{3ix}}{x^2+4}dx = 2\pi i \cdot \frac{e^{-6}}{4i} = \frac{\pi}{2e^6}$.

This mean by equating real and imaginary parts,

$\displaystyle \int_{-\infty}^{\infty}\frac{\cos 3x}{x^2+4} dx = \frac{\pi}{2e^6}$.