Entropy and Free Energy

When a partition is removed, the gases mix on their own and never return to their original state. And yet nobody has done anything. What decides this “direction in which things happen on their own” is the entropy, and the forms rewritten for convenient use in the laboratory are the Helmholtz free energy F and the Gibbs free energy G. Here we build the entropy of mixing from the partition function, settle Gibbs’ paradox, apply the very same argument to H2O, and calculate where ice, water, and water vapor trade places from literature values alone.

1. Entropy of an Ideal Gas — Write It with V/n, Not V

The partition function of an ideal gas consisting of N molecules of the same kind can be written, using the single-molecule partition function z = (V/Λ³)·zint, as

Z=zNN! (1)

The N! in the denominator is the key point. Molecules of the same kind are indistinguishable, so arrangements that differ only in how the labels are swapped must not be counted again. Using Stirling’s approximation ln N! ≈ N ln N − N to go from F = −kBT ln Z to S = −(∂F/∂T)V, we obtain

S=nR [lnVn +φ(T)+c] (2)

Here φ(T) is a function of temperature only (determined by the translational, rotational, and vibrational partition functions) and c is a constant that depends on the kind of gas. For a monatomic ideal gas, Eq. (2) becomes exactly the Sackur–Tetrode equation.

This will matter later What appears in the entropy is V/n (the volume per mole), and not V by itself. This comes from the N! in Eq. (1). In other words, the single line “molecules of the same kind are indistinguishable” is itself the answer to Gibbs’ paradox.

Differentiating Eq. (2) with respect to temperature gives dφ/d lnT = cV/R (cV is the molar heat capacity at constant volume). So the difference in φ is exactly equal to (1/R)∫cV dT/T, and the simulator also checks this relation numerically.

2. Removing the Partition — Each Gas Spreads as If the Other Were Not There

Gas A, nA mol, occupies a volume VA, and gas B, nB mol, occupies a volume VB. The partition is removed. The container is rigid and adiabatic, that is, an isolated system.

An ideal gas has no intermolecular forces. So from A’s point of view, B might as well not exist, and A simply spreads from VA to V = VA + VB. The same goes for B. Applying Eq. (2) to each and adding the results gives

ΔS= nARln VVA + nBRln VVB (3)

The argument of the ln is always greater than 1, so ΔS > 0. The process can go only in the direction of mixing.

In particular, if the gases start at the same temperature and the same pressure, VA/V = nA/n = xA, so Eq. (3) becomes the form familiar from textbooks.

ΔSmix= −nR( xAlnxA + xBlnxB ) (4)

This equation contains no trace of what kind of gas is involved. Whether it is H2 and CO2 or He and Ar, mixing 1 mol of each in a 1 : 1 ratio always gives 2R ln 2 = 11.53 J/K. Ideal gases have no interactions, so it does not matter who the partner is — obvious, you might say, but real mixtures are not so simple (a heat of mixing changes the result; this material does not treat that case).

Fig. 1: Entropy of mixing, Eq. (4). It is largest at 50 : 50 and becomes smaller the more the composition is skewed to either side, reaching 0 for a pure substance (xA = 0 or 1). This is because that composition has the largest “number of arrangements.” — Mixing is free, but this can also be read as saying that separating requires work of at least TΔS. That is why a factory that extracts nitrogen from air consumes electricity.

3. Gibbs’ Paradox

Now let us pose a nasty question: what if the gases on the left and right are the same?

If we use Eq. (3) as it stands, even identical gases give ΔS > 0. But if the gas on both sides is the same and at the same temperature and pressure, then removing the partition leaves the state completely unchanged. If we put the partition back, everything is exactly as it was, and the operation is reversible. The entropy cannot possibly have increased. This is Gibbs’ paradox.

The answer is already written in Eq. (2). What enters the entropy was V/n. For the same gas, the final state is “nA + nB mol in a volume V,” a single kind of state, so applying Eq. (2) straightforwardly gives

ΔS= nRlnVn −nARln VAnA −nBRln VBnB (5)

At the same temperature and pressure, VA/nA = VB/nB = V/n, so Eq. (5) is exactly 0. The paradox disappears. Conversely, if the same gas is at different pressures, Eq. (5) is positive — because in that case a truly irreversible expansion does take place.

“Color” is not a thermodynamic variable The simulator also shows a value obtained by painting the same gas blue and vermilion and counting them separately. That value is always positive, but no device can be built that extracts work using that color. For N2 and O2, on the other hand, a semipermeable membrane that lets only one of them through can actually extract work TΔS. Distinguishable = extractable. This is the real difference between the two cases. What happens in a case like isotopes, which “could be told apart if one tried, but for which we have no apparatus”? — That makes an interesting exercise problem.

4. When the Temperatures Differ

When the temperatures on the left and right differ, the container is rigid and adiabatic, so the total internal energy is conserved. This determines the final temperature Tf.

