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
as a set of values
, 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
.
With this perspective, we see that, just as the first-order variation
df of a multi-variable function
with changes in its
argument
is given by a sum over the index i
the variation of the functional F[g(x)] is given by a ``sum'' over the index x,
Note that, because x is now a continuous variable, the ``sum'' becomes
an integral. also,
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
with respect to
. 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
in
(11), we find
from which we may read off the result
Alternatively, we note that
Eq. (11) is just the integral of the result of applying
the function
to each component of
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,
and the derivatives are then
because only the ``i'' term in the sum depends on
. Changing
the
symbols to
, replacing q with n and the
index i with
, we arrive immediately at precisely
(14)!