How to show that $ \int_0^x\left[\int_0^uf(t)dt \right] du = \int_0^xf(u)(x-u)du$? I have been asked to show that 
$$
 \int_0^x\left[\int_0^uf(t)dt \right] du = \int_0^xf(u)(x-u)du.
$$ 
But it has not been specified whether or not $f$ is continuous or if it has an anti-derivative. I have shown this is true if $f$ does have an anti-derivative but can't find a way to show it's true otherwise. 

Is this statement true even if $f$ does not have an anti-derivative or does it become nonsense? I appreciate any help.


My proof for when $f$ has an anti-derivative, $F$
\begin{align}
 \int_0^xf(u)(x-u)du &= \left[F(u)(x-u)\right]_0^x + \int_0^xF(u)du \\
& = -F(0)x + \int_0^xF(u)du \\
& = \int_0^x(F(u) - F(0))du \\
& = \int_0^x\left[\int_0^uf(t)dt\right]du 
\end{align}
 A: Since you don't put the real-analysis tagy, here is another answer. Assume that $f$ is Riemann integrable on any bounded intervals of $\mathbb{R}$.
Note that $$\int_0^xf(u)(x-u)du=\int_0^x\int_u^xf(u)\ dt\ du.$$
Hence all you want to prove is
$$
\int_0^x\int_u^xf(u)\ dt\ du=\int_0^x\int_0^u f(t)\ dt\ du\tag{*}
$$
Now,
$$
\int_0^x\int_u^xf(u)\ dt\ du=\int_0^x\int_0^t f(u)\ du\ dt\tag{**}
$$
which is exactly the right hand side of $(*)$ if you change the symbols $u$ and $t$ in the righthand side of $(**)$.

To see $(**)$, one only need to interpret the triangular region in two different ways:
$$
t:u\to x\quad u:0\to x
$$
and 
$$
u: 0\to t\quad t:0\to x.
$$
A: Assume that $f$ is Lebesgue integrable. 
Note that $$\int_0^xf(u)(x-u)du=\int_0^x\left[\int_u^x\ dt\right]f(u)\ du
=\int_0^x\left[\int_u^xf(u)\ dt\right]\ du.$$
Hence by the Fubini theorem, all one needs to prove is
$$
\int_0^x\int_u^xf(u)\ dt\ du=\int_0^x\int_0^u f(t)\ dt\ du\tag{*}
$$
which is equivalent to
$$
\int_{\mathbb{R}^2}f(u)1_\Omega(t,u)\ dy=\int_{\mathbb{R}^2}f(t)1_{\Omega'}(t,u)\ dy
$$
where $y=(t,u)$, 
$$\Omega=\{(t,u)\in\mathbb{R}^2\mid u\leq t\leq x,0\leq u\leq x\},$$
and 
$$\Omega'=\{(t,u)\in\mathbb{R}^2\mid 0\leq t\leq u,0\leq u\leq x\}.$$
One can do this by the change of variable formula of the Lebesgue integrals:
$$
\int_{\mathbb{R}^2}F(y)\ dy=|\det T|\int_{\mathbb{R}^2}F\circ T(y)\ dy,
$$
where $T(t,u)=(u,t)$, $F(t,u)=f(u)1_{\Omega}(t,u)$ and 
$$
\Omega=\{(t,u)\in\mathbb{R}^2\mid u\leq t\leq x,0\leq u\leq x\}.
$$
Now all we need is
$$
1_\Omega(u,t)=1_{\Omega'}(t,u).
$$
