# Contour integral of $\frac1z$

Consider the integral $\int_{-\infty}^\infty \frac{1}{x+i \epsilon}\, dx$, where $\epsilon$ is a positive real number. We can evaluate the integral by closing the contour in the complex plane and then applying Cauchy's residue theorem.

Notice that $1/z$ converges to $0$ at infinity, and is analytic everywhere except at $z=0$. This means that if we close the contour in the upper half complex plane, the integral is zero, while if we close it in the lower half complex plane, the integral is non-zero. Where have I gone wrong?

• Could you be more explicit? In particular, what is exactly the contour that you are talking about? – user37238 Feb 23 '16 at 8:23
• Are you perhaps assuming that $\exists\lim_{a,b\to\infty}\int_{-a}^b \frac{dx}{x+i\epsilon}$? – Jonathan Y. Feb 23 '16 at 8:27
• In case your contour contains a semi-circle in the upper half plane centred in the origin then note that the integral over the semi-circle does not vanish. In the limit of infinite radius the integrand is a function of angle only that can be integrated trivially. – Urgje Feb 23 '16 at 9:12