nAuA(Tf) + nBuB(Tf) = nAuA(TA) + nBuB(TB) (6)

In addition to Eq. (3), the entropy now includes the change in φ(T), that is, ∫CV dT/T. The hot side decreases and the cold side increases, but the total is always positive (because for the same amount of heat, δQ/T is larger when the heat is received on the low-temperature side).

5. Checking by Counting — Obtaining ΔS from the Positions of the Molecules

So far it has all been formulas. In the simulator, the same value is obtained without using those formulas.

Divide the container into the original left chamber (volume VA) and right chamber (VB), and for each species count the fraction f of its molecules found in each chamber. The deviation from a uniformly scattered state is

Sconfig= −∑iniR ∑jfij lnfij Vj/V (7)

At the start, with the partition in place, fAL = fBR = 1, so Eq. (7) is −nAR ln(V/VA) − nBR ln(V/VB), and when the gases are completely mixed, fAL = VA/V (and likewise for B), so it is 0. The difference is exactly Eq. (3). The same answer comes out just by counting molecules, without going through any formula — the same approach as “measuring the pressure from the impulse on the wall” in the ideal gas teaching material.

The price of having a finite number of molecules If the number of molecules N is finite, Eq. (7) comes out too low on average, for each species, by nR×(number of chambers − 1)/(2N) (n and N are the amount of substance and the number of molecules of that species). This is why the simulator uses only two chambers. For the same reason, the temperature of each species also fluctuates over a range of √(2/3N) = a few %. This is not a computational error but a fluctuation that really occurs in a system with a finite number of particles. — It is also a modest manifestation of the fact that the law of increasing entropy is not “absolute,” but only “overwhelmingly likely.”

6. The Direction of Spontaneous Change — Where Do F and G Come From?

The law of increasing entropy, stated correctly, refers to the entire universe.

ΔStotal= ΔSsystem+ ΔSsurroundings≥0 (8)

In the laboratory, however, it is a nuisance to count the entropy of the surroundings as well. We want to decide using quantities of the system alone. If we regard the surroundings as a large heat bath at temperature T, then when the system receives heat Q, the entropy of the surroundings changes by −Q/T, so

ΔSsystem− QT≥0

All that remains is to replace Q using the first law. If the volume is fixed, the work is zero and Q = ΔU; if the pressure is fixed, Q = ΔH. Substituting and multiplying by −T (the direction of the inequality reverses) gives

Constant volume, isothermal: ΔF=ΔU−TΔS≤0 Constant pressure, isothermal: ΔG=ΔH−TΔS≤0 (9)
Not a new law Both F = U − TS and G = H − TS are the law of increasing entropy itself, rewritten using only quantities of the system. The −TS term takes over, in the language of the system, the role of the “entropy change of the surroundings.” The reason G appears so often in chemistry and materials science is that experiments are usually carried out under atmospheric pressure.

Let us apply this to mixing. For ideal gases at the same temperature, mixing changes neither U nor H (there are no intermolecular forces), so

ΔF=ΔG= −TΔSmix<0

The process proceeds even though not a single joule of energy is gained — a typical example of an entropy-driven change. Conversely, water freezes even though ΔS < 0. That is because ΔH is sufficiently negative, so the change is enthalpy-driven. The next section deals with exactly that.

7. Chemical Potential and the Stability of Phases

For a pure substance, the Gibbs free energy per mole is itself the chemical potential.

μ=Gn , dμ=−sdT +vdp (10)

If two phases are in contact, molecules move toward the one with the lower μ. So the phase with the lowest μ (= G/n) is the one that appears. The phase transition point is where the μ values become equal.

From Eq. (10), the slope of μ(T) is −s. The larger the entropy of a phase, the more steeply its line falls.

sice< swater< svapor (41<70<189 J/(mol K); ice at 0 °C, water and vapor at 25 °C)
This alone explains phase transitions At low temperatures T is small, so the differences in −Ts have little effect, and ice, which has the lowest h, wins. As the temperature rises, the phases with steeper slopes come down and overtake the others in turn. The order ice → water → water vapor is determined solely by the differences in the slopes (−s) of the three lines — that is all there is to it.

8. Building the Free Energy of H2O

All that remains is to actually prepare h(T) and s(T), and then we can calculate. We simply integrate the heat capacity from a reference point.

h(T)= h(T0)+ ∫T0T cpdT , s(T)= s(T0)+ ∫T0T cpTdT (11)

The effect of pressure is the v dp term in Eq. (10). For ice and water the volume hardly changes, so v(p − p°) suffices, but for a gas v = RT/p, so

μgas(T,p) =μ∘(T) +RTln pp∘ +B(T)p (12)

