Differentiation of definite integral with respect to function inside integrand I have an integral which is of the form:
$$ I = \int_0^\infty g(t, x(t)) \, dt. $$
I'm trying to demonstrate how incremental changes in $x(t)$, for any given $t$, affect $I$. Informally/intuitively, I'm fairly sure the answer I'm looking for is $g_2(t,x(t))$, where $g_2$ is the partial derivative with respect to the second argument. But I'm not sure what I'm technically mathematically doing here.
I can think of three possibilities:

*

*Maybe I'm trying to take some kind of functional derivative? I don't know much about functional derivatives, so I'm not sure whether they're applicable here.


*Maybe this involves some version of Leibniz's rule, though the situation appears different because the second argument $x(t)$ is a function of the first - not an independent parameter - and I'm considering the effect of a change for a given value of $t$.


*In that case that $g(t, x(t)) = f(t)x(t)$, where $x(t)$ is a density function. Then $f$ can be viewed as the Radon-Nikodym derivative of a probability measure for $t$, $\mathbb{P}$, with respect to the Lebesgue measure. Then $I$ can be written
$$ I = \int_{\mathbb{R}_+} f(t)x(t) \, dt = \int_{\mathbb{R}_+} f \, d\mathbb{P} $$
so taking the derivative with respect to $x(t)$ for some $t$ involves differentiating the integral with respect to the measure (if that makes any sense)?
I would greatly appreciate if anyone could point me in the right direction for this problem and/or any of these three possibilities. Maybe some of these are different ways of approaching the same problem? Or maybe they are all off track.
Thanks!
 A: This is essentially the calculus of variations, which measures the change in functionals as we vary the input functions. We first should note that $I$ is a function of a function $x$, which we will then write
$$I(x)=\int_0^\infty g(t,x(t))dt$$
Let's suppose that we perturb $x$ by some function $\eta$, but examine what happens as we shrink this perturbation, so we consider the new function $x+\epsilon\eta$ and consider what happens when $\epsilon$ is very small. We then have
$$I(x+\epsilon\eta)=\int_0^\infty g(t,(x+\epsilon\eta)(t))dt$$
We can then define an auxiliary function $\Phi_\eta(\epsilon)$ as $\Phi_\eta(\epsilon)=I(x+\epsilon\eta)$, which is purely a scalar function of $\epsilon$. We differentiate this and get
$$\Phi_\eta'(\epsilon)=\int_0^\infty\eta(t)g_2(t,(x+\epsilon\eta)(t))dt$$
If we let $\epsilon\to 0$, this represents how $I$ changes when we perturb $x$ by the function $\eta$. This gives
$$\Phi_\eta'(0)=\int_0^\infty\eta(t)g_2(t,x(t))dt$$
In other words, this integral measures how an incremental change in $x$ in the form of $\eta$ changes the value of $I$.
