A variational principle is used to determine the equilibrium density. It can be shown that for constant temperature and volume the correct equilibrium density minimizes the grand potential functional Ω Ω of the grand canonical ensemble over density functions n ( r ) . In the language of functional differentiation (Mermin theorem):