[Math] Is this a correct way to calculate $\int_{-\infty}^\infty\frac{x\sin(\pi x)}{x^2+2x+5}dx?$

complex-analysiscontour-integrationimproper-integrals

I have this integral to calculate: $$I=\int_{-\infty}^\infty\frac{x\sin(\pi x)}{x^2+2x+5}dx.$$

I think I have done it, but I would like to make sure my solution is correct.

I take the function $$f(z)=\frac{ze^{i\pi z}}{z^2+2z+5}$$ for $z\in\Bbb C.$ Now

$$f(z)=\frac{z\cos(\pi z)}{z^2+2z+5}+i\frac{z\sin(\pi z)}{z^2+2z+5}$$

so

$$\int_{-\infty}^\infty f(x)dx=\int_{-\infty}^\infty\frac{x\cos(\pi x)}{x^2+2x+5}dx+i\int_{-\infty}^\infty\frac{x\sin(\pi x)}{x^2+2x+5}dx.$$

Therefore, to calculate $I$, I need to calculate the left-hand side and take the imaginary part of it.

I consider contours $C_R$ composed of the upper half-circles $H_R$ of radius $R$ and the real interval $I_R=[-R,R]$. $f$ has two simple poles, $-1+2i$ and $-1-2i$, of which only $-1+2i$ lies in the upper half-plane. I have

$$\mathrm{res}_{(-1+2i)}f=\frac{(-1+2i)e^{i\pi(-1+2i)}}{2(-1+2i)+2}=-\frac14(2+i)e^{-2\pi}.$$

Therefore, $$\int_{H_R} f(z)dz+\int_{I_R} f(z)dz=\int_{C_R} f(z)dz=2i\pi\cdot(-\frac14)(2-i)e^{-2\pi}=\frac\pi 2(1-2i)e^{-2\pi}.$$

$\int_{H_R} f(z)dz$ tends to zero as $R$ tends to infinity by Jordan's lemma. I have

$$\begin{eqnarray}|\int_{H_R}f(z)dz|&\leq&\max_{\theta\in[0,\pi]}|\frac{Re^{i\theta}}{(Re^{i\theta})^2+2Re^{i\theta}+5}|\\&=&\max_{\theta\in[0,\pi]}\frac R{|(Re^{i\theta})^2+2Re^{i\theta}+5|}\\&\leq&\frac R{R^2-2R-5},\end{eqnarray}$$

by this. The last expression tends to zero as $R$ tends to infinity.

$\int_{I_R} f(z)dz$ tends to $\int_{-\infty}^\infty f(x)dx$ as $R$ tends to infinity. Therefore,

$$\int_{-\infty}^\infty f(z)dz=\frac\pi 2(1-2i)e^{-2\pi}=\frac\pi 2e^{-2\pi}-i\pi e^{-2\pi},$$

whence $$I=-\pi e^{-2\pi}.$$

Best Answer

Using Laplace Transform to calculate this improper integral will be much easier. In fact, since \begin{eqnarray*} \mathcal{L}\left\{\frac{x}{x^2+2x+5}\right\}&=&\mathcal{L}\left\{\frac{-1+2i}{4i}\frac{1}{x+1-2i}+\frac{1+2i}{4i}\frac{1}{x+1+2i}\right\}\\ &=&\frac{-1+2i}{4i}e^{(1-2i)s}\Gamma(0,(1-2i)s)+\frac{1+2i}{4i}e^{(1+2i)s}\Gamma(0,(1+2i)s)\\ \end{eqnarray*} we have \begin{eqnarray*} \int_0^\infty\frac{x\sin\pi x}{x^2+2x+5}dx&=&\Im \mathcal{L}\left\{\frac{x}{x^2+2x+5}\right\}\big|_{s=\pi i}\\ &=&\Im\left[\frac{-1+2i}{4i}e^{(1-2i)\pi i}\Gamma(0,(1-2i)\pi i)+\frac{1+2i}{4i}e^{(1+2i)\pi i}\Gamma(0,(1+2i)\pi i)\right]\\ &=&\Im\left[\frac{1-2i}{4i}e^{2\pi}\Gamma(0,(2+i)\pi)-\frac{1+2i}{4i}e^{-2\pi}\Gamma(0,(-2+i)\pi)\right]. \end{eqnarray*} Here we use $$\mathcal{L}\big\{\frac{1}{x+a}\big\}=e^{as}\Gamma(0,as).$$