We have the following function: $$f(x,y)= \begin{cases} 1, & 0 \leq x-y \leq 1\\ -1, & 0 \leq y-x \leq 1 \\ 0, & \text{other cases} \end{cases} $$ and I need to prove that $$\int_0^{\infty}\int_0^{\infty} f(x,y) dx dy \not = \int_0^{\infty} \int_0^{\infty} f(x,y) dydx $$ I have defined the following sets:
$D_1=\{(x,y) \in \mathbb{R}^2: 0 \leq x-y \leq 1 \}=\{(x,y) \in \mathbb{R}^2: x \leq y \leq 1+x \}$ $D_2=\{(x,y) \in \mathbb{R}^2: 0 \leq y-x \leq 1 \}=\{(x,y) \in \mathbb{R}^2: x \geq y \geq x-1 \}$.
So we have that $$f(x,y)= \begin{cases} 1, & (x,y) \in D_1\\ -1, & (x,y) \in D_2 \\ 0, & \text{other cases} \end{cases} $$ I have done the following: $A=\{(x,y) \in \mathbb{R}^2: x,y \geq 0\}$ $$\int_0^{\infty}\int_0^{\infty} f(x,y) dy dx=\int\int_{D_1 \cap A} f(x,y) dy dx + \int\int_{D_2 \cap A} f(x,y) dy dx=\int_0^{\infty}\int_y^{y+1}-1 dxdy+\int_0^{\infty}\int_{y-1}^{y}1 dxdy=$$ $$= \int_0^{\infty}-y+y+1 dy+\int_0^{\infty}y-1-ydy=0$$ $$\int_0^{\infty}\int_0^{\infty} f(x,y) dx dy =\int\int_{D_1 \cap A} f(x,y) dx dy + \int\int_{D_2 \cap A} f(x,y) dx dy= \int_0^{\infty}\int_{x}^{x-1}1 dydx+\int_0^{\infty}\int_{x+1}^{x}-1 dxdy=0$$ I don't know what's wrong.. I would be really thankful if you helped me \ Thank you
Splitting into two areas where $f(x,y)=+1$ or $-1$ will not work, as they are both infinite in extent, leaving you with $\infty - \infty$, which is not defined.
Instead, doing the first integral first: $$\int_0^{\infty}\int_0^{\infty} f(x,y) dx dy \\= \int_0^{1}\int_0^{\infty} f(x,y) dx dy + \int_1^{\infty}\int_0^{\infty} f(x,y) dx dy \\= \int_0^{1}\left(\int_0^{y} f(x,y) dx +\int_y^{y+1} f(x,y) dx\right) dy \\+ \int_1^{\infty}\left(\int_{y-1}^{y} f(x,y) dx +\int_y^{y+1} f(x,y) dx\right) dy \\ = \int_0^{1}\left(-y+1\right) dy + \int_1^{\infty}0\, dy \\= \frac12$$
The second integral will be similar but end up with $\int\limits_0^{1}\left(x-1\right) dx + \int\limits_1^{\infty}0 \,dx = -\dfrac12$, showing that the order of integration matters. The cause is concealed in the integration of $0$ over an infinite range.