The last term is the deviation of a real gas from ideal behavior (the second virial coefficient), and comes from ∫0p(v − RT/p) dp = B(T)·p. Note that the CODATA value of S°(gas) is that of an ideal gas at 1 bar, so what is multiplied is p, not (p − p°). It is a small correction of about −49 J/mol near the boiling point (1 atm), but if (p − p°) is mistakenly multiplied instead, the vapor pressure at 0 °C is off by 8 % (dropping the B term altogether gives an error of 0.05 % at 0 °C and 1.6 % at the boiling point).

Literature values used — there are no adjustable parameters Only the melting point is used as the reference point for ice, so it agrees with 273.15 K by definition
QuantityValueSource
ΔfH°(liquid, 298.15 K)−285.830 kJ/molCODATA
S°(liquid, 298.15 K)69.95 J/(mol·K)CODATA
ΔfH°(gas, 298.15 K)−241.826 kJ/molCODATA
S°(gas, 298.15 K)188.835 J/(mol·K)CODATA (ideal gas)
ΔHfus(273.15 K)6.010 kJ/molStandard tables
cp (ice)Quadratic (fitted over 100–273 K; within about 2 % over 250–273 K, and it comes out low, increasingly so at lower temperatures)Giauque & Stout 1936
cp (water)Quadratic (273–373 K, maximum error 0.15 %)Steam tables
cp (water vapor)Shomate equationNIST
Molar volumeIce 19.65 (0 °C) / water 18.07 (25 °C) cm³/molDensity tables
B(T) (water vapor)a + b/T4.3From the saturated vapor in the steam tables

Fig. 2: μ(T) of the three phases. The crossing points are the melting point and the boiling point. The slope is −s, so the phase with the larger entropy falls more steeply. When the pressure is lowered, because of the RT ln p term in Eq. (12), only the line of the gas drops, and the boiling point moves to the left. If it is lowered further and goes below the triple point (611.657 Pa), the line of water is no longer the lowest anywhere, and ice turns directly into water vapor — this is sublimation. The lines of ice and water hardly move (because the v of a condensed phase is small).

9. The Answers That Come Out

Nothing has been fitted. Only the melting point is used as the reference point for ice, but the boiling point, triple point, vapor pressure, and latent heats are all predictions of the model.

Model versus measurementThe smaller the entries in the “Difference” column, the better the construction of Eqs. (11) and (12) is working
QuantityModelMeasuredDifference
Boiling point (1 atm)373.117 K373.124 K−0.007 K
Triple point, temperature273.157 K273.16 K−0.003 K
Triple point, pressure611.65 Pa611.657 Pa−0.002 %
Vapor pressure (25 °C)3170.0 Pa3169.9 Pa+0.003 %
Vapor pressure (80 °C)47431 Pa47414 Pa+0.03 %
Sublimation pressure (−20 °C)103.29 Pa103.24 Pa+0.05 %
Heat of vaporization (100 °C)40.607 kJ/mol40.657 kJ/mol−0.12 %
Heat of sublimation (0 °C)51.062 kJ/mol51.06 kJ/mol+0.00 %
Boiling point (summit of Mt. Fuji, 63.8 kPa)87.5 °Cabout 87 °C—
Melting point (100 MPa)265.65 K264.21 K+1.44 K

10. The Phase Diagram Is a Collection of Crossing Points

Each time we fix one pressure, one pair of melting point and boiling point is determined. If we repeat this for every pressure and plot the points, we get the phase diagram. The slope of a boundary line is obtained by differentiating the condition that the μ of the two phases are equal.

dpdT =ΔsΔv =ΔhTΔv (13)

This is the Clausius–Clapeyron equation. For an ordinary substance the solid is denser, so Δv > 0, and the melting line slopes upward to the right. But ice floats on water — the volume decreases on melting (19.65 → 18.02 cm³/mol at 0 °C). Since Δv < 0,

dpdTfus =22.0−1.63×10−6 ≈−135 bar/K

The melting line leans to the left, and ice melts when it is put under pressure. Note, however, that the absolute value of the slope is large — it takes 135 bar (about 133 atm) to lower the melting point by 1 K.

Is “skates glide because ice melts under pressure” correct? Even if a 60 kg person stands on a blade with a contact area of 1 cm², the pressure is only about 60 atm. The melting point drops by only 0.4 K. That is nowhere near enough on a rink at −5 °C. What actually matters is frictional heat and the quasi-liquid layer that exists on the surface of ice to begin with. — When the model is built properly, it shows that the famous folk explanation is the one that is wrong. This is the benefit of “working out the numbers.”

11. What This Model Cannot Handle

Summary The mixing of gases when a partition is removed and the boiling of water at 100 °C have the same root: “things proceed in the direction in which the entropy of the universe increases.” Rewriting this as F for constant volume and G for constant pressure under isothermal conditions lets us decide by looking at the system alone, and we reach the point where the boiling point comes out to a precision of 0.01 K from literature values alone, with no adjustable parameters.

This is the explanation page for the Mochizuki Research Group’s thermodynamics materials (entropy of mixing / stability of phases).