Functional derivative of integral with boundary contribution What is the functional derivative of a functional $F$ that is expressed as a volume integral over a region $\Omega\subset\mathbb R^3$ plus a surface integral over the boundary $\partial\Omega$?
An example for such a functional is
$$
 F[c] = \int_\Omega f(c, \nabla c) \, \mathrm{d}V + \oint_{\partial\Omega} g(c) \, \mathrm{d} S
\;.
$$
I think that inside the domain the functional derivative reads
$$
    \frac{\delta F}{\delta c} = \frac{\partial f}{\partial c}
 - \nabla \frac{\partial f}{\partial (\nabla c)}
\;,
$$
but I do not know how to deal with the boundary. I'm not even sure whether the problem is well-posed (even assuming reasonably nice properties of $\Omega$, $f$, and $g$).
My more general question therefore is how one deals with functionals of the aforementioned structure.
 A: Generally speaking, the boundary terms in a functional only contributes to the boundary conditions, and would not lead changes to the variational derivative.
For your example, repeat the derivation of the classical Euler-Lagrange equation, and
\begin{align}
\delta F&=\int_{\Omega}\delta f(c,\nabla c)\,{\rm d}V+\int_{\partial\Omega}\delta g(c)\,{\rm d}S\\
&=\int_{\Omega}\left(\frac{\partial f}{\partial c}\delta c+\frac{\partial f}{\partial\left(\nabla c\right)}\cdot\nabla\delta c\right){\rm d}V+\int_{\partial\Omega}g'(c)\delta c\,{\rm d}S\\
&=\int_{\Omega}\left(\frac{\partial f}{\partial c}\delta c+\nabla\cdot\left(\frac{\partial f}{\partial\left(\nabla c\right)}\,\delta c\right)-\nabla\cdot\left(\frac{\partial f}{\partial\left(\nabla c\right)}\right)\delta c\right){\rm d}V+\int_{\partial\Omega}g'(c)\delta c\,{\rm d}S\\
&=\int_{\Omega}\left(\frac{\partial f}{\partial c}-\nabla\cdot\left(\frac{\partial f}{\partial\left(\nabla c\right)}\right)\right)\delta c\,{\rm d}V+\int_{\partial\Omega}\left(\frac{\partial f}{\partial\left(\nabla c\right)}\cdot n+g'(c)\right)\delta c\,{\rm d}S,
\end{align}
where $n$ denotes the outward unit normal vector on $\partial\Omega$.
Therefore, the $c$ that minimizes $F$ must satisfy
\begin{align}
\frac{\partial f}{\partial c}-\nabla\cdot\left(\frac{\partial f}{\partial\left(\nabla c\right)}\right)&=0\quad\text{in }\Omega,\\
\frac{\partial f}{\partial\left(\nabla c\right)}\cdot n+g'(c)&=0\quad\text{on }\partial\Omega
\end{align}
due to the arbitrariness of $\delta c$.
A: The problem can be solved by calculating the first variation of the functional from scratch.
Here, the first variation reads $\delta F
 = \lim_{\epsilon \rightarrow 0}(F[c +  \delta c]  - F[c])$ with $\delta c =\epsilon \phi$ and $\phi$ is a arbitrary function.
We thus have
\begin{align}
 F[c + \epsilon \phi]  &=
  \int_\Omega f(c + \epsilon\phi, \nabla c  + \epsilon \nabla \phi) \mathrm{d}^3 r 
+
  \oint_{\partial\Omega} g(c + \epsilon\phi) \mathrm{d}^2 r
\end{align}
which can be expanded to first order in $\epsilon$,
\begin{align}
 F[c + \epsilon \phi]  &=
  \int_\Omega\left[
  f(c, \nabla c)
  + \frac{\partial f}{\partial c}\epsilon\phi
  + \frac{\partial f}{\partial (\nabla c)}\epsilon \nabla \phi
 \right] \mathrm{d}^3 r
+
  \oint_{\partial\Omega} \left[
    g(c)
   + g'(c)\epsilon\phi)
 \right] \mathrm{d}^2 r
 \;.
\end{align}
We thus obtain for the first variation
\begin{align}
 \delta F &= 
  \int_\Omega\left[
  \frac{\partial f}{\partial c}\delta c
  + \frac{\partial f}{\partial (\nabla c)} \nabla \delta c
 \right] \mathrm{d}^3 r +
  \oint_{\partial\Omega} \!\!\! g'(c)\delta c \, \mathrm{d}^2 r
\end{align}
Using integration by parts
\begin{align}
 \delta F &= 
  \int_\Omega\left[
  \frac{\partial f}{\partial c}\delta c
  -  \delta c\nabla\frac{\partial f}{\partial(\nabla c)} 
 \right] \mathrm{d}^3 r 
+
  \oint_{\partial\Omega}\left[
  \frac{\partial f}{\partial (\partial_\alpha c)} n_\alpha \delta c
  + g'(c)\delta c
 \right] \mathrm{d}^2 r
\;,
\end{align}
where $n_\alpha$ is the normal vector of the boundary.
In particular, the associated Euler-Lagrange equations read
\begin{align}
 0 &= \frac{\partial f}{\partial c} - \nabla\frac{\partial f}{\partial (\nabla c)} 
\\
 0 &= \frac{\partial f}{\partial(\partial_\alpha c)} n_\alpha + g'(c)
 \label{eqn:stationary_point_boundary}
\end{align}
