Given the definitions of ρ and E[ρ], we now search for the density that minimizes the energy functional under the constraint that the total number of electrons is conserved. From the definition of δρ, it can be seen that this is equivalent to the constraint that A q A = Q tot , with the total system charge Q tot . This can be achieved by defining the Lagrangian