Derivative of a Functional w.r.t. a compound function I have a functional of the form 
$ F(x, f(x), f(g(x)))$
e.g. 
$F=e^x f(x)-f(e^x)$
I want to compute the derivative with respect to $f(.)$ but I am not sure how to. My intuition is that the function $g(x)$ does not matter for the derivative and therefore:
$\frac{\delta F}{\delta f}=e^x-1$
But I want to be sure, thanks in advance. 
 A: Generally, no, $g(x)$ does matter.  Take $g(x)=x$ for example and you will see that something does matter about $g$.
To be more specific, the derivative with respect to $f$ means:

As $f$ changes, how much does $F$ change?  Then take the ratio of these two (with a limit)

Particularly, assuming $f(x)$ is an actual function, then as $f$ changes, $x$ changes.
As $x$ changes, $g$ changes.
And as $x$, $f$, and $g$ change, $F$ changes.
The exact relationship is given by
$$\frac{dF}{dy}=\frac{\partial F}{\partial x}\frac{dx}{df}+\frac{\partial F}{\partial f}\frac{df}{dy}+\frac{\partial F}{\partial f(g)}\frac{df(g)}{dy}$$
Which is the multivariable chain rule.  One might wish to use the relationship:
$$f(g(x))=f(g(y^{-1}(y(x))))$$
Assuming $y^{-1}$ exists.  Presumably, it must exist, as there must be one unique $x$ for each $y$ on the interval we are looking at, or else the line:

As $y$ changes, $x$ changes

fails to be unique, being that there are multiple values of $x$ for each $y$, each changing at different rates.
