Show that $\int_{- \infty}^{\infty} \frac{\sin x}{x+i} dx = \frac{\pi}{e}$ This is question 37 from Exercises 6.6.2 from Dennis Zill's An Introduction to Complex Analysis.

Show that $$\int_{- \infty}^{\infty} \frac{\sin x}{x+i} dx = \frac{\pi}{e}$$

I am not sure how to proceed. There is a hint to use $\sin x = \dfrac{e^{ix} - e^{-ix}}{2i}$ for real $x$.
If I try to find the residue of $\dfrac{\sin z}{z+i}$ at $z=-i$, I get $$\text{Res}\left(\dfrac{\sin z}{z+i};-i\right) = -i \sinh 1.$$
But I am not sure what contour to even use, so I cannot relate these numbers to the integral in the question.
I tried to use a semicircular contour in the lower half plane. I see that $|e^{iz}| = e^{-y} \leq e^{R}$ for $z=x+iy$ on a semicircle of radius $R$. I am not sure how to proceed since this would mean the integral does not vanish. Could someone please offer some guidance? Thank you very much.
 A: I managed to solve it using the hint from Ian.
I split the integral into $2i I_1 = \int_{\mathbb{R}} \dfrac{e^{ix}}{x+i} dx$ and $2i I_2 = \int_{\mathbb{R}} \dfrac{-e^{-ix}}{x+i} dx
.$
For the first integral, consider the contour $\Gamma_R$ consisting of the semicircle of radius $R$, in the upper half plane, denoted $\gamma_R$, and the line segment joining $-R$ to $R$. Note that the function is holomorphic on and inside this countour. Thus, using Cauchy's Integral formula, $$\int_{\Gamma_R} \dfrac{e^{iz}}{z+i} dz = \int_{-R}^R \dfrac{e^{ix}}{x+i} dx + \int_{\gamma_R} \dfrac{e^{iz}}{z+i} dz=0. $$
On $\gamma_R$, we have $|e^{iz}| = e^{-R \sin \theta}$. By the Estimation lemma and Jordan's inequality, the modulus of the integral will converge to $0$ as $R \to \infty$. Thus the integral converges to $0$ as $R \to \infty$. Thus we conclude that $I_1 =0$.
For $I_2$, we can substitute $u = -x$, and thus obtain get $2iI_2 = \int_{\mathbb{R}} \dfrac{-e^{iu}}{-u+i} du$. Note that the function has a residue of $1/e$ at the pole $z=i$. We apply Cauchy's Residue Theorem and the same method as in the earlier part to finally obtain that $$2iI_2 = 2 \pi i/e.$$ We can also use a contour in the lower half-plane, but the substitution we used transforms this into the first case which we already solved.
Hence, we obtain the required answer.
