Density functional theory states that when any fluid is exposed to an external potential, , then all equilibrium quantities become functions of number density profile, . As a result, the total free energy is minimized. The Grand canonical potential, , is then written
where  is the chemical potential,  is the temperature, and  is the helmholtz free energy.