Basics of the calculus of variations

To derive the Kohn-Sham equations, we must first take the derivative of a functional, which is the basic subject of the calculus of variations. Despite the mystique associated with the calculus of variations, it is really no more complicated than taking derivatives of multi-variable functions. This is because any functional, say $F[g(x)]$, may be viewed as just a function of a large collection of variables, namely the values of its argument function $g(x)$ at each point in space $x$. One can think of a function $g(x)$ as a (very long) vector of values, one for each value of $x$, just as we think of a vector $\vec q$ as a set of values $q_i$, one for each value of the index $i$. With this perspective, the points in space $x$ are the analogue of the index $i$, so that we can think of the function $g(x)$ also as the indexed set of values $g_x$.

With this perspective, we see that, just as the first-order variation $df$ of a multi-variable function $f(\vec q)$ with changes in its argument $\vec q$ is given by a sum over the index $i$

\delta f & \equiv & f(\vec q+\delta \vec q)-f(\vec q) \\
& = ...
f}{\partial q_i} \right) \, \delta q_i, \nonumber

the variation of the functional $F[g(x)]$ is given by a ``sum'' over the index $x$,
$\displaystyle \delta F$ $\textstyle \equiv$ $\displaystyle F[g(x)+\delta g(x)]-F[g(x)]$ (13)
  $\textstyle =$ $\displaystyle \int \left( \frac{\delta F}{\delta g(x)} \right) \, \delta g(x)
\, \, dx.$  

Note that, because $x$ is now a continuous variable, the ``sum'' becomes an integral. also, $\left( {\delta F}/{\delta g(x)} \right)$ is the standard notation for the functional derivative, which we see amounts to taking the partial derivative of $F$ with respect to the value $g(x)$. With this understood, we can take functional derivatives as easily as differentiating a multi-variable function. All of the usual rules still apply, such as the product and chain rules!

As an example, let us consider the functional derivative of $E_{xc}[n(\vec x)]$ with respect to $n(\vec
x)$. First, we shall carry out the variation formally, and then we shall show how quickly we arrive at the same result by analogy with multi-variable calculus. Applying the formal definition (13) of the functional derivative to $E_{xc}$ in (11), we find

\delta E_{xc} & \equiv & E_{xc}[n(\vec x)+\delta n(\vec
...\delta n(\vec x) \,\,
dV \mbox{\ \ \ (to first order)},\nonumber

from which we may read off the result
\frac{\delta E_{xc}}{\delta n(\vec x)} = f_{xc}'(n(\vec x)).
\end{displaymath} (14)

Alternatively, we note that Eq. (11) is just the integral of the result of applying the function $f_{xc}(\ldots)$ to each component of $n(\vec
x)$ separately. If this were a multi-variable problem, the analogous function would be a sum over the values of a function evaluated separately on each component,

e_{xc}(\vec q) = \sum_i f_{xc}(q_i),

and the derivatives are then

\frac{\partial e_{xc}}{\partial q_i} = f_{xc}'(q_i)

because only the ``$i$'' term in the sum depends on $q_i$. Changing the $\partial$ symbols to $\delta$, replacing $q$ with $n$ and the index $i$ with $\vec x$, we arrive immediately at precisely (14)!

Tomas Arias 2004-01-26