# Carry out integral by using Cauchy's theorem

I have kind of a silly question, which probably has an easy answer which I should know myself, but here goes. Say we want to integrate $$\int_{-\infty}^\infty dx \frac{1}{(x^2 + 1)(x - 1 - i)}.$$ If we go to the complex plain, we have two poles in the upper half plane and only one in the lower half plane. Using the residue theorem, if we close the contour in the upper plane (the integrand vanishes fast enough so this is allowed): $$I_{up}=2 \pi i * \left( \frac{1}{2i*1}+\frac{1}{(2i + 1 )*1}\right)=\pi/5*(9+2i),$$ whereas closing in the lower half plane gives: $$I_{down} = -2 \pi i \left(\frac{1}{-2i*(-2i-1)}\right)=\pi/5(2i-1).$$ I was under the impression that closing below or above should not matter, if the integrand vanishes in both cases. What am I doing wrong here?

Your understanding is correct; you've just made an algebra mistake. In your calculation of $I_{up}$, the first denominator $2i*1$ should be $2i*(-1)$.
(Side note: it's confusing the way you've written $I_{down} = \pi/5(2i-1)$ when you mean $\frac\pi5(2i-1)$ and not $\frac{\pi}{5(2i-1)}$ - especially since you explicitly included the $*$ in the last expression for $I_{up}$.)