Calculating $\int_{- \infty}^{\infty} \frac{\sin x \,dx}{x+i} $ I'm having trouble calculating the integral
$$\int_{- \infty}^\infty \frac{\sin x}{x+i}\,dx $$
using residue calculus. I've previously encountered expressions of the form 
$$\int_{- \infty}^\infty f(x) \sin x \,dx $$
where you would consider $f(z)e^{iz}$ on an appropriate contour (half circle), do away with the part of the contour that wasn't on the real axis by letting the radius go to infinity, then recover the imaginary part of the answer to get back the sine. However here, I can't replace the sine with $e^{iz}$ in my complex function because $$\operatorname{Im} \frac{e^{ix}}{x+i} \neq \frac{\sin x}{x+i}\cdots$$
How to remedy this? I'm not sure if substituting $\sin x = \frac{1}{2i}(e^{ix}-e^{-ix})$ and solving two integrals is how this problem is meant to be solved, although I'm 99% sure it would work

Using the identity $\sin(x)=\frac{1}{2i}(e^{ix}-e^{-ix})$ and separating into two integrals is a very reasonable way to solve this problem, and I would imagine it's the easiest way. For comparison, I want to describe another possibility, which involves separating $\frac{1}{x+i}$ into its real and imaginary parts.
We have
$$
\frac{1}{x+i}=\frac{x-i}{x^2+1}=\frac{x}{x^2+1}-i\frac{1}{x^2+1},
$$
so we can break up our integral as a sum in the following way:
\begin{eqnarray*}
\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\\
&=&\mathrm{Im}\int_{-\infty}^\infty\frac{xe^{ix}}{x^2+1}\,dx-i\cdot\mathrm{Im}\int_{-\infty}^\infty \frac{e^{ix}}{x^2+1}\,dx.
\end{eqnarray*}
Both of these integrals can be evaluated using the method of contours.
I don't necessarily think this is easier than writing $\sin(x)=\frac{1}{2i}(e^{ix}-e^{-ix})$.
