# The Unapologetic Mathematician

## Iterated Integrals III

I recently heard a characterization (if someone remembers the source, please let me know) of the situation in analysis as being that there are no theorems — only conjectures that don’t yet have counterexamples. Today’s counterexample is adapted from one in Apostol’s book, but it’s far simpler than his seems to be.

We might guess that we can always evaluate double integrals by iterated integrals as we’ve been discussing. After all, that’s exactly what we do in multivariable calculus courses as soon as we introduce iterated integrals, never looking back to all those messy double and triple Riemann sums again. Unfortunately, the existence of the iterated integrals — even if both of them exist and their values agree — is not enough to guarantee that the double integral exists. Today, we will see a counterexample.

Let $S$ be the set of points $(x,y)$ in the unit square $[0,1]\times[0,1]$ so that $x=\frac{m}{q}$ and $y=\frac{n}{q}$, where $\frac{m}{q}$ and $\frac{n}{q}$ are two fractions with the same denominator, each of which are in lowest terms. That is, it contains the point $\left(\frac{1}{3},\frac{2}{3}\right)$, but not the point $\left(\frac{2}{4},\frac{3}{4}\right)$, since when we write these latter two fractions in lowest terms they are no longer over a common denominator. We will consider the characteristic function $\chi_S$, which is ${1}$ on points in $S$ and ${0}$ elsewhere in the unit square.

First, I assert that both iterated integrals exist and have the same value. That is

$\displaystyle\int\limits_0^1\int\limits_0^1\chi_S(x,y)\,dx\,dy=0=\int\limits_0^1\int\limits_0^1\chi_S(x,y)\,dy\,dx$

Indeed, the set $S$ is symmetric between the two coordinates, so we only need to evaluate one of these iterated integrals and the other one will automatically have the same value.

If $y$ is an irrational number in $[0,1]$, then there is no $x$ at all so that $(x,y)\in S$. Thus we can easily calculate the inner integral

$\displaystyle\int\limits_0^1\chi_S(x,y)\,dx=\int\limits_0^10\,dx=0$

On the other hand, if $y$ is a rational number, we can write it in lowest terms as $y=\frac{n}{q}$. Then there are only a finite number of points $x=\frac{m}{q}$ having the same denominator at all. Thus we can break the interval $[0,1]$ into a finite number of pieces, on each of which the characteristic function has the constant value zero. Thus we can calculate the inner integral

$\displaystyle\int\limits_0^1\chi_S(x,y)\,dx=\sum\limits_{i=1}^q\int\limits_\frac{i-1}{q}^\frac{i}{q}\chi_S\left(x,\frac{n}{q}\right)\,dx=\sum\limits_{i=1}^q\int\limits_\frac{i-1}{q}^\frac{i}{q}0\,dx=\sum\limits_{i=1}^q0=0$

And so we see that for any $y$ the inner integral evaluates to ${0}$. Then it’s easy to calculate the outer integral

$\displaystyle\int\limits_0^10\,dy=0$

and, as we said before, the other iterated integral also has the value ${0}$.

On the other hand, the double integral does not exist. Yes, $S$ is countable, and so it has measure zero. However, it’s also dense, which means $\chi_S$ is discontinuous everywhere in the unit square.

Saying that $S$ is dense in the square means that every neighborhood of every point of the square contains some point of $S$. Indeed, consider a point $(x,y)$ in the square and some radius $\epsilon$. Since the real numbers are Archimedean, we can pick some $N>\frac{2}{\epsilon}$, and as many people on Nick‘s Twitter experiment (remember to follow @DrMathochist!) reminded us, there are infinitely many prime numbers. Thus we can pick a prime $p>\frac{2}{\epsilon}$. Then we can round $x$ up to the next larger fraction of the form $\frac{m}{p}$, which will be in lowest terms unless $m=p$, in which case we round $x$ down to $\frac{p-1}{p}$. Similarly, we can round $y$ up (or down) to a fraction $\frac{n}{p}$ in lowest terms. This gives us a new point $\left(\frac{m}{p},\frac{n}{p}\right)\in S$, and we can calculate the distance

$\displaystyle\left\lVert\left(x-\frac{m}{p},y-\frac{n}{p}\right)\right\rVert=\sqrt{\left(x-\frac{m}{p}\right)^2+\left(y-\frac{n}{p}\right)^2}\leq\sqrt{\frac{2}{p^2}}<\frac{2}{p}<\epsilon$

So there is a point in $S$ within any radius $\epsilon$ of $(x,y)$.

But now when we try to set up the upper and lower integrals to check Riemann’s condition we find that every subinterval of any partition $P$ must contain some points in $S$ and some points not in $S$. The points within $S$ tell us that the upper sum gets a sample value of ${1}$ for each subinterval, giving a total upper sum of ${1}$. Meanwhile the points outside of $S$ tell us that the lower sum gets a sample value of ${0}$ for each subinterval, giving a total lower sum of ${0}$. Clearly Riemann’s condition fails to hold, and thus the double integral

$\displaystyle\iint\limits_{[0,1]\times[0,1]}\chi_S(x,y)\,d(x,y)$

fails to exist, despite the iterated integrals existing and agreeing.

December 18, 2009 - Posted by | Analysis, Calculus

## 3 Comments »

1. […] mask we’ll use is the characteristic function of , which I’ve mentioned before. I’ll actually go more deeply into them in a bit, but for now we’ll recall that the […]

Pingback by Integrals Over More General Sets « The Unapologetic Mathematician | December 22, 2009 | Reply

2. Isn’t this an example of where Lebesgue integration is “better” than Riemann integration? Since S is a measurable set and it has measure zero, the Lebesgue integral of its characteristic function exists and is zero. Period. No messing with iterated integrals, etc. Or am I missing something here?

Comment by Anon 1 | December 26, 2009 | Reply

3. Anon, yes the Lebesgue integral would handle this example right away, but that’s not what I’m trying to illustrate.

The point is that in multivariable calculus classes we tend to introduce iterated integrals and show that when the double integral exists the iterated integral yields its value. This much is fine, but then we commit the converse error and act as if the existence of the iterated integral (much less the existence and equality of all of them) justifies the existence of the double integral. This is true for pretty much any of the examples such classes see, but it’s very much not the case in general.

Comment by John Armstrong | December 26, 2009 | Reply