Using Complex contour integration calculate $\int_{-\infty}^{\infty} \frac{\sin x}{x+i}$

complex integrationcomplex-analysiscontour-integration

Using Complex contour integration calculate $$\int_{-\infty}^{\infty}
\frac{\sin x}{x+i} dx$$
. Use the form $\int_{-\infty}^{\infty} f(x) \sin
(\alpha x) dx$

Now I used the form $\int_{-\infty}^{\infty} f(x) \sin (\alpha x) dx$ and converted the integral to $Img(\oint_{-\infty}^{\infty} \frac{e^{ix}}{x+i}dx)$ where the contour is the positive semi-circle around the origin from $[-R,R]$ as $R \to \infty$

But then the only pole of the above integral is $x=-i$, which is not in the above contour hence the value of the integral in the above contour is zero thus the value of the integral is zero . But the answer given in the text is not so

Could someone please calculate this integral

Best Answer

Note that$$\frac{\sin x}{x+i}=\frac{\sin(x)(x-i)}{x^2+1}=\frac{x\sin(x)}{x^2+1}-\frac i{x^2+1}.$$It is clear that$$\int_{-\infty}^\infty\frac i{x^2+1}=\pi i.$$And, since$$(\forall x\in\mathbb R):\frac{x\sin(x)}{x^2+1}=\operatorname{Im}\left(\frac{xe^{ix}}{x^2+1}\right),$$the method that you mentioned can be used to compute the integral$$\int_{-\infty}^\infty\frac{x\sin(x)}{x^2+1}\,\mathrm dx.$$

Related Question