FIG.20 · STAT MECHANICS

FREE ENERGIES AND MAXWELL'S DEMON

The demon was never free: erasing a memory costs entropy.

§ 01

A demon at the door

In 1867, in a letter to his friend Peter Guthrie Tait, imagined a creature that would haunt physics for a century. Picture a gas-filled box divided in two by a wall with a tiny trapdoor. A "very observant and neat-fingered being" sits at the door. When a fast molecule approaches from the right, it opens the door and lets it through to the left; when a slow one approaches from the left, it lets it through to the right. Doing no work — the door is frictionless, the molecules do the moving — the being sorts fast from slow, hot from cold. One side warms, the other cools. A temperature difference appears from nothing, and the second law of thermodynamics, which forbids exactly this, seems to fail.

This is Maxwell's demon (the name is William Thomson's; Maxwell only ever called it "a finite being"). Maxwell's own point was modest — he meant to show that the second law is statistical, true for bulk matter but not enforced molecule by molecule. But the demon refused to die. For sixty years it stood as an unanswered challenge: if information about individual molecules could be had for free, the second law was in trouble. The resolution, when it came, did not patch a leak in the box. It revealed that information itself has a thermodynamic cost — and to see why, we first need the bookkeeping of free energy.

§ 02

Four potentials, one shape

Energy alone does not tell you which way a process will go. What governs spontaneity is free energy — the portion of a system's energy actually available to do work once the unavoidable entropy tax is paid. There are four such bookkeeping quantities, and they are not four separate ideas but one idea wearing four hats, each cut for a different pair of held-fixed variables:

H=U+PV,F=UTS,G=UTS+PVH = U + PV, \qquad F = U - TS, \qquad G = U - TS + PV

Internal energy UU is the raw total. Enthalpy HH adds the work PVPV needed to make room for the system — the right ledger when pressure is fixed. The Helmholtz free energy FF subtracts the heat TSTS the environment supplies for free — the right ledger at fixed temperature and volume. The Gibbs free energy GG does both, and rules the world of constant temperature and pressure where chemistry happens.

FIG.20a — the four potentials, one square. U sits at the origin; each Legendre transform trades an awkward natural variable for its easy conjugate — add PV to swap volume for pressure (U→H, F→G), subtract TS to swap entropy for temperature (U→F, H→G). Click any corner to read its definition, its natural variables, and when it is the right potential to minimize. The square closes on G.
loading simulation
§ 03

Gibbs free energy and the direction of chemistry

The Gibbs free energy earns its central place because almost everything — a reaction in a beaker, water freezing, a protein folding — happens at the fixed temperature and pressure of the open air. For such a process, the second law reduces to a single inequality:

ΔG=ΔHTΔS<0(spontaneous at fixed T,P)\Delta G = \Delta H - T\,\Delta S < 0 \quad \text{(spontaneous at fixed } T, P)

Read it as a contest. ΔH\Delta H is the heat released or absorbed; ΔS\Delta S is the change in disorder; TT is the referee that decides how much the entropy term matters. A reaction proceeds if it lowers GG — either by releasing energy (ΔH<0\Delta H < 0) or by increasing entropy (ΔS>0\Delta S > 0), or both. When the two compete, temperature breaks the tie: ice melts above 00\,^\circC because there the entropy gain TΔST\Delta S finally outweighs the energy cost ΔH\Delta H of breaking the crystal. The crossover temperature is exactly T=ΔH/ΔST = \Delta H / \Delta S.

This is the quantity a chemist actually tabulates. A negative ΔG\Delta G means "go"; the magnitude sets how much work the reaction could in principle deliver. Free energy is the currency in which thermodynamics pays out.

§ 04

The operation behind the four: Legendre transforms

Why exactly these four combinations, and not some other? The answer is a single mathematical operation, the Legendre transform. It is the same trick that turns the Lagrangian into the Hamiltonian in mechanics: a controlled way to swap a variable for its conjugate slope without losing any information.

The fundamental relation for internal energy is dU=TdSPdVdU = T\,dS - P\,dV, which says UU is most naturally a function of entropy SS and volume VV. But SS is hard to control in a lab — you cannot dial an entropy. Temperature TT, its conjugate, you can. The Legendre transform F=UTSF = U - TS performs the swap: differentiating gives dF=SdTPdVdF = -S\,dT - P\,dV, so FF is now a function of the controllable TT and VV. Add PVPV instead and you swap volume for pressure (UHU \to H); do both and you reach G(T,P)G(T, P). The four potentials are simply UU and its three Legendre transforms — one geometric operation, applied to whichever variables your apparatus holds fixed.

§ 05

Szilard's engine — information enters the ledger

In 1929, the Hungarian physicist stripped Maxwell's demon to its bones. Forget thousands of molecules; use just one. A single molecule rattles around a box at temperature TT. The demon measures which half it is in, then slides a partition into the middle. Now it knows the gas is on, say, the left — so it lets the molecule push the partition rightward as a piston, an isothermal expansion from half the box to the whole box. The work delivered is exactly

W=kBTln22.9×1021 J at 300KW = k_B T \ln 2 \approx 2.9 \times 10^{-21}\ \text{J at }300\,\text{K}

a tidy packet of energy drawn from the thermal bath, one molecule at a time. Repeat the cycle and you appear to convert heat into work indefinitely — a perpetual-motion machine of the second kind. Szilard's decisive move was to notice where the entropy went. The engine works only because the demon measured which side the molecule was on, and that one bit of information — left or right — is the loose end the whole paradox hangs on.

FIG.20b — the Szilard engine on a loop. MEASURE: the demon sees the molecule's side and drops a partition. EXTRACT: the partition becomes a piston the molecule pushes out, yielding W = k_BT ln 2. ERASE: resetting the demon's one-bit memory dissipates k_BT ln 2 — Landauer's price. The ledger keeps score; the net work is zero, and the second law walks away intact.
loading simulation
§ 06

Landauer's principle closes the loop

For decades the cost was wrongly pinned on the act of measurement. The true answer came in 1961 from at IBM, who asked a sharper question: which logical operations are physically irreversible? His answer — Landauer's principle — is that computation can in principle be done for free, with one exception. Erasing a bit is irreversible: it maps two distinct states (0 and 1) onto one, and that loss of one bit of information must dump at least

QerasekBTln2Q_{\text{erase}} \ge k_B T \ln 2

of heat into the environment. The merging of two possibilities into one is the merging of two phase-space cells into one, and entropy must rise somewhere to compensate.

In 1982 drove the point home for the demon. A demon running many cycles must store each measurement somewhere; its memory is finite; to keep going it must eventually erase old records — and that erasure pays back, exactly, the kBTln2k_B T \ln 2 the engine extracted. The demon's memory is the cold reservoir in disguise. The Landauer's principle turns the demon from a threat into a bookkeeping lesson: the work you gain by knowing is repaid in full when you forget.

§ 07

Forward — the thermodynamics of computation

Landauer's resolution did more than save the second law; it founded a field. If erasing a bit costs kBTln2k_B T \ln 2, then every irreversible logic gate in every processor pays a thermodynamic toll, and the kBTln2k_B T \ln 2 floor — about 3×10213 \times 10^{-21} joules at room temperature — is the ultimate limit on the energy efficiency of computing. Real transistors today dissipate millions of times more, but the limit is real and has been measured directly in single-particle experiments since 2012. It also opened the door to reversible computing, which sidesteps the cost by never erasing, and underlies the energetics of quantum information.

The demon also closes a loop back through this module. Its appetite was for the partition function's free energy F=kBTlnZF = -k_B T \ln Z; its defeat rests on the same entropy accounting that governs the arrow of time. And the kBTln2k_B T \ln 2 packets it traded are themselves thermal fluctuations — the irreducible jitter we turn to next, in fluctuations and dissipation, where that randomness stops being a nuisance and becomes a signal.