Derivative of an integral with respect to a function Can some one help me out this derivative:
$$
\frac{\partial\int_{-\infty}^\infty f(x)g(x)\,dx}{\partial g}
$$
Appreciate any explanation!

Many thanks to those who answered or commented on my question!
Maybe I am not very clear about my question or I might have misunderstood what I need. I was reading a Quantum Field Theory textbook and trying to verify the following equation:
$$
\langle 0\mid 0\rangle_{f, h} = \int Dp\,Dq \exp \left[i\int_{-\infty}^\infty dt(p\dot q-H_0(p, q)-H_1(p, q)+fq+hp)\right]
$$
$$
=\exp \left[ -i\int_{-\infty}^\infty dt \, H_1 \left( \frac 1 i \frac \delta {\delta h(t)}, \frac 1 i \frac{\delta}{\delta f(t)} \right) \right]\times \int Dp\,Dq\, \exp \left[ i\int_{-\infty}^\infty dt\,(p\dot q-H_0(p, q)+fq+hp) \right]
$$
I expanded the first exponential of the second line to a Taylor series. Thus every term is a derivative with respect to either $h(t)$ or $g(t)$. And then I got lost.
I guess this is related to functional derivatives and I tried to search some examples but I failed. Or maybe it's just I didn't realize I have seen the same thing because of my poor math.
 A: The integral $\displaystyle\int_{-\infty}^\infty f(x)g(x)\,dx$ is just a number, not a function of $x$.  But maybe what you want to differentiate is $\displaystyle g\mapsto\int_{-\infty}^\infty f(x)g(x)\,dx$, i.e. the derivative with respect to $g$ rather than with respect to $g(x)$.  If so, I'd omit the "$x$" from the notation; there isn't any $x$.
Now recall from calculus that $\displaystyle g\mapsto\int_{-\infty}^\infty f(x)g(x)\,dx$ is linear in $g$, i.e. if $g=g_1+g_2$ then the output will be the sum of the output when the two inputs are $g_1$ and $g_2$ and if $g=cg_1$ where $c$ is constant, then the output will be $c$ times whatever it is when the input is $g_1$.
A: Once $f$ is given, the mapping $F:g\mapsto \int_{-\infty}^{\infty} f(x)g(x)dx $ is a linear functional of $g$. As a linear functional $F$ is its own differential anywhere.
Exactly what kind of object the notation $\frac{\partial}{\partial g(x)} F(g)$ should denote may depend on the exact context you see it in, but in this case where $F$ is linear, the meaning should be something that is "morally equivalent" to $F$ itself.
It would seem reasonable to declare that the derivative is $F$ ... or a constant map whose value is $F$ for any $g$ ... or, in particular if we have defined an inner product $\langle f,g\rangle = \int_{-\infty}^{\infty} f(x)g(x)\,dx $, we could argue for the derivative being $f$, or a constant map whose value is $f$.
A: Here is first one approach. First consider the chain rule:
$$\frac{\partial I}{\partial g(x)} = \frac{\partial I}{\partial x} \frac{\partial x}{\partial g(x)}$$ The first derivative is given right from the fundamental theorem of calculus, but maybe the second expression is a bit difficult to interpret or calculate?
Instead you can make a substitution $t = g(x), \frac{\partial t}{\partial x} = g'(x)$, i.e. $\partial x = \partial g(x)/g'(x)$. Where $g'(x) = \frac{\partial g(x)}{\partial x}$.
Then the integral becomes:
$$\int_{-\infty}^{\infty} \frac{f(x)g(x)}{g'(x)} \partial g(x)$$ and the integration will be eaten by the differentiation.
A: I just see this question posted 5 years ago because I got into a similar problem. I struggled for days but I think I got a reasonable answer that convince me.
So your integration variable x is actually a dummy variable. The x inside the integral can be swapped with any other name, e.g. y, z, alpha....etc. This integration variable is different than the variable x in the external g(x). Understanding this concept is critical.
So if I rewrite your equation, it is differentiating an integral in y with respect to a function g at an chosen point x.
$$
\frac{\partial \int_{-\infty}^{+\infty} f(y)g(y) dy }{\partial g(x)}
$$
As long as the limit of the integral is not a function of the g(x), you can move in the partial derivative.
$$
\int_{-\infty}^{+\infty} f(y) \frac{\partial g(y)}{\partial g(x)} dy
$$
Differentiating a function at a point with respect to itself at another point is a Dirac delta function. (I looked it up in wolfram alpha and convinced myself this is true. However, I cannot find other source since this is very rarely used.)
$$
\int_{-\infty}^{+\infty} f(y) \delta(x,y) dy
$$
The finally by the sifting property of the dirac delta function, the result is
$$
f(x)
$$
