Proof using Fundamental Theorem of Calculus (Showing RHS = LHS) Question: Prove that $\int^x_0\big[\int^u_0 f(t) dt\big] du = \int^x_0f(u)(x-u) du$ where $f$ is a continuous function.
Attempt:
My lecturer hinted that it'd be helpful to apply the fundamental theorem of calculus to $F(u) = u \int^u_0f(t) dt$.
I know that I can apply the FTC to $F(u)$ since $f$ is continuous, meaning it is also a Riemann integrable function and thus the conditions of the FTC are met.
To find $F'(u)$, I will let $G(u) = u$ and $H(u)=\int^u_0f(t) dt$ be functions such that $F(u)=G(u)H(u)$. 
Thus, $G'(u)=1$ and, applying the FTC, $H'(u)=f(u)$. 
Using the product rule, $F'(u)=G(u)H'(u)+G'(u)H(u)=uf(u)+\int^u_0f(t) dt$.
However, this is where I get stuck and am not sure how to use this to prove the initial equation.
Any help would be greatly appreciated.
 A: $\newcommand{\d}[1]{\; \mathrm{d} #1}$
$\newcommand{\bb}[1]{\left( #1 \right)}$
$\newcommand{\sb}[1]{\left[ #1 \right]}$
We apply integration by parts and FTOC:
\begin{align*}
\int_0^x \bb{\int_0^u f(t) \d{t}} \d{u} &= \sb{u\int_0^u f(t) \d{t}}_{u=0}^{u=x} - \int_0^x u\underbrace{\bb{\int_0^u f(t) \d{t}}'}_{=f(u)\text{ by FTOC}}\d{u} \\
&= x\int_0^x f(t) \d{t} - \int_0^x uf(u)\d{u} \\
&= \int_0^x xf(u) \d{u} - \int_0^x uf(u)\d{u} \\
&= \int_0^x (x - u)f(u) \d{u}
\end{align*}
A: Continuing from where you left off, integrate both sides wrt $u$ from $0$ to $x$ to get
$$\begin{equation}\begin{aligned}
\int_{0}^{x}F'(u)du & = \int_{0}^{x}\left(uf(u) + \int_{0}^{u} f(t) dt\right) du \\
F(x) - F(0) & = \int_{0}^{x}uf(u)du + \int_{0}^{x}\left(\int_{0}^{u}\left(f(t) dt\right)\right) du \\
x\int_{0}^{x}f(t)dt - 0 & = \int_{0}^{x}uf(u)du + \int_{0}^{x}\left(\int_{0}^{u}\left(f(t) dt\right)\right) du \\
\int_{0}^{x}xf(u)du & = \int_{0}^{x}uf(u)du + \int_{0}^{x}\left(\int_{0}^{u}\left(f(t) dt\right)\right) du \\
\int_{0}^{x}\left(\int_{0}^{u}\left(f(t) dt\right)\right) du & = \int_{0}^{x}xf(u)du - \int_{0}^{x}uf(u)du \\
\int_0^x\left(\int_0^u f(t) dt\right) du & = \int_0^x f(u)(x-u) du
\end{aligned}\end{equation}\tag{1}\label{eq1A}$$
Note that with going from the third to the fourth lines, since $t$ and $u$ are just dummy integration variables then, I used a substitution of $u = t$ in the LHS integral. This was so you can more easily see how that integral can be combined with the other integral in the second last line to then get the last line which is what you're trying to show.
A: hint
The derivative of the LHS is
$$\int_0^xf(u)du$$
the RHS can be put as
$$x\int_0^xf(u)du-\int_0^xuf(u)du$$
its derivative is
$$\int_0^xf(u)du+xf(x)-xf(x)=$$
$$\int_0 ^xf(u)du$$
they have the same derivative, so theire difference is a constant $C$.
for $x=0$, we find that $C=0$.
