How to solve this integral using the Residue theorem

complex integrationcomplex-analysis

$$ \int_{-\infty}^\infty \frac{\sin(x)}{x^2 + 4x + 5}dx$$

What I now is you can use residue theorem, and evaluate this integral

$$ \oint \frac{e^{iz}}{z^2 + 4z + 5}dz$$ and through calculating the residues and using the residue theorem I get that the answer for the above integral is $$\pi e^{-1-2i}$$

However after this I am completely lost. Any guidance will be much appreciated. I would like to know why I can evaluate the integral as an exponential integral as well.

Best Answer

Since $\sin x=\exp ix$, the strategy is$$\begin{align}\int_{\Bbb R}\frac{\sin xdx}{x^2+4x+5}&=\Im\int_{\Bbb R}\frac{\exp ixdx}{x^2+4x+5}\\&=\Im\oint\frac{\exp izdz}{z^2+4z+5}\\&=\Im\left(\frac{\pi}{e}\exp(-2i)\right)\\&=-\frac{\pi}{e}\sin2.\end{align}$$It's important to clarify, in particular, that because the poles are at $-2\pm i$, the infinite semicircular contour with $\Im z\ge0$ contains only the pole at $-2+i$, which is used in the above calculation. But as $\Im z\to\infty$, $\exp iz\to0$ whereas $|\exp -iz|\to\infty$, which means we can't use the same contour if we want to solve the problem via $-\Im\oint\frac{\exp-izdz}{z^2+4z+5}$. We could take that approach with an $\Im z\le0$ contour of winding number $-1$, enclosing the pole at $-2-i$, giving the same result in the form of $-\Im(\pi\exp(-1+2i))$.

Related Question