# Why does the integral of 1/x diverge?

Why does the integration below diverge?

$$\int_{-\infty}^\infty\frac{1}{x}dx$$

I know this integral diverge from $-\infty$ to $0$ (or $0$ to $\infty$). But I don't understand why these two integrals are not the same. $\frac{1}{x}$ is an odd function, so I think the integral $-\infty$ to $\infty$ is to be $0$.

• Lookup Cauchy principal value. Your improper integral diverges, but its Cauchy principal value is indeed $0$. – dxiv Aug 19 '18 at 5:10
• In order the integral $$$\int_{-\infty}^\infty\frac{1}{x}dx$$$ to converge, the other two $$$\int_{-\infty}^0\frac{1}{x}dx$$$ and $$$\int_{0}^\infty\frac{1}{x}dx$$$ have to coverge. – dmtri Aug 19 '18 at 5:51
• Similar (with $x$ instead of $1/x$): math.stackexchange.com/questions/2493443/… – Hans Lundmark Aug 19 '18 at 7:49

Let's simplify the problem first by integrating from $-1$ to $1$. There is a discontinuity at $0$, so you write the integral as $$\int_{-1}^{1}\frac{1}{x}dx=\lim_{\epsilon\to0+}\left(\int_{-1}^{-\epsilon}\frac{1}{x}dx+\int_{\epsilon}^1\frac{1}{x}dx\right)$$ If you perform this calculation, you obtain zero. But that is not the only possible way to write the integral. You can equally well write it as $$\int_{-1}^{1}\frac{1}{x}dx=\lim_{\epsilon\to0+}\left(\int_{-1}^{-\epsilon}\frac{1}{x}dx+\int_{2\epsilon}^1\frac{1}{x}dx\right)$$ Note that I've change the lower limit of the second integral. Now obviously you will get a nonzero answer. Or I can change the upper limit of the first integral to be $-5\epsilon$.
In addition, you get the same issue when you go to $\pm\infty$. If your integration ranges are symmetric, you get $0$. This symmetric integration is the so called Cauchy principal value that @dxiv mentioned in the comment.