# Calculating a real integral with a complex integral

1. Dec 7, 2013

### jimmycricket

1. The problem statement, all variables and given/known data
Evaluate the following real integral using complex integrals:
$\int_0^\infty \frac{cos(2x)}{x^2+4}dx$

2. Relevant equations
Cauchy's Residue Theorem for simple pole at a: $Res(f;a)=\displaystyle\lim_{z\rightarrow a} (z-a)f(z)$

3. The attempt at a solution
Since the function $\frac{cos(2x)}{x^2+4}dx$ is even, $\int_0^\infty \frac{cos(2x)}{x^2+4}dx =\frac{1}{2} \int_{-\infty}^\infty \frac{cos(2x)}{x^2+4}dx$

Consider the real part of $f(z)=\frac{e^{2iz}}{z^2+4}$

$\int_0^\infty \frac{cos(2x)}{x^2+4}dx$=$\frac{1}{2}Re(\displaystyle\lim_{R\rightarrow \infty}\int_{[-R,R]} \frac{e^{2iz}}{z^2+4})dz$

We have $\int_{[-R,R]}f(z)dz=\int_\gamma f(z)-\int_{\gamma R} f(z)dz$

where $\int_{\gamma R} f(z)dz$ tends to zero as can be shown by the estimation theorem.

To calculate $\int_\gamma f(z)$ we find the residue of f at the simple pole z=2i:

$Res(f;2i)=\lim_{z\rightarrow {2i}}(z-2i)\frac{e^{2iz}}{z^2+4}=\lim_{z\rightarrow {2i}}\frac{e^{2iz}+2ie^{2iz}(z-2i)}{2z}=\frac{1}{4ie^4}$

This is obviously incorrect since there can be no imaginary part

Last edited: Dec 7, 2013
2. Dec 7, 2013

### pasmith

The integral is $2 \pi i$ times the residue.