How to evaluate $\int_{-\infty}^\infty \frac{x\cos{(-\frac{\pi}{2}x)}}{x^2-2x+5} \mathrm{d}x$ using complex analysis

complex-analysisimproper-integralsintegrationtrigonometry

I am having trouble evaluating the following improper integral
$$\int_{-\infty}^\infty \frac{x\cos{(-\frac{\pi}{2}x)}}{x^2-2x+5} \mathrm{d}x$$
It is for an upcoming exam in complex analysis, and I could really use a hint. I think i need to evaluate it using the residue of the integrand, but I have not had any luck. Any suggestions/comments are welcome.

Best Answer

Of course, $\cos(x)$ is even, so you can omit the negative sign in its argument. Consider the integral

$$I=\oint_C\underbrace{\frac{ze^{iz}}{z^2-2z+5}}_{f(z)}\,\mathrm dz$$

over the contour $C$ composed of (1) $\Gamma$, the semicircle centered at the origin with radius $R$, and (2) the line segment joining $-R$ and $R$ on the real axis. It's easy to show the integral along $\Gamma$ vanishes as $R\to\infty$:

$$\left|\int_\Gamma f(z)\,\mathrm dz\right| = \left|\int_0^\pi f(Re^{it})iRe^{it}\,\mathrm dt\right|\le\frac{\pi R^2e^{-R\sin t}}{\left|R-\sqrt 5\right|^2}\stackrel{R\to\infty}\to0$$

Meanwhile, the remaining integral over $[-R,R]$ converges to the integral you want to find.

$f(z)$ has poles at

$$z^2-2z+5=(z-1)^2+4=0 \implies z=1\pm2i$$

with $z=1+2i$ the only pole in the interior of $C$, so by the residue theorem,

$$I=2\pi i\operatorname{Res}\left(f(z),z=1+2i\right)=2\pi i\frac{(1+2i)e^{\frac{i\pi}2(1+2i)}}{4i}=-\pi e^{-\pi}+\frac{\pi e^{-\pi}}2i$$

and the real part corresponds to your original integral, so its value is $\boxed{-\pi e^{-\pi}}$.

Related Question