Free energy in the statistical theory of fluids