Residue theorem : Upper and Lower halfs

cauchy-principal-valuecomplex-analysiscontour-integrationresidue-calculus

In the following example:$$\int_{-\infty}^{\infty}\frac{1}{x^2+1}dx $$ we have poles at $z=\pm i $

Now if I choose the contour in the upper complex plane, only the pole $z=i$ and I get the result as$$\int_{-\infty}^{\infty}\frac{1}{x^2+1}dx=2\pi i \sum \text{Residues}=\pi $$
But if I choose to the contour in the lower complex plane I get the result as:
$$\int_{-\infty}^{\infty}\frac{1}{x^2+1}dx=2\pi i \sum \text{Residues}=-\pi $$
How do I know which contour should I choose in a given problem.
Thank You.

Best Answer

The integral is equal to $\pi$. If you want to deal only with the residues from the upper half-plane, then you shall be applying the residue theorem to closed paths like the one below. And then the answer will be $\pi$, because the winding number of such a path with respect to each of the points that it surrounds is $1$.

enter image description here

If, on the other hand, you want to deal only with the residues from the lower half-plane, then you shall be applying the residue theorem to closed paths like the one below. And then the answer will be $\pi$ once again, because, although the residue at $-i$ is indeed $\frac i2$, the winding number of such a path with respect to each of the points that it surrounds is $-1$, not $1$ as before.

enter image description here

Related Question