Here is the crucial equation which links the Helmholtz free energy and the partition function:
Since , from the fundamental thermodynamic relation we obtain . Thus
(We first met these in the derivation of Maxwell's relations.) For a magnetic system, we have instead of the equation for P.
Remember, and hence depend on (or ) through the energies of the microstates. For instance the energy levels of a particle in a box of side are proportional to .
These relations are reminiscent of those we met in the case of an isolated system, but there the entropy was the key; here it is the Helmholtz free energy. We can make the following comparison:
It should not surprise us to find that the Helmholtz free energy is the key to a system at fixed temperature (in contrast to the entropy for an isolated system) as that is what we found classically (see here.)
References