Prove that $g'' = f$ Let $f:[0, 1] \to \mathbb R$ be a continuous function and $g: [0, 1] \to \mathbb R$ be defined through $g(x) := \int_0^x(x - t)f(t)dt$. Prove that $g'' = f$ in $[0, 1]$.
My work so far:
I've defined a function $h(t) = (x-t)f(t)$, so that now 
$g(x) = \int_0^xh(t)dt$ 
and I can use the fundamental theorem of calculus to obtain:
$g'(x) = \frac{d}{dx}\int_0^xh(t)dt = H'(x) = h(x)$, where $H(x)$ is the antiderivative of $h(x)$. So $h$ is the antiderivative of $g$, meaning that 
$g''(x) = h'(x)$ where $h'(t) = [(x - t)f(t)]' = -f(t) + (x-t)f'(t)$, so $g''(x) = -f(x)$. 
I'm almost there, but I get a minus to the front... Where am I doing wrong? Thanks in advance!
 A: You cannot use the FTC when the integrand $h(t)$ depends on $x$. Instead of FTC you can use Leibniz  Rule but in this case you can use FTC as follows: 
Write $g(x)=x\int_0^{x} f(t)dt-\int_0^{x} tf(t)dt$. Now you can apply product rule and FTC to get $g'(x)=[xf(x)+\int_0^{x} f(t)dt]-xf(x)=\int_0^{x} f(t)dt$. Another application of FTC gives $g''(x)=f(x)$. 
A: $$g(x) = \int_0^x(x - t)f(t)dt$$
Differentiating with respect to $~x~$ by using differentiation under the integral sign, we have
$$g'(x) = \int_0^x f(t)dt ~+~0$$
Again differentiating with respect to $~x~$ by using differentiation under the integral sign, we have$$g''(x)=f(x)$$

Leibniz Integral Rule (Differentiation under the integral sign):
Let $f(x, t)$ be a function of $x$ and $t$ such that both $f(x, t)$ and its partial derivative $\frac{\partial f}{\partial x}$ are continuous in $t$ and $x$ in some region of the $(x, t)$-plane, including $a(x) ≤ t ≤ b(x)$, and $ x_0 ≤ x ≤ x_1$. Also suppose that the functions $a(x)$ and $b(x)$ are both continuous and both have continuous derivatives for $x_0 ≤ x ≤ x_1$. Then, for $x_0 ≤ x ≤ x_1$,
$$\frac{d}{dx}\left(\int_{a(x)}^{b(x)} f(x,t) dt\right)=\int_{a(x)}^{b(x)} \frac{\partial }{\partial x}f(x,t) dt +f( x, b(x)) \frac{db}{dx}-f( x, a(x)) \frac{da}{dx}$$

