derivative of an integral wrt a function I need to calculate
$$
\frac{d}{dx(t)} \int_{0}^{t} f \big( a(\tau), x(\tau) \big) \, d\tau
$$
My understanding is that the Leibniz's rule can be used only if $x$ is independent of $\tau$. Therefore, I am afraid that we cannot use the Leibniz's rule since $x$ is a function of $\tau$
 A: Let $S[x](t) = \int_0^t f\left(a(\tau), x(\tau)\right) \, d\tau$ and let $\xi$ be a function of the same type as $x$ (preferable with compact support). Now study
$$\frac{d}{d\lambda} S[x+\lambda\xi] = \frac{d}{d\lambda} \int_0^t f\left(a(\tau), x(\tau)+\lambda\xi(\tau)\right) \, d\tau$$
Assuming that it's okay to move the derivative into the integral, the right hand side can be written
$$\int_0^t \frac{d}{d\lambda} f\left(a(\tau), x(\tau)+\lambda\xi(\tau)\right) \, d\tau
= \int_0^t \frac{\partial f}{\partial x}\left(a(\tau), x(\tau)+\lambda(\tau)\xi(\tau)\right) \, \xi(\tau) \, d\tau
$$
Now we set $\lambda=0$:
$$\left. \frac{d}{d\lambda} S[x+\lambda\xi] \right|_{\lambda=0}
= \int_0^t \frac{\partial f}{\partial x}\left(a(\tau), x(\tau)\right) \, \xi(\tau) \, d\tau
$$
The functional derivative $\frac{d}{dx(t)} S[x]$ is now defined so that
$$\left. \frac{d}{d\lambda} S[x+\lambda\xi] \right|_{\lambda=0}
= \int_{-\infty}^{\infty} \frac{d}{dx(t)} S[x] \, \xi(t) \, dt$$
Comparing the two right hand sides we see that they are almost on the same form. The problem are the limits of the upper integral. But we can solve this by inserting an extra function:
$$\int_0^t \frac{\partial f}{\partial x}\left(a(\tau), x(\tau)\right) \, \xi(\tau) \, d\tau
= \int_{-\infty}^{\infty} \chi_{[0, t]}(\tau) \, \frac{\partial f}{\partial x}\left(a(\tau), x(\tau)\right) \, \xi(\tau) \, d\tau
$$
where $\chi_{[0,t]}(\tau) = 1$ if $\tau \in [0,t]$ and $=0$ otherwise.
Thus,
$$\frac{d}{dx(t)} \int_{0}^{t} f \big( a(\tau), x(\tau) \big) \, d\tau
= \frac{d}{dx(t)} S[x]
= \chi_{[0, t]}(t) \, \frac{\partial f}{\partial x}\left(a(t), x(t)\right)$$
