  Semiclassical theories like the Thomas-Fermi and Wigner-Kirkwood methods give
a good description of the smooth average part of the total energy of a Fermi
gas in some external potential when the chemical potential is varied. However,
in systems with a fixed number of particles N, these methods overbind the
actual average of the quantum energy as N is varied. We describe a theory that
accounts for this effect. Numerical illustrations are discussed for fermions
trapped in a harmonic oscillator potential and in a hard wall cavity, and for
self-consistent calculations of atomic nuclei. In the latter case, the
influence of deformations on the average behavior of the energy is also
considered.
