Etude: Local functional derivatives
Etudes
Same etude convention as the eigenvalue page. The kernel here isn't a Python function but a procedure you do with pencil and paper. Write , expand to first order in , and read off whatever sits next to inside the integral. That thing is . The recipe never changes. Only the functional does.
"Local" here means the functional has the form — only the density at a single point shows up under the integral, no gradients, no double integrals, no orbital occupancies. Ten variations follow, in increasing difficulty. Read the recipe once and you should be able to redo every one of them on a napkin.
See the overview page on functional derivatives for the background and the notation. This page assumes you've read that.
The kernel (one more time)
Two moves. First, perform the expansion on the left explicitly, keeping only first-order terms in . Second, look at what multiplies inside the integral. That's the answer.
Variation 1: the calibration shot
The simplest possible local functional: just the particle number.
Expand:
The functional derivative of "count the electrons" is the constant function 1. Makes sense: if you add one electron's worth of density at any point, the count goes up by one. Use this in the Lagrange multiplier section of the overview page — the constraint contributes a 1 to , which is why (a constant) at the minimum.
Variation 2: quadratic
Expand the square and keep linear order:
Same shape as . The rule generalizes cleanly.
Variation 3: arbitrary power
Use the binomial expansion or just the first-order Taylor expansion of :
The power rule survives. Try (recovers Variation 1) and (recovers Variation 2). Both check out.
Variation 4: Thomas-Fermi kinetic energy
This is Variation 3 with and an overall constant . The constant just rides along.
This is the local kinetic-energy potential in Thomas-Fermi theory. It enters the Thomas-Fermi-Dirac equation as the kinetic contribution to the Kohn-Sham-like effective potential. Not a great approximation in real molecules, but historically important.
Variation 5: entropy-like (ρ log ρ)
Expand using :
This is the basic shape of the Boltzmann entropy functional . Its functional derivative shows up in density-functional formulations of statistical mechanics, plus one classical-DFT crowd uses it for fluids. The "+1" is easy to drop if you forget the product rule — and dropping it is wrong.
Variation 6: the master formula
Variations 1, 2, 3, 4, 5 are all special cases. Same recipe: Taylor-expand . Plug in:
Master formula for any local functional. Memorize this one and the first five variations fall out by plugging in and computing the ordinary way.
Variation 7: external potential energy
is some fixed function — the external potential (nuclear attraction, applied field). Not a function of the density. Wiggle :
The functional derivative of "energy in an external potential" IS that external potential. This is the Hohenberg-Kohn map taken the "easy" direction: given a density, falls out of for free. Hohenberg-Kohn's harder claim — that the density determines uniquely up to a constant — is a separate (and famous) argument.
Variation 8: weighted quadratic
is a fixed weighting function (think: a position-dependent self-interaction). Local in , just with a weight in front. Expand the square, keep linear order:
Pattern: the position-dependent weight comes along for the ride. This is what makes "weighted-density" approximations work — the structure of the local recipe doesn't care whether the function of is dressed with an explicit -dependent coefficient.
Variation 9: product of two local functions
Both and are smooth functions of . The integrand is local — only one under the integral — so the master formula (Variation 6) applies with :
Just the product rule from ordinary calculus, applied pointwise. Test case: and recovers Variation 5. Sanity check passes.
Variation 10: functional of a functional (chain rule preview)
Now things change shape: isn't of the form . Instead it depends on through a single number . Use the chain rule:
The functional derivative is a CONSTANT (it doesn't depend on ) — equal to . That makes sense: only cares about the total particle number, not where the density sits, so bumping at changes by the same amount regardless of .
This is the cleanest possible chain-rule example. The next etude will go through it in full, including the non-local generalization where talks to through a function rather than a number.
Closing thoughts
Every variation above ended in the same place: identify what multiplies inside the integral. The local case is uniformly easy because the answer is always a function of at the same point — everything is pointwise. The trickier cases (gradient functionals, orbital-dependent functionals, multi-density functionals) need their own etudes; the trickiness lives in how the functional couples points, not in the recipe itself.
If you can do these ten without looking, you're set for the local portion of DFT. Onward.