## 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 , may be viewed as just a function of a large collection of variables, namely the values of its argument function at each point in space . One can think of a function as a (very long) vector of values, one for each value of , just as we think of a vector as a set of values , one for each value of the index . With this perspective, the points in space are the analogue of the index , so that we can think of the function also as the indexed set of values .

With this perspective, we see that, just as the first-order variation of a multi-variable function with changes in its argument is given by a sum over the index

the variation of the functional is given by a sum'' over the index ,
 (13)

Note that, because 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 with respect to the value . 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
 (14)

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 '' term in the sum depends on . Changing the symbols to , replacing with and the index with , we arrive immediately at precisely (14)!

Tomas Arias 2004-01-26