How to prove that $\int_0^b\Big(\int_0^xf(x,y)\;dy\Big)\;dx=\int_0^b\Big(\int_y^bf(x,y)\;dx\Big)\;dy$? 
Problem. Let $f:[0,b]\times[0,b]\to\mathbb{R}$ be continuous. Prove that
  $$\int_0^b\left(\int_0^xf(x,y)\;dy\right)\;dx=\int_0^b\left(\int_y^bf(x,y)\;dx\right)\;dy.\tag{1}$$

My first thought was to use Fubini's theorem: the left hand side of $(1)$ equals the double integral
$$\iint_{D_1} f(x,y)\;dA\tag{2}$$
and the right-hand side equals
$$\iint_{D_2} f(x,y)\;dA,\tag{3}$$
where $D_1=\{(x,y);\;0\leq x\leq b,\;0\leq y\leq x\}$ and $D_2=\{(x,y);\;0\leq y\leq b,\;y\leq x\leq b\}$. Since $D_1=D_2$, the integrals $(2)$ and $(3)$ are the same and thus $(1)$ holds.
However, the problem  is proposed before multiple integrals be defined. So my question is: how to solve the problem using single variable integrals?
Remark. In the section that proposes the problem, we have the following theorem: if $f:[a,b]\times[c,d]\to\mathbb{R}$ is continuous, then
$$\int_a^b\left(\int_c^df(s,t)\;ds\right)\;ds=\int_c^d\left(\int_a^bf(s,t)\;ds\right)\;dt.$$
Proof: Let $\varphi:[a,b]\to\mathbb{R}$ be given by
$$\varphi(x)=\int_c^d\left(\int_a^xf(s,t)\;ds\right)\;dt.$$
Then,
$$\int_a^b\left(\int_c^df(s,t)\;ds\right)\;ds=\varphi(a)+\int_a^b\varphi'(s)\;ds=\varphi(b)=\int_c^d\left(\int_a^bf(s,t)\;ds\right)\;dt.$$
I tried to apply a similar argument to the problem, but I couldn't do it.
Thanks.
 A: 
A geometric interpretaion of the problem:
You are integrating on the red region of the graph above. The reason is simple, the $\int_0^b\left(\int_0^xf(x,y)\;dy\right)\;dx$ is first done on $y$ that varies $0\leq y\leq x$, then you integrate on lines that starts on the axis $x$ a finishes on $y=x$, blue lines on the picture. And when you integrate on   $x$ you have $0\leq x\leq b$. So the area where you are integrating is the red triangle. Now you want to change variables, so you need to change the slices you take first, in our earlier situation you took lines that started at the axis $x$ a finishes on $y=x$, ie, lines parallel to the axis $y$,blue lines on the picture. Now you need to start taking lines parallel to the axis $x$, so you need to start at $y=x$  and go until $b$, then you integrate over $[0,b]$ in $y$, and then you have the desired formula, since by Fubine's theorem, no matter what slices do you take, you only need to cover the triangle.
A: Another good approach is to use Iverson brackets (http://mathworld.wolfram.com/IversonBracket.html). So 
\begin{align*}
\int_0^b\int_0^x f(x,y)dy dx &=
\int\int I[0 \leq x\leq b] I[0 \leq y\leq x]f(x,y)dy dx \\
&=\int\int I[0 \leq y\leq x\leq b] f(x,y)dy dx \\
&=\int\int I[y\leq x\leq b]I[0 \leq y\leq b] f(x,y)dx dy \\
&=\int_0^b\int_y^b f(x,y)dx dy
\end{align*}
where integrals without limits are between $-\infty$ and $\infty$,
$I[\cdot]$ is the indicator function, 
and we used Fubini to swap integrals.
A: A possible approach (using the result in your remark): If you apply the result in the remark to the function $g:[0,b] \times [0,b] \to \mathbb{R}$ given by $$g(s,t)= f(s,t) \chi_{D}(s,t)$$
where $\chi_D$ is the indidcator of $D_1=D_2$ in your calculation above, you get the desired result. Now, the issue is that $g$ may not be continuous, however you can approximate it suitably by a continuous function (by uniformly bounded continuous functions $g_{\epsilon}$ that agree with $g$ everywhere except on a small $\epsilon$-neighbhourhood of the diagonal).
