Example : Iterated integral and Fubini Theorem

Let $X = Y = \mathbb{R}$ and let $\mathscr{B}$ be the Borel $\sigma$-algebra. Define $$f(x,y) = 1 \ \mbox{if} \ x \geq 0, x \leq y < x+1,\ \\ \, \, \, = -1 \ \mbox{if} \ x \geq 0, x+1 \leq y < x+2, \\= 0 \ \mbox{otherwise}.$$ Show that $$\int\int f dxdy \neq \int\int fdydx.$$ Does this contradicts Fubini Theorem ?

For the fubini part, I think that $$\int\int |f| d(m \times m)(x,y) = \int\int_A 1 d(m \times m)(x,y) (= \ \mbox{area under} A) = \infty$$ where $A = \{(x,y) | x \geq 0, x \leq y < x+2\}$.

So this function is not non-negative and not Lebesgue integrable (which is required assumption for applying Fubini's Theorem).

The first problem : Is there a better way to argue that the above double integral is infinity than saying that the integral represent the area of $A$ ? (I do not sure how to calculate double integral).

The second is about showing that $$\int\int f dxdy \neq \int\int f dydx.$$ I find that $$\int\int_{\mathbb{R}^2} f dydx = \int_0^\infty \int_x^{x+1} 1 dydx + \int_0^\infty\int_{x+1}^{x+2} -1 dydx = \infty - \infty$$ which is not really defined. So what is $$\int\int f dydx = ?.$$ Or I just say the integral cannot be calculated ? (I think that $\int\int |f| dydx = \infty$. So this function is not even Lebesgue integrable. In this case, how to talk about $\int\int f dydx$ ?)

• You should calculate $\int f dy$ first before you integrate $dx$. That way you see that you are actually integrating the zero function. – Yeldarbskich Oct 20 '15 at 22:03
• @Yeldarbskich Is it valid to do that ? I mean in the sense like rearrangement of a not absolutely convergence series that we can rearrange the series to get the sum equals any real number. Analogously, is it okay to group the integrand like $$\int\int f dydx = \int_0^\infty (\int_x^{x+1} 1 dy + \int_{x+1}^{x+2} -1 dy)dx = 0.$$ It seems to me that the integral is not defined initially. – Both Htob Oct 20 '15 at 22:13
• That is how it should be. When we do iterated integrals we are saying for each $x$ define $g(x)=\int f dy$ by holding $x$ constant and then performing the integral. Then you integrate $g(x)$. You could also do it the other way around, and this problem is giving a nonexample for the Fubini equality. In this order $\int f dy$ is certainly zero. – Yeldarbskich Oct 20 '15 at 22:22
• @Yeldarbskich If that so, should I first defined $$g(x) = \int_x^{x+1}1 dy + \int_{x+1}^{x+2} -1 dy.$$ Then $g$ is identically zero for each $x \geq 0.$ So $\int_{x \geq 0} g(x) dx= 0.$"So $\int\int f dydx = 0$" (Can I immediately claim that $\int\int fdydx = \int g(x) dx$ ? ) – Both Htob Oct 21 '15 at 0:42
• I'm not really sure what your confusion is. We write $\int \int f dy dx$ to mean $\int \left( \int f dy \right) dx$ and similarly for the other order. When Fubini's theorem applies we can ignore this distinction since they are the same. – Yeldarbskich Oct 21 '15 at 1:30

For Fubini's theorem to hold, we must have $f\in L^1(\mathbb R^2)$, that is $$\iint |f(x,y)|\ \mathsf d(x\times y)<\infty.$$ But here we have \begin{align} \iint |f(x,y)|\ \mathsf d(x\times y) &= \iint|\chi_{[0,\infty]\times[x,x+1)}(x,y)-\chi_{[0,\infty]\times [x+1,x+2)}(x,y)|\ \mathsf d(x\times y) \end{align} Since $[0,\infty]\times[x,x+1)$ and $[0,\infty]\times[x+1,x+2)$ are disjoint for all $x$, the above integral is equivalent to $$\iint\chi_{[0,\infty]\times[x,x+1)}(x,y)\ \mathsf d(x\times y) - \iint\chi_{[0,\infty]\times[x,x+1)}(x,y)\ \mathsf d(x\times y),$$ and both of these integrals are infinite, so this is of the form $\infty-\infty$ and $f\notin L^1(\mathbb R^2)$. As for the iterated integrals, we have \begin{align} \iint f\ \mathsf dy\ \mathsf dx &= \int_0^\infty\int_0^\infty \left(\chi_{[x,x+1]}(y)-\chi_{[x+1,x+2]}(y)\right)\ \mathsf dy\ \mathsf dx\\ &= \int_0^\infty\left[\int_x^{x+1}\ \mathsf dy - \int_{x+1}^{x+2} \ \mathsf dy \right]\mathsf dx\\ &= \int_0^\infty 0\ \mathsf dx\\ &=0 \end{align} and integrating in the opposite order yields some finite number $c$ (for $x,y<2$) plus