I am not a mathematician, so I apologize in advance for any sloppiness.
Suppose we have the following differential equation:
$$\dot{x}(t) = \Phi (x(t),\gamma)$$
where $\gamma$ is some parameter and $\Phi$ a well-behaved function (at least differentiable), but complicated enough so that this ODE does not have an explicit analytical solution (it can only be computed numerically).
I want now to ‘‘upgrade’’ $\gamma$ from being a fixed parameter to being a function of time $\gamma(t)$, and this function satisfies a differential equation obtained from the extremization of the functional
$$F= \int_0^\infty f(x(s),\gamma(s),\dot{\gamma}(s))ds$$
with again $f$ well-behaved.
My question is: in this case can I take the functional derivative of $F$ as simply $$\frac{\delta F}{\delta \gamma(t)} = \frac{\partial f}{\partial \gamma} - \frac{d}{dt} \frac{\partial f}{\partial \dot{\gamma}}$$ or not? Because I am somehow convinced that $x(t)$ depends on the whole trajectory of $\gamma$ from $0$ to $t$, so maybe I have to take this dependence into account. If that is the case, how can I take this functional derivative?