Leibniz's rule and proving that $x(t)$ satisfies integral The question is:  

Show that if $x(t)$ satisfies the integral equation $$x(t) = a + bt + \int_{0}^{t}(t-s)f(x(s))ds $$ then $x(t)$ is a solution to the initial value problem $$x''(t) = f(x(t))$$ for $t>0$, with $x(0) = a, x'(0) = b.$  

This is what I've done and I'm not sure if it's even remotely correct.
$$\frac{d}{dt}x(t) = \frac{d}{dt}\left(a + bt + \int_{0}^{t}(t-s)f(x(s))ds\right) \\ x'(t) = b + \frac{d}{dt} \left(\int_{0}^{t}(t-s)f(x(s))ds\right)  \\ x'(t) = b + \int_{0}^{t} \frac{\partial}{\partial t}(t-s)f(x(s))ds \\ x'(t) = b + \int_{0}^{t} f(x(s)) + \frac{\partial f(x(s))}{\partial t}(t-s)\frac{\partial x(s)}{\partial t} ds \qquad \text{by chain rule and product rule} $$
Then I take the derivative again, and I don't seem to get the required result. Can someone tell me if I did something wrong and guide me in the correct way?
 A: Note that by the fundamental theorem of calculus, $\frac{d}{dt} \int^t_0 f(s)ds = f(t)$. If you use Leibniz's rule, you would get the analogous $\frac{d}{dt} \int^t_0 f(x(s))ds = f(x(t))$ since $f(x(t))$ can be thought of as $f(x,t)$. 
To your question, what you miss is a product rule. It's slightly easier to see this way.
\begin{align}
\frac{d}{dt}x(t) &= \frac{d}{dt}\left(a + bt + \int_{0}^{t}(t-s)f(x(s))ds\right)\\
&= b + \frac{d}{dt} \left(\int_{0}^{t}(t-s)f(x(s))ds\right)\\
&= b + \frac{d}{dt} \left(t\int_{0}^{t}f(x(s))ds\right) - \frac{d}{dt}\left(\int_{0}^{t}sf(x(s))ds\right) \\
&= b + \left(\int_{0}^{t}f(x(s))ds + t f(x(t)) \right) - tf(x(t))\\
&= b + \int_{0}^{t}f(x(s))ds
\end{align}
It follows that $x'' = f(x(t))$.
Note that if you use the full version of Leibniz's rule, which is
$$\frac{d}{dt} \int^{b(t)}_{a(t)} f(t,x) dx = f(t,b(t))\frac{db(t)}{dt} - f(t,a(t)) \frac{da(t)}{dt} + \int^{b(t)}_{a(t)} \frac{\partial}{\partial t} f(x,t) dx$$
with $b(t) = t$ and $a(t) = 0$. You would get the same.
On to your question about the factor $(t - s)$, This does not work because your function $g(s)$ is not the same as $g(s,t)$. Note that last integral above (it's a partial derivative instead). For example, $\frac{d}{dt} g(t) = g'(t)$ but $\frac{d}{dt} g(x(t)) = g'(x(t)) x'(t)$. Fundamental Theorem of Calculus is usually written in 1-dimension, Leibniz's rule is its generalization.
A: If you know convolution (notation *), here is a proof based on the following facts 


*

*$(u*v)'=u'*v,$ 

*the derivative of the Heaviside function $1_{x>0}$ is $\delta$ distribution, 

*$\delta$ is neutral for convolution: $\delta*\varphi=\varphi$.
Let us write the integral equation under the form:
$$\tag{1}x(t)=a+bt+t*f(x(t))$$
Let us differentiate (1):
$$\tag{2}x'(t)=b+(t')*f(x(t))=b+1_{x>0}*f(x(t))$$
Let us differentiate (2):
$$\tag{3}x''(t)=(1_{x>0})'*f(x(t))=\delta*f(x(t))=f(x(t))$$
