Change of limits in triple integral The question is

If $f$ is continuous, show that
  $$\int\limits_0^x\int\limits_0^y\int\limits_0^z f(t)dtdzdy =
 \frac{1}{2}\int\limits_0^x (x-t)^2f(t)dt.$$

The solution is
\begin{equation*}
\begin{split}
\int\limits_0^x\int\limits_0^y\int\limits_0^z f(t)dtdzdy &= \int\limits_0^x\int\limits_0^y f(x)(y-t)dtdy = \int\limits_0^x\int\limits_t^x f(t)(y-t)dydt =\\&=\int\limits_0^xf(t)\left(\int\limits_t^x (y-t)dy\right)dt = \frac{1}{2}\int\limits_0^x f(t)(x-t)^2dt,
\end{split}
\end{equation*}
however, I can't understand first two equalities. Can anybody explain them?
 A: In the double integral $\ \int\limits_0^y\int\limits_0^z f(t)dtdz\ $, the region over which the integration is carried out is $\ \left\{\left(t,z\right)\left\vert\, 0\le t\le z \le y\right. \right\}\ $. This must remain the same, regardless of the order in which the two single integrals are carried out.  When you integrate with respect to $\ z\ $, you have to do so for every value of $\ t\ $ in the interval $\ \left[0, y\right]\ $, and in the integral $\ z\ $ must run from $\ t\ $ to $\ y\ $. That is, the integral is
$$\ \int\limits_0^y\int\limits_t^y f(t)dzdt=\ \int\limits_0^y\left(\int\limits_t^y 1\right)dzf(t)dt = \int\limits_0^y\left(y-t\right) f(t)dt\ ,$$
 because $\ f(t)\ $ is independent of $\ z\ $.
Similarly, for the integral $\ \int\limits_0^x\int\limits_0^y\left(y-t\right) f(t)dtdy\ $, the region of integration is $\ \left\{\left(t,x\right)\left\vert\, 0\le t\le y \le x\right. \right\}\ $, so when you reverse the order of integration, $\ y\ $ must run from $\ t\ $ to $\ x\ $, and we get
$$\ \int\limits_0^x\int\limits_0^y \left(y-t\right)f(t)dtdy=\ \int\limits_0^x\left(\int\limits_t^x \left( y-t\right)\right)dyf(t)dt\ .$$
