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

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

• Technical nitpick: You forgot $dx$. Jul 14 '19 at 16:15
• @metamorphy More importantly $$\frac{\sin{x}}{x+i}\ne\Im{\left(\frac{e^{ix}}{x+i}\right)}$$ because $(x+i)^{-1}$ is not always real. Jul 14 '19 at 16:32

Hint: $$\int_{-\infty}^{\infty}\frac{\sin x}{x+i}\,dx= \int_{-\infty}^{\infty}\frac{x\sin x}{x^2+1}\,dx-i\int_{-\infty}^{\infty}\frac{\sin x}{x^2+1}\,dx$$
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.$$