Physics
Universitystatistical-mechanics

Free Energy and Thermodynamic Potentials

Entropy maximization is the right rule for an isolated universe, but almost nothing you study is isolated — free energy is what 'maximize entropy' turns into once a system is sitting in a room, not floating alone in the void.

Before this, you should know:

The second law says entropy increases for an isolated system. That's a clean, powerful statement — and almost useless for the actual experiments physicists and chemists run every day. A beaker of reacting chemicals on a lab bench is not isolated. It sits in a room at a fixed temperature, freely trading heat with the air around it, and it's often open to the atmosphere, freely trading volume against a fixed external pressure too. The system you actually care about is only ever part of "the isolated universe" the second law talks about — so what quantity should you actually track, if not the entropy of a system that isn't isolated to begin with?

There is an answer, and it isn't a retreat from the second law — it's the second law, worked out honestly for a system that isn't alone.

Building the right quantity from the second law itself

Consider a system held at fixed temperature TT by contact with a large reservoir (a room, a water bath — anything big enough that its own temperature doesn't budge), and fixed volume VV (a rigid, sealed container: no work is done by expansion). The full second law applies to the combined system-plus-reservoir, since that combination really is isolated:

ΔSsys+ΔSres0\Delta S_{\text{sys}} + \Delta S_{\text{res}} \geq 0

At fixed volume, the system does no work, so whatever energy it gains comes entirely as heat: ΔUsys=Qsys\Delta U_{\text{sys}} = Q_{\text{sys}}. Whatever heat flows into the system leaves the reservoir, so Qres=Qsys=ΔUsysQ_{\text{res}} = -Q_{\text{sys}} = -\Delta U_{\text{sys}}, and because the reservoir is so large that this heat exchange happens at its fixed temperature TT, its entropy change is exactly ΔSres=Qres/T=ΔUsys/T\Delta S_{\text{res}} = Q_{\text{res}}/T = -\Delta U_{\text{sys}}/T. Substitute into the second law:

ΔSsysΔUsysT0\Delta S_{\text{sys}} - \frac{\Delta U_{\text{sys}}}{T} \geq 0

Multiply through by T-T (which is positive, so the inequality flips direction):

ΔUsysTΔSsys0\Delta U_{\text{sys}} - T\Delta S_{\text{sys}} \leq 0

The left side is exactly Δ(UTS)\Delta(U-TS), evaluated for the system alone. Define the Helmholtz free energy:

FUTSF \equiv U - TS

and the result reads ΔF0\Delta F \leq 0. At fixed temperature and volume, a system evolves so as to decrease its free energy, and sits in equilibrium exactly where FF is minimized. The second law, which looked like a statement about the entire universe's entropy, has become a statement purely about the system itself — provided you track FF, not SS, once the system is embedded in a reservoir rather than isolated.

The identical argument, run at fixed temperature and fixed pressure instead of fixed volume (an open beaker exposed to the atmosphere, rather than a sealed rigid box, so the system can also do PΔVP\Delta V work against the surrounding air as it changes volume) produces a close cousin, the Gibbs free energy:

GU+PVTS=HTSG \equiv U + PV - TS = H - TS

where HU+PVH\equiv U+PV is the enthalpy. Exactly as with FF, a system held at fixed TT and PP evolves to minimize GG. The two potentials aren't competing ideas — they're the same construction, applied to two different sets of experimental constraints. Constant volume, sealed container: use FF. Constant pressure, open to the atmosphere: use GG. Almost every real chemical reaction happening in an open flask is a GG-minimization problem; almost every gas confined to a rigid tank is an FF-minimization problem.

A curve representing free energy F plotted against some configuration variable of the system, shaped like a valley with two local dips of different depths, with a small ball resting partway up the shallower dip and an arrow showing it rolling downhill toward the deeper, global minimum, labeled equilibrium.

A system in contact with a reservoir rolls downhill on the free-energy landscape exactly the way a ball rolls downhill on an ordinary potential-energy landscape — except here, "downhill" already has entropy baked into its definition.

The bridge to the partition function

This is the moment the partition function earns the central role it was given. Recall the Gibbs entropy formula, the natural generalization of Boltzmann's S=kBlnΩS=k_B\ln\Omega to a system whose microstates aren't all equally likely, only distributed according to some probability PsP_s:

S=kBsPslnPsS = -k_B\sum_s P_s\ln P_s

As a sanity check before using it: if every one of Ω\Omega microstates is equally likely, Ps=1/ΩP_s = 1/\Omega for each, this reduces to S=kBs1Ωln1Ω=kBΩ1Ω(lnΩ)=kBlnΩS = -k_B\sum_s\frac{1}{\Omega}\ln\frac{1}{\Omega} = -k_B\cdot\Omega\cdot\frac{1}{\Omega}\cdot(-\ln\Omega) = k_B\ln\Omega — exactly Boltzmann's formula recovered as the special case of equal probabilities.

Now use the actual Boltzmann distribution, Ps=eβEs/ZP_s = e^{-\beta E_s}/Z, so that lnPs=βEslnZ\ln P_s = -\beta E_s - \ln Z. Substitute directly:

S=kBsPs(βEslnZ)=kBβsPsEs+kBlnZsPsS = -k_B\sum_s P_s\left(-\beta E_s - \ln Z\right) = k_B\beta\sum_s P_s E_s + k_B\ln Z\sum_s P_s

The first sum is exactly E\langle E\rangle by definition, and the second sum is 11 since probabilities add up to one. With kBβ=1/Tk_B\beta = 1/T:

S=ET+kBlnZS = \frac{\langle E\rangle}{T} + k_B\ln Z

Rearranging, using U=EU=\langle E\rangle:

TS=U+kBTlnZUTS=kBTlnZTS = U + k_BT\ln Z \quad\Longrightarrow\quad U - TS = -k_BT\ln Z

The left side is exactly FF. So:

F=kBTlnZ\boxed{F = -k_BT\ln Z}

The Helmholtz free energy is nothing but the partition function, logarithmed and rescaled. Every thermodynamic quantity this track has built — average energy, entropy, and now free energy — is obtainable from ZZ alone by ordinary calculus: U=lnZ/βU=-\partial\ln Z/\partial\beta, S=(UF)/TS = (U-F)/T, and FF itself directly from ZZ with no further work.

Worked example

Using the two-level system from the previous topic, with energies 00 and ε\varepsilon and partition function Z=1+eβεZ=1+e^{-\beta\varepsilon}, find the Helmholtz free energy F(T)F(T), then extract the entropy S(T)S(T) from it. Check the T0T\to0 and TT\to\infty limits. (click to reveal the solution)

Free energy, directly from F=kBTlnZF=-k_BT\ln Z:

F(T)=kBTln(1+eε/kBT)F(T) = -k_BT\ln\left(1+e^{-\varepsilon/k_BT}\right)

Extracting entropy, using the general relation just derived, S=(UF)/TS = (U-F)/T, together with the average energy already found in the previous topic, U=E=ε/(eβε+1)U=\langle E\rangle = \varepsilon/(e^{\beta\varepsilon}+1):

S=UFT=1T[εeε/kBT+1+kBTln(1+eε/kBT)]S = \frac{U-F}{T} = \frac{1}{T}\left[\frac{\varepsilon}{e^{\varepsilon/k_BT}+1} + k_BT\ln\left(1+e^{-\varepsilon/k_BT}\right)\right] S=εT(eε/kBT+1)+kBln(1+eε/kBT)S = \frac{\varepsilon}{T\left(e^{\varepsilon/k_BT}+1\right)} + k_B\ln\left(1+e^{-\varepsilon/k_BT}\right)

Checking T0T\to0: as T0T\to0, ε/kBT\varepsilon/k_BT\to\infty, so eε/kBT0e^{-\varepsilon/k_BT}\to0. The logarithm term kBln(1)=0\to k_B\ln(1)=0. The first term: eε/kBTe^{\varepsilon/k_BT} blows up in the denominator far faster than the explicit TT in front shrinks it, so the whole first term 0\to0 as well (an exponential beats any power of TT). So S0S\to0 — exactly what the third law demands: the system is frozen into its unique, non-degenerate ground state, energy 00, with Ω=1\Omega=1 and therefore zero entropy.

Checking TT\to\infty: as TT\to\infty, ε/kBT0\varepsilon/k_BT\to0, so eε/kBT1e^{-\varepsilon/k_BT}\to1, and the logarithm term kBln(2)\to k_B\ln(2). The first term has eε/kBT1e^{\varepsilon/k_BT}\to1, so it becomes ε/(2T)0\varepsilon/(2T)\to0 as TT\to\infty. So:

SkBln2S \to k_B\ln 2

This is exactly the entropy of a two-state system with both states equally likely — Ω=2\Omega=2 accessible microstates, each with probability 12\frac12, giving S=kBlnΩ=kBln2S=k_B\ln\Omega=k_B\ln 2 straight from Boltzmann's original formula. At high temperature, the system stops caring about the energy difference ε\varepsilon between its two states entirely and populates both equally — the maximum possible entropy a single two-state system can have, recovered here as a limit of the exact free-energy calculation rather than assumed in advance.

Where this leads

Free energy is the tool that finally makes the second law usable in the lab, not just in a textbook proof about isolated universes — and the identity F=kBTlnZF=-k_BT\ln Z means every free-energy calculation is, underneath, just a partition-function calculation. One loose thread remains, and it's been sitting in plain sight since the very first topic in the quantum track of this curriculum: angular momentum and spin and quantum field theory both promised that spin determines whether a particle is a boson or a fermion, and both left the consequence of that distinction unexplored. It turns out bosons and fermions don't just differ in a quantum number — they populate energy levels according to two completely different statistical distributions, and the final topic in this track derives exactly what those distributions are, and exactly how the Boltzmann distribution built here turns out to be a special limiting case of both.