Improper integral with residue theorem why is condition no real zeros needed? If I apply the residue theorem to evaluate the improper integral $\int_{-\infty}^{\infty}\frac{1}{x^2}\mathrm{d}x$ then all necessary conditions are fulfilled except that f has no real singularities. It‘s clear that the principal value doesn‘t exist but the only meaningful value of the integral would have to be infinite, but with the residue theorem the integral should be zero. So is the Problem here that the curve which is used to derive the theorem doesn’t include the singularity or where else is the problem?
 A: The contour you take will go from $-N$ to $-\epsilon$, around the semicircle $\gamma_\epsilon$ (clockwise) to $\epsilon$, then to $N$, then around the large semicircle $\Gamma_N$ (counterclockwise). So you get
$$\int_{-N}^{-\epsilon} f(z)\,dz + \int_{\gamma_\epsilon} f(z)\,dz + \int_\epsilon^N f(z)\,dz + \int_{\Gamma_N} f(z)\,dz = 0.$$
In the limit, we get
$$P.V. \int_{-\infty}^\infty \frac{dx}{x^2} = -\lim_{\epsilon\to 0^+}\int_{\gamma_\epsilon} f(z)\,dz = \lim_{\epsilon\to 0^+} \frac2\epsilon = \infty.$$
I should comment that one often sees applications similar to this. The standard one is the computation of $\displaystyle\int_{-\infty}^\infty \frac{\sin x}{x}dx$ by integrating $\dfrac{e^{iz}}z$. Taking the contour I suggested gives the result (with a little bit of work justifying why the limit of the integral over $\Gamma_N$ goes to $0$). Of course, this function has a simple pole at $0$.
A: Consider $f:\mathbb{C}\setminus\{0\}\rightarrow\mathbb{C}$ with $$f(z)=\frac1{z}.$$ If the contour of integration were to be closed curve enclosing $0,$ then according to the residue theorem, the integral would be $0.$ However, the contour you have does not enclose $0,$ but passes through $0,$ and a contour cannot pass through $0$ for the integral. Therefore, the integral does not exist, which is to say, $f$ is not Lebesgue integrable over said contour.
