Regarding the proof of $\int_0^xf(u)(x-u)du$ This question has already been asked: 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$ but I really don´t understand the part that says that:
$F'(x) = \int_0^x f(u) du + xf(x) - xf(x) = \int_0^x f(u) du$ that means that $F(x) = C + \int_0^x F'(u) du$ what exactly are we doing here? Are we integrating  $F'(x)=\int_0^x f(u) du$ from 0 to x? I know this is a silly question but I would really appreciate your help
 A: here is one way to think about this problem. we will try to solve the initial value problem $$y''(x) = f(x), y(0) = 0, y'(0) = 0$$ in two ways: 
(a) the easiest, we integrate once to get $$y'(x) = \int_0^x f(t) \,dt$$ one more integration gives you $$y(x) = \int_0^x \left(\int_0^s f(t) \, dt\right) \, ds \tag 1$$
(b) we will multiply $(x-t)$ and integrate with respect to $t.$ we get 
$$\begin{align}\int_0^x f(t) (x-t) \, dt &= \int_0^x y''(t)(x-t) \, dt \\
&=y'(t)(x-t)\big|_0^x + \int_0^xy'(t)\\
&=y(x). \tag 2
\end{align}$$
from $(1)$ and $(2),$   we conclude that $$\int_0^x \left(\int_0^s f(t) \, dt\right) \, ds= \int_0^x f(t) (x-t) \, dt$$
A: If I understand the question correctly, you  want to know how:
$\displaystyle F'(x)= \int_0^x f(u)du \implies F(x)=C+\int_0^xF'(u)du$
My book (Spivak's Calculus) provides three theorems can be used to explain this implication:

*

*If $g$ is integrable on $[a,b]$, then the function $G(x)=\displaystyle\int_a^x g(u)du$ is continuous on $[a,b]$...i.e. for any $x \in [a,b]$, $G$ is continuous at $x$ $\quad (\dagger_1)$


*If $g$ is continuous on $[a,b]$, then $g$ is integrable on $[a,b]$ $\quad (\dagger_2)$


*If $g$ is integrable on $[a,b]$ and $g=h'$ for some function $h$, then $\displaystyle \int_a^b g(u)du = h(b)-h(a) \quad (\dagger_3)$

By assumption, we know that $\displaystyle F'(x)= \int_0^x f(u)du$. Further, the problem statement originally tells us that $f$ is continuous. By $(\dagger_2)$, this means that $f$ is integrable on any closed interval $[a,b]$. Accordingly, for sake of argument, let us set our sights on the interval $[0,b]$ for any $b \gt 0$. Therefore, for any $x$ such that $0 \leq x \leq b$, we know that $F'(x)$ is defined. By $(\dagger_1)$, we know that $F'$ is a continuous function on $[0,b]$.
Because $F'$ is continuous on the interval $[0,b]$, $(\dagger_2)$ informs us that $F'$ is integrable on $[0,b]$. Of course, then, it is integrable on $[0,x]$ for any $x \in [0,b]$.
By $(\dagger_3)$, we then have that $\displaystyle \int_0^x F'(u)du=F(x)-F(0)$. Rearranging terms gives us: $\displaystyle F(x)=F(0)+\int_0^xF'(u)du$. Clearly, $C=F(0)$. Further, given how $F$ is initially defined, it should be obvious that $C=F(0)=0$.
