# How to deal with contour integral with sine?

I'm having trouble dealing with contour integral with $\sin x$ as numerator. For example, if I want to evaluate $$\int_{-\infty}^{\infty}\frac{\sin x}{(x-i)^3}$$ the denominator is not real. I think I should use a rectangular contour, and I calculated the residue. How should I do this integral? I would really appreciate any help on that. Thanks.

$$\int_{-\infty}^{\infty}\frac{\sin x}{(x-i)^3}dx = \int_{-\infty}^{\infty}\frac{e^{ix}-e^{-ix}}{2i}\frac{1}{(x-i)^3}dx.$$ The function $e^{iz}$ is well behaved for $\Im z > 0$, and $e^{-iz}$ is well-behaved for $\Im z < 0$. So you can evaluate $$\int_{-\infty}^{\infty}\frac{e^{iz}}{2i}\frac{1}{(z-i)^3}dz$$ over a positively contour in the upper half-plane consisting of a segment $[-R,R]$ on the real line, and a semi-circular contour in the upper half plane of radius $R$ centered at the origin. The integral involving $e^{-iz}$ is evaluated over a contour in the lower half plane and found to be $0$. The above integral evaluates to $$\left.2\pi i \cdot\frac{1}{2}\frac{d^2}{dz^2}\frac{e^{iz}}{2i}\right|_{z=i}.$$
Say your given integral is $I$. Then performing $x \mapsto -x$ will show that $I = J$ where $$J=\int_{-\infty}^{\infty} \frac{\sin x dx}{(x+i)^3}.$$ But this means $2I = I+J$ is an integral from $-\infty$ to $\infty$ where the integrand is real, so replacing $\sin x$ by $Im( e^{ix})$ should do the trick ($Im$ stands for imaginary part).