There is this question which ask me to calculate the principal integral $$ \mathcal{P} \int_{-\infty}^\infty \frac{e^{-ix}}{(x+1)(x^2+1)} dx \, . $$
I find out that the poles are $x=-1$, $x=-i$ and $x=i$. However from here, I'm actually stuck because so far normally I only deal with question where there is a single pole at $x=0$ but this time round I need to deal with 3 poles which I'm not sure how should I start with. Any help is appreciated. Thanks!
Hint: Consider the following contour
where the red semicircle gets infinitesimally small and the black semicircle gets infinitely big.
Show that the total of the integrals along the red, green and black contours equals the negative of the residue of $\frac{e^{-iz}}{(z+1)(z^2+1)}$ at $-i$.
Show that the integral along the black contour tends to $0$.
Show that the integral along the red contour is half the residue of $\frac{e^{-iz}}{(z+1)(z^2+1)}$ at $-1$.
Compute the integral along the green contour.