TITLE: Is there a chain rule for functional derivatives?
QUESTION [18 upvotes]: Given a functional $S=S\{Y[X(r)]\}$, is the following "chain rule" valid?
$$\frac{\delta S\{Y[X]\}}{\delta X(r)}=\frac{\partial Y(r)}{\partial X(r)}\frac{\delta S[Y]}{\delta Y(r)}$$

REPLY [9 votes]: Yes. There is a chain rule for functional derivatives. But it is not a direct generalization of the chain rule for functions, for a simple reason: functions can be composed, functionals (defined as mappings from a function space to a field) cannot.
Consider the scalar function $f: (y_1,...,y_n) \mapsto g(x_1(\mathbf{y}),...,x_n(\mathbf{y}))$, which is the composition of $g$ with the coordinate functions $x_i(\mathbf{y})$.
The partial derivative of $f$ with respect to $y_j$ at the point $\mathbf{y}$ is given by the chain rule
$$
\frac{\partial f (\mathbf{y}) }{\partial y_j}= \sum_{i = 1}^N \frac{\partial g(\mathbf{x}(\mathbf{y}))}{\partial
x_i}  \frac{\partial x_i(\mathbf{y})}{\partial y_j}.
$$
Now, the continuum generalization of the coordinate functions $x_i$ is the one-parameter family of functionals
$$
\lambda(s) = \Lambda[f;s], \quad s \in \mathbb{R},
$$
where $\Lambda[f;s]$ means that $\Lambda$ is a functional of $f$ and a function of $s$. 
A functional $G$ can only act on $\Lambda$ considered as a function of the parameter $s$. Therefore, $G[\Lambda[f;s]]$ is meant to be understood as $G[\lambda]$. Contrary to the claims of many physics textbooks, there is no such thing as the functional of a functional.
Since a variation of $f$ will change the value of $\lambda$, ultimately it results in a variation of $G$. Therefore, $G[\Lambda[f;s]]=G[\lambda]$ can be considered as a functional $F[f]$. The partial functional derivative of $F$ with respect to the local change of $f$ at $x$ is given by [1] Appendix A:
$$
\frac{\delta F [f]}{\delta f (x)} = \int \mathrm{d} y \frac{\delta G
[\lambda]}{\delta \lambda (y)}  \frac{\delta \Lambda [f ; y]}{\delta f (x)} .
$$
This is the generalization of the chain rule for functionals.
[1] E. Engel, R.M. Dreizler, Density Functional Theory: An Advanced Course, Springer Science & Business Media, 2011.