For continuous function $f$, prove: $\int_{0}^{x} \; \left[\int_{0}^{t}f(u) \;du \right] \;dt=\int_{0}^{x} f(u)(x-u)du$ I'd love your help with proving that:

For continuous function $f$, $$\int_{0}^{x} \left[\int_{0}^{t}f(u) \; du \right] \; dt = \int_{0}^{x} f(u)(x-u)du$$

I'm not quite sure what I should do with this.
From Newton-Leibniz theorem I get that the left side of the equation is $(F(t)-F(0))x$, while on the right side I wanted to do an integration by parts, but I'm not sure how or if it is the direction.
Thanks a lot for the help.
 A: You should integrate by parts the LHside with differential factor $\text{d} t$.
In fact, since $f$ is continuous then $F(t):=\int_0^t f(u)\ \text{d} u$ is of class $C^1$ and its derivative is $f(t)$; hence:
$$\begin{split} \int_0^x \left[\int_0^t f(u)\ \text{d} u\right]\ \text{d} t &= t\ \int_0^t f(u)\ \text{d} u\Bigg|_0^x - \int_0^x t\ f(t)\ \text{d} t\\ &= x\int_0^x f(t)\ \text{d} t -\int_0^x t\ f(t)\ \text{d} t\\ &= \int_0^x (x-t)\ f(t)\ \text{d} t\; ,\end{split}$$
which is the claim.
A: HINT 
There are couple of ways.
The first one is to change the order of integration using Fubini's theorem and this immediately gives you the answer.
The second way is a bit roundabout. Consider $$F(x) = \int_0^x \int_0^t f(u) du dt - \int_0^x f(u) (x-u) du. $$ Prove that $F'(x) = 0$ using Leibniz integration rule and hence $F(x) = F(0) = 0$ giving us the desired result.
A: Let $$\begin{align}F(x)&=\int_{0}^{x}f(u)(x-u)\,du \\&= x \int_{0}^x f(u)\,du -\int_{0}^x uf(u)\,du.\end{align}$$
Now, we know how to take the derivative of all these terms, $x$ and the two integrals, so we can compute:
$$\begin{align}F'(x) &= \int_0^x f(u) \,du + xf(x) - xf(x) \\&= \int_0^x f(u) \,du.\end{align}$$
But that means that $$\begin{align}F(x) &= C + \int_0^x F'(u) \,du \\&= C + \int_0^x \left(\int_0^u f(t)\,dt\right)\,du\end{align}$$ for some constant $C$.  But clearly, using $x=0$, $C=0$, so you are done.
