# Integral of odd function doesn't converge?

When I look up $$\int_{-1}^1 \dfrac{1}{x} dx$$

on Wolfram Alpha, it says it doesn't converge. While this is a sum of two diverging integrals, the two areas are clearly symmetric, and I'd assume the answer would be zero. How does one usually treat integrals like this?

• You should look up the Cauchy principal value. – Hirshy Jun 22 '15 at 20:17
• a) say it doesn't exist, b) take the principal value, c) possibly other methods I can't think of at the moment. Whether a) or b) is more appropriate depends. – Daniel Fischer Jun 22 '15 at 20:17
• its very risky to try to do that with an integral - add positive and negative infinity and get $0$. It seems intuitive, but can cause problems. – Thomas Andrews Jun 22 '15 at 20:37
• cpv converges doesn't imply the integral itself converges. – Vim Jun 23 '15 at 1:15
• And please don't rely on Wolfram Alpha except just for checking your answer. It makes a lot of serious errors, some of which are hardcoded errors! – user21820 Jun 23 '15 at 6:37

It's undefined quite simply because you can force it to have another value. First of all, let's say by $\int_{-1}^1\frac1xdx$ you mean $$\lim_{s \to 0^-\,\, t \to 0^+}\left(\int_{-1}^s\frac1x dx + \int_t^1 \frac1xdx\right)$$ Now, if we force $s = -t$, then as you say, this evaluates to $0$. However, if we say $s = -at$ for some $a > 0$, then we get something completely different (we get $\ln a$). It's this "completely different" that in the end makes the value indeterminable.

Side note: It's possible to go into subdividing the interval $[-1, 1]$ unevenly and use the definition of (Riemann) integral to see that we can get the sum to be whatever we want, and once again, this means undefined.

The problem with this integral is that the function approaches infinity at $0$. For this type of problem, you must treat each side of $0$ separately. We write:

$$\int_{-1}^1\frac{1}{x}dx=\lim_{a\rightarrow 0^+}\int_a^1\frac{1}{x}dx+\lim_{b\rightarrow 0^-}\int_{-1}^b\frac{1}{x}dx.$$

Observe that we use a different limit for each infinite side. One can check that each of these limits diverge, for instance,

$$\lim_{a\rightarrow 0^+}\int_a^1\frac{1}{x}dx=\left.\lim_{a\rightarrow 0^+}\ln(x)\right|^1_a=\lim_{a\rightarrow 0^+}(ln(1)-ln(a))=\infty.$$

Similarly, the other integral is $$\lim_{b\rightarrow 0^-}\int_{-1}^b\frac{1}{x}dx=\left.\lim_{b\rightarrow 0^-}\ln(|x|)\right|^b_{-1}=\lim_{b\rightarrow 0^-}(ln(-b)-ln(1))=-\infty.$$

Therefore, the entire expression above is an indeterminate form of $\infty-\infty$. In general, if any part of an integral diverges, we say the integral diverges.

In some cases, we take what is called the "Principal Value" which combines the two limits as $$\lim_{a\rightarrow 0^+}\left[\int_{-1}^{-a}\frac{1}{x}dx+\int_a^1\frac{1}{x}\right]=\lim_{a\rightarrow 0^+}\left[(\ln(a)-\ln(1))+(\ln(1)-\ln(a))\right]=0.$$

Even though this limit exists, only the principal value exists (because the principal value cancels the equal infinities), the original integral itself does not exist.

Even though the two sides of the integral look symmetric, technically whenever you have an indefinite integral (e.g. integral of a function not defined at a point), you break up the integral into pieces that avoid the "problem" point(s) and then evaluate the limit of each piece separately as you approach the problem points. One somewhat contrived way to say that your limit should not exist is that you should be able to say your integral is $\lim_{t \to 0} \int_{at}^1 1/x dx + \int_{-1}^{-bt} 1/x dx$ but if you do this then you will only get $0$ if $a = b$. With derivatives it's perhaps more clear how problems can arise: If you define the derivative as $\lim_{h \to 0} \frac{f(x+h) - f(x-h)}{2h}$ then you will get that the derivative of $f(x) = |x|$ at $x = 0$ is 0, even though clearly the derivative is undefined there.

• You could also argue that the symmetric definition of the derivative is actually the most robust choice. Which shows when it is applied to the $abs(x)$ function at $x = 0$. It then yields the (symmetric) answer $0$, which is actually the most sensible ! – M. Wind Jun 23 '15 at 1:15
• @M.Wind: If you use the symmetric definition of the derivative, then the indicator function of the rationals is differentiable at every rational. How is that sensible? – user21820 Jun 23 '15 at 5:53
• @user21820 I am not responsible for each and every application of the symmetric definition of the derivative. – M. Wind Jun 23 '15 at 10:36
• @M.Wind Actually, when defining a "derivative" for something involving a term like $|x|$, at least in optimization problems, you set the gradient to 0 and then see whether $x > 0$ with derivative contribution = 1 gives a solution, or $x < 0$ and with derivative contribution -1 gives a solution, or if setting $x = 0$ and the derivative contribution to anything real in $[-1,1]$ gives a solution. It can be shown this gives critical points of objective functions that have absolute values, and note at cusps we allow the "derivative" to be ANY of the possible values, not just the symmetric value. – user2566092 Jun 23 '15 at 15:49
• @2566092 I am not so familiar with the techniques used in optimization problems, but I readily accept your explanation. In other applications it might prove useful to replace $abs(x)$ by a function that is continuous everywhere, for example $\sqrt {x^2 + \epsilon^2}$. At a suitable stage in the calculation the limit of $\epsilon$ to zero can be take. – M. Wind Jun 23 '15 at 17:46

The integral is undefined. However consider the following formula:

$$lim_{\epsilon \to 0} \frac {x}{x^2+ \epsilon^2} = \frac {1}{x}$$

Let us try this representation of $1/x$ in your integral. Now perform the integration before taking the limit of $\epsilon$ to $0$. [This change-of-order is presumably not strictly allowed, but obviously it makes a lot of sense to do so anyway.] Note that the integrand is now divergence-free, so the integration is completely straightforward. The anti-derivative is found to be:

$$(1/2) * log (x^2 + \epsilon^2)$$

This function is symmetric, hence the cancellation that we seek indeed takes place and the integral from $-1$ to $+1$ equals zero. Of course it depends on the context of the mathematical problem at hand whether a method like this is justified.

• No it doesn't make any sense. $\lim_{w \to 0} \int_0^\infty e^{-wt}\ dt = 1$ but $\int_0^\infty \lim_{w \to 0} e^{-wt}\ dt = \infty$. – user21820 Jun 23 '15 at 6:00
• @user21820 Your comment makes no sense. First of all because it completely lacks the concept of cancellation due to symmetry (which is what the OP was asking about). Furthermore, your so-called counter-example proves nothing since it is based on a wrongly evaluated integral. – M. Wind Jun 23 '15 at 10:39
• Infinity cannot be cancelled, so there is no symmetry to talk about. It is just like asking what is the expected difference in number of heads and tails in $n$ coin flips as $n \to \infty$. It is not $0$ at all. Sorry I made a careless mistake in my claimed counter-example. Here is what I had in mind: $\lim_{w \to 0} \int_0^\infty we^{-wt}\ dt = 1$ but $\int_0^\infty \lim_{w \to 0} we^{-wt}\ dt = 0$. And another one is $\lim_{n \to \infty} \int_0^\infty \frac{t^{n+1}}{n!} e^{-t}\ dt = \infty$ but $\int_0^\infty \lim_{n \to \infty} \frac{t^{n+1}}{n!} e^{-t}\ dt = 0$. – user21820 Jun 23 '15 at 12:23
• A third counter-example with the integral over a finite interval is $\lim_{n \to \infty} \int_0^1 n^3 t^n (1-t)\ dt = \infty$ but $\int_0^1 \lim_{n \to \infty} n^3 t^n (1-t)\ dt = 0$. By the way, in LaTeX use \log and \lim to get the upright versions with correct spacing. – user21820 Jun 23 '15 at 12:38
• @user21820 One may even claim that $\int _{-\infty} ^{\infty}sin(ax)dx$ is undefined ! Even though it is a straightforward thing in Fourier analysis. But we may proceed as in your first example, and introduce a convergence factor of the form $exp(-\epsilon *abs(x))$. You can then integrate separately over the positive range and the negative range. And thus demonstrate that the cancellation works. – M. Wind Jun 23 '15 at 18:30