Evaluating a real definite integral using residue theorem

115 Views Asked by At

I've tried to solve the following integral using residue theorem. $$\int_{-\infty}^{\infty} \frac{cosx}{1+x^2}dx$$
Firstly, I set the contour as a counterclockwise semi-circle with radius R (R is sufficiently large so the pole z = i is in the contour) in upper half plane. Then the contour integral can be divided in two parts: $$\int_{-\infty}^{\infty} \frac{cosz}{1+z^2}dz$$ $$\lim_{R\to \infty}\int_{C}\frac{cosz}{1+z^2}dz$$ By residue theorem, the sum of two integrals is $$2\pi{i}\lim_{z\to i}\ (z-i)\frac{cosz}{(z+i)(z-i)} = \pi{cosi} = {\frac{\pi(e^2+1)}{2e}}$$
Then the value of the real integral can be obtained by substracting complex integral part from the entire integral.
To evaluate the complex part, convert $z=Re^{i\theta}$. Then $dz=iRe^{i\theta}d{\theta}$
The given integral is converted to the following integral: $$\lim_{R\to \infty} \int_{0}^{\pi}\frac{cos(Re^{i\theta})}{1+R^2e^{2i\theta}}iRe^{i\theta}d{\theta}$$ $$ = \lim_{R\to \infty} \int_{0}^{\pi}\frac{e^{iRe^{i\theta}}+e^{-iRe^{i\theta}}}{1+R^2e^{2i\theta}}\frac{iRe^{i\theta}d{\theta}}{2}$$ $$ = \lim_{R\to \infty} \int_{0}^{\pi}\frac{e^{R(icos{\theta}-sin{\theta})}+e^{-R(icos{\theta}-sin{\theta})}}{1+R^2e^{2i\theta}}\frac{iRe^{i\theta}d{\theta}}{2}$$
$\lvert {1+R^2e^{2i\theta}}\rvert$ is equal or larger than ${R^2-1}$ by triangle inequality and the absolute value of numerator is equal or smaller than R. Therefore the absolute value of the integral is equal or smaller than $$\int_{0}^{\pi}\frac{R}{2(R^2-1)}d{\theta}$$
This integral goes to $0$ as R goes to infinity. Thus, I thought the value of the given real integral should be ${\frac{\pi(e^2+1)}{2e}}$.
However, the correct answer is $\frac{\pi}{e}$. What's wrong with my solution?

1

There are 1 best solutions below

1
On

Consider $$ f(z)=\frac {e^{iz}}{1+z^2}. $$ Then $$ \int_{-R}^{R} \frac {e^{ix}}{1+x^2} \, dx + \int_{C_{_R}} f(z)\,dz = 2 \pi i B$$ where $B$ is the residue of $f(z)$ at $z=i$ and $C_{_R}$ is the upper half of the circle $|z|=R, R>1$ from $z=R$ to $z=-R$.