Which way does the world run?
Leave a glass of iced water on a summer table and the ice melts. It never happens the other way: no glass of lukewarm water has ever been seen to freeze into ice cubes while warming the air around it. A drop of food colouring in still water slowly spreads until the whole glass is tinted, and never gathers itself back into a drop. Iron rusts, but rust never turns back into shiny iron on its own.
The previous lesson showed that energy is conserved, and that all of these could happen in reverse without breaking the first law. Melting ice even absorbs energy: it is endothermic, yet it happens by itself. So energy is not what decides the direction of change. Something else is, and its name is entropy.
This lesson builds entropy twice, from two directions that turn out to agree: by counting the ways a system can share out its energy, and by measuring heat and temperature. Then it combines entropy with enthalpy into the Gibbs energy, the single number chemists use to say whether a reaction can go, and at what temperature a reaction that cannot go becomes one that can.
Counting the ways
Picture energy as coming in small, identical packets (quanta), shared among the atoms of a solid. Each atom can hold any number of packets. A microstate is one particular way of sharing them: atom 1 has three, atom 2 has none, and so on. A macrostate is what we can actually observe, such as "solid A holds six packets and solid B holds four", which can be realised by many different microstates.
The single assumption behind everything that follows is that, left alone, a system wanders among all its microstates with equal likelihood. Then the macrostate we observe is simply the one with the most microstates, because it is overwhelmingly the most probable. Energy "flows from hot to cold" because there are vastly more ways to share it evenly than unevenly, and the food colouring spreads for the same reason: far more arrangements have the dye spread out than have it gathered in one spot.
Analogy, not a formal construction
Shuffle a new pack of cards, which comes sorted by suit and rank. There is exactly one sorted order and about orders in all, so after a good shuffle you will never see the sorted order again, though no law forbids it. Nothing pushes the cards towards disorder; there are simply overwhelmingly more mixed-up orders than sorted ones. Molecules shuffle themselves trillions of times a second.
You can watch this kind of spreading safely in the kitchen with an adult: put one drop of food colouring into a glass of still water without stirring, and another into a glass of warm water, and compare them every few minutes. The warm glass spreads faster (molecules move faster), but both end in the same place.
Entropy, two ways
Definition— spontaneous (thermodynamically favourable)
A process is spontaneous if, once started, it can proceed without continuous outside intervention. The word says nothing about speed: diamond turning into graphite is spontaneous at room temperature and pressure, but it is so slow that diamonds last for billions of years. Many chemists now prefer the phrase thermodynamically favourable to avoid the everyday meaning of "spontaneous".
Definition— statistical entropy
If a system in a given macrostate can be in any of microstates, all equally likely, its entropy is
where J/K is the Boltzmann constant (exact since the 2019 redefinition of the SI). Per mole, becomes the gas constant J/(mol K).
The logarithm is what makes entropy add up: two independent systems have microstates together, so their entropies add, . The formula is carved on Ludwig Boltzmann's tombstone in Vienna.
Definition— thermodynamic entropy
Rudolf Clausius defined entropy (and coined the word, in 1865) from heat. When a system absorbs a small amount of heat reversibly (slowly, through a sequence of equilibrium states) at temperature , its entropy changes by
Entropy is a state function, so for an irreversible process we compute along any reversible path between the same two states.
Theorem— The second law of thermodynamics
In any process, the total entropy of the system and its surroundings (the "universe") does not decrease:
with equality only for a reversible process. A process with does not happen.
Theorem— The third law of thermodynamics
The entropy of a perfect crystal of a pure substance approaches zero as the temperature approaches absolute zero.
The third law, which grew out of Walther Nernst's heat theorem of 1906, makes absolute entropies possible. A perfect crystal at 0 K has exactly one microstate, so . Measure from near 0 K upwards, add and for every phase change on the way, and you have at 298 K. That is why tables list absolute entropies , but only differences of enthalpy.
Counting microstates in Python
The simplest model of a solid, due to Einstein (1907), treats it as identical oscillators sharing energy quanta. The number of ways to do that is a classic counting problem (stars and bars, from combinatorics): arrange identical quanta and dividers in a row, so
Put two such solids, A and B, in contact, so that quanta can move between them, and ask how the energy ends up shared.
from math import comb, exp, lgamma
def omega(N, q):
"""Ways to share q identical energy quanta among N oscillators."""
return comb(q + N - 1, q)
# Two small solids in contact share q = 10 quanta: A has 6 oscillators, B has 4.
NA, NB, q = 6, 4, 10
total = omega(NA + NB, q)
print(f"{'qA':>3} {'Ω_A':>6} {'Ω_B':>6} {'Ω_A·Ω_B':>9} {'probability':>11}")
for qA in range(q + 1):
w = omega(NA, qA) * omega(NB, q - qA)
print(f"{qA:3d} {omega(NA, qA):6d} {omega(NB, q - qA):6d} {w:9d} {w / total:11.3f} " + "#" * round(60 * w / total))
print("total microstates:", total)
# Bigger solids: work with ln Ω (the numbers have thousands of digits).
def ln_omega(N, q):
return lgamma(q + N) - lgamma(q + 1) - lgamma(N)
NA, NB, q = 3000, 2000, 5000
lnw = [ln_omega(NA, k) + ln_omega(NB, q - k) for k in range(q + 1)]
peak = max(lnw)
w = [exp(x - peak) for x in lnw] # relative weights, largest = 1
best = lnw.index(peak)
near = sum(w[best - 100: best + 101]) / sum(w)
print(f"\nN_A = {NA}, N_B = {NB}, q = {q}: most probable q_A = {best}")
print(f"probability that q_A is within ±100 of it: {near:.4f}")
print(f"Ω(q_A = {best}) / Ω(q_A = {q // 2}) = e^{peak - lnw[q // 2]:.1f}")With only ten oscillators the most probable split, six quanta in A and four in B, has probability 0.175, and every other split is quite likely too: small systems fluctuate. With 5000 oscillators the energy almost certainly settles at 3000 quanta in A, in proportion to the number of oscillators, so that each oscillator holds one quantum on average in both solids. A split that looks only a little different, 2500 each, is times less likely.
Entropy from heat, and the second law at work
For the thermodynamic route we need only Clausius's definition. Heating at constant pressure gives , so when is constant. A phase change at its equilibrium temperature is reversible, with , so .
from math import log
# 1. Entropy from heat: one mole of water taken from ice at 0 °C to steam at 100 °C.
dH_fus, T_fus = 6010.0, 273.15 # J/mol, K
Cp_liquid = 75.3 # J/(mol K), roughly constant
dH_vap, T_vap = 40660.0, 373.15 # J/mol, K
steps = [("melt the ice", dH_fus / T_fus),
("heat the liquid", Cp_liquid * log(T_vap / T_fus)),
("boil the water", dH_vap / T_vap)]
for name, dS in steps:
print(f"{name:16s} ΔS = {dS:6.1f} J/(mol K)")
print(f"{'total':16s} ΔS = {sum(dS for _, dS in steps):6.1f} J/(mol K)")
# Trouton's rule: ΔvapS is about 85-88 J/(mol K) for many liquids, but not for water.
print(f"\nbenzene: ΔvapS = {30720 / 353.24:.1f} J/(mol K); water: {dH_vap / T_vap:.1f} J/(mol K)")
# 2. The second law decides: does water freeze at -10 °C, and at +10 °C?
for T in (263.15, 273.15, 283.15):
dS_sys = -dH_fus / T_fus # freezing (approximation: ignores the small Cp difference)
dS_surr = +dH_fus / T # the released heat warms surroundings at temperature T
total = dS_sys + dS_surr
verdict = "freezes" if total > 1e-9 else ("equilibrium" if abs(total) < 1e-9 else "does not freeze")
print(f"T = {T:6.2f} K: ΔS_sys = {dS_sys:6.2f}, ΔS_surr = {dS_surr:+6.2f}, ΔS_univ = {total:+5.2f} J/(mol K) -> {verdict}")Boiling contributes far more entropy than melting (109.0 against 22.0 J/(mol K)): a gas has vastly more room, and so more microstates, than a liquid. Many liquids have an entropy of vaporisation near 85 to 88 J/(mol K) (Trouton's rule; benzene gives 87.0), but water's is larger, 109.0, because hydrogen bonds hold liquid water in a more ordered arrangement than most liquids, so it gains more entropy when it escapes.
The second half explains the ice on the table. Freezing lowers the water's entropy by 22.0 J/(mol K), but the heat it releases raises the entropy of the surroundings by , which is larger when the surroundings are colder. At −10 °C the surroundings gain more than the water loses, so the water freezes; at +10 °C they gain less, so it does not, and ice melts instead. At exactly 0 °C the two balance: that is the melting point.
Example— The surroundings' share
At constant temperature and pressure, the heat released by the system, , flows into surroundings so large that their temperature hardly changes, and the transfer is effectively reversible for them. So . For ammonia synthesis at 298 K, kJ/mol warms the surroundings and gives them J/(mol K), while the system loses J/(mol K) (four moles of gas become two). The total is positive, so the reaction is favourable at 298 K. At 600 K the surroundings would gain only 153 J/(mol K), less than the system loses, and it would not be.
The Gibbs energy
Keeping track of the surroundings every time is tedious. Josiah Willard Gibbs, working at Yale in the 1870s, showed how to fold them into a property of the system alone. At constant temperature and pressure, . Multiply by :
Definition— Gibbs energy
The Gibbs energy (Gibbs free energy) of a system is . At constant temperature and pressure, a process is favourable if , at equilibrium if , and unfavourable if (the reverse process is then favourable). is also the largest amount of non-expansion work, such as electrical work, the process can deliver.
Because , the signs of and sort reactions into four kinds:
| Favourable | Example | ||
|---|---|---|---|
| negative | positive | at every temperature | oxidising glucose to CO₂ and water |
| positive | negative | at no temperature | making ozone from oxygen |
| negative | negative | at low temperature | freezing, ammonia synthesis |
| positive | positive | at high temperature | melting, boiling, decomposing limestone |
In the last two rows there is a crossover temperature where . If and change little with temperature (as Kirchhoff's law suggests over moderate ranges), we can estimate from 298 K tables.
# Standard data at 298.15 K, 1 bar (rounded; NIST Chemistry WebBook, NIST-JANAF).
# ΔfH° kJ/mol S° J/(mol K)
data = {
"N2(g)": (0.0, 191.6),
"H2(g)": (0.0, 130.7),
"O2(g)": (0.0, 205.2),
"NH3(g)": (-45.9, 192.8),
"CaCO3(s)": (-1206.9, 92.9),
"CaO(s)": (-635.1, 39.8),
"CO2(g)": (-393.5, 213.8),
"H2O(l)": (-285.8, 69.9),
"H2O(g)": (-241.8, 188.8),
"C(graphite)": (0.0, 5.7),
"C(diamond)": (1.9, 2.4),
}
def dH_dS(reaction):
dH = sum(nu * data[s][0] for s, nu in reaction.items()) # kJ/mol
dS = sum(nu * data[s][1] for s, nu in reaction.items()) / 1000 # kJ/(mol K)
return dH, dS
reactions = {
"N2 + 3 H2 -> 2 NH3": {"N2(g)": -1, "H2(g)": -3, "NH3(g)": 2},
"CaCO3 -> CaO + CO2": {"CaCO3(s)": -1, "CaO(s)": 1, "CO2(g)": 1},
"H2O(l) -> H2O(g)": {"H2O(l)": -1, "H2O(g)": 1},
"diamond -> graphite": {"C(diamond)": -1, "C(graphite)": 1},
}
print(f"{'reaction':22s} {'ΔH°':>7} {'ΔS°':>7} {'ΔG°(298)':>9} {'ΔG°(1000)':>10} ΔG° changes sign at")
for name, r in reactions.items():
dH, dS = dH_dS(r)
G = lambda T: dH - T * dS # assumes ΔH°, ΔS° independent of T
cross = f"{dH / dS:6.0f} K" if dH * dS > 0 else "never"
print(f"{name:22s} {dH:7.1f} {1000 * dS:7.1f} {G(298.15):9.1f} {G(1000):10.1f} {cross}")
# Coupling in the cell (standard biochemical values at pH 7, kJ/mol):
glucose_phosphorylation = +13.8 # glucose + phosphate -> glucose 6-phosphate + H2O
atp_hydrolysis = -30.5 # ATP + H2O -> ADP + phosphate
print(f"\ncoupled: glucose + ATP -> glucose 6-phosphate + ADP: ΔG°' = {glucose_phosphorylation + atp_hydrolysis:+.1f} kJ/mol")The estimates are good. Boiling water should become favourable at 373 K; from room-temperature data alone we get 370 K. Limestone (calcium carbonate) should start to give off CO₂ at 1 bar above about 1110 K, roughly 840 °C, which is why lime kilns run at around 900 °C and above. Ammonia synthesis is favourable only below about 463 K, yet industrial plants run near 700 K because at lower temperatures the reaction is far too slow: a tension resolved in Chemical equilibrium.
Metallurgists draw the same kind of plot for the formation of metal oxides, one line per metal, and call it an Ellingham diagram. Where the line for carbon monoxide's formation falls below a metal oxide's line, carbon can take the oxygen from that metal, which tells a steelmaker at a glance that iron ore can be smelted with coke above a certain temperature. You will meet such diagrams again in phase diagrams in Lumenary Materials.
Coupled reactions: how life pays its bills
Living cells build proteins, DNA and sugars, all of which have higher Gibbs energy than the small molecules they come from. They do it by coupling: pairing an unfavourable reaction with a strongly favourable one through a shared intermediate, so that the sum has . The most common partner is the hydrolysis of adenosine triphosphate, ATP, to adenosine diphosphate, ADP, and phosphate.
Example— Phosphorylating glucose
The first step in using glucose is to attach a phosphate group to it. On its own, glucose + phosphate → glucose 6-phosphate + water has a standard biochemical Gibbs energy kJ/mol (the prime means standard conditions at pH 7), so it is unfavourable. The enzyme hexokinase instead transfers the phosphate directly from ATP: glucose + ATP → glucose 6-phosphate + ADP. Because is a state function, its is the sum of the two steps, kJ/mol, as the last line of the block above shows. The enzyme matters because it couples the two steps physically: it never lets ATP hydrolyse uselessly without the glucose present.
Inside a real cell, ATP is kept far from equilibrium, with much more ATP than ADP, which makes its hydrolysis even more favourable, roughly −50 kJ/mol rather than the standard −30.5. How concentrations change is the subject of the next lesson, and the cell's whole energy economy, in which a person turns over roughly their own body mass of ATP every day, is in Biochemistry.
Absolute entropies, residual entropy and modern practice
Absolute entropies are measured by low-temperature calorimetry: cool a sample towards absolute zero, measure its heat capacity as it warms, and integrate . William Giauque, who won the 1949 Nobel Prize in Chemistry for such work, noticed that for a few substances the calorimetric entropy came out smaller than the entropy computed from spectroscopy. The missing entropy is residual entropy: the crystal never reached a single microstate as it cooled. In solid carbon monoxide, the nearly symmetric molecules can freeze in pointing either way, CO or OC, giving up to J/(mol K). In ice, each oxygen has two near and two far hydrogens in many possible arrangements; Linus Pauling's 1935 counting argument gave J/(mol K), very close to the measured value. The third law is not violated; those crystals are not perfect.
Today, standard entropies of gases are usually computed from molecular data (masses, bond lengths, vibration frequencies) by statistical thermodynamics, which turns the counting of this lesson into a precise tool (Statistical thermodynamics). In drug discovery, computers estimate how strongly a candidate molecule binds to a protein by computing a free-energy difference with molecular simulation, gradually "transforming" one molecule into another in the computer. Open-source projects such as Open Free Energy, built on toolkits like OpenMM, make such calculations widely available, and as of 2026 they routinely rank candidate molecules to within about 4 kJ/mol (1 kcal/mol) for favourable cases. Engineers apply the same second law to engines and refrigerators in the second law and entropy in Lumenary ME.
Common misconceptions
Misconception
"Entropy is disorder." It is a useful first picture, but it misleads. Entropy measures the number of microstates, which includes how energy is spread among molecular motions, not only how messy the arrangement looks. Some spontaneous processes produce visible order: crystals grow from solution, and oil and water separate into layers, because the entropy gained elsewhere (in the solvent, or in the surroundings) more than pays for it.
Misconception
"Living things violate the second law by making order." The second law limits the entropy of the system plus its surroundings. A cell lowers its own entropy while releasing heat and small molecules (CO₂, water) that raise its surroundings' entropy by more. A plant runs on sunlight, and the Earth sends back many more, lower-energy infrared photons than the visible photons it receives.
Misconception
"A negative ΔG means the reaction will happen quickly." Thermodynamics says where a reaction can go, not how fast. Petrol and air, sugar and oxygen, and paper and air all have hugely negative and sit unreacted for years. The rate depends on the energy barrier along the way (Chemical kinetics).
Misconception
"If ΔG° is positive, the reaction does not happen at all." refers to every substance in its standard state. Water's for vaporisation at 25 °C is +8.5 kJ/mol, meaning liquid water will not produce vapour at 1 bar; yet puddles evaporate, because the vapour in air is far below 1 bar. The next lesson shows how sets an equilibrium, here the vapour pressure of water.
Exercises
Data you may need (298.15 K, 1 bar): in J/(mol K) of H₂O(l) 69.9, H₂O(g) 188.8; of H₂O(l) −285.8 and H₂O(g) −241.8 kJ/mol.
1. Entropy and free energy
Warm-upHumanIn which of these processes does the entropy of the system (the substances named) increase? Select all that apply.
2. Entropy and free energy
Warm-upHumanThree identical energy quanta are shared among three oscillators (an Einstein solid with , ). How many microstates are there?
3. Entropy and free energy
CoreHumanUsing only the data at 298.15 K given above the exercises, and assuming and do not change with temperature, estimate the temperature (in kelvin, to the nearest kelvin) at which for .
4. Entropy and free energy
CoreHumanA reaction has kJ/mol and J/(mol K), both roughly independent of temperature. Which statement is correct?
5. Entropy and free energy
CoreHumanA biosynthetic step has kJ/mol. If each ATP hydrolysed to ADP and phosphate contributes kJ/mol, what is the smallest whole number of ATP molecules that must be coupled to the step to make the overall negative?
6. Entropy and free energy
CoreHumanWhich of these would still have an entropy greater than zero as the temperature approaches 0 K? Select all that apply.
7. Entropy and free energy
CoreComputationalTwo Einstein solids with NA and NB oscillators share q quanta. Write most_probable_split(NA, NB, q), which returns the number of quanta qA in solid A for which the total number of microstates is largest, where . If several values of qA tie, return the smallest.
(The starter guesses an even split, which is right only when the solids are the same size.)
8. Entropy and free energy
StretchComputationalWrite favourable_range(dH, dS), where dH is in kJ/mol and dS is in J/(mol K), both assumed independent of temperature. Return the range of temperatures (in K) over which , as a tuple (low, high), using 0.0 for "from absolute zero" and float('inf') for "without upper limit". Return None if the reaction is favourable at no positive temperature.
For example, favourable_range(-91.8, -198.1) should return about (0.0, 463.4).
Further reading and resources
- NIST Chemistry WebBook · National Institute of Standards and TechnologyStandard entropies and heat capacities, with their sources.
- NIST-JANAF Thermochemical Tables · National Institute of Standards and TechnologyEntropies and Gibbs energies of formation over wide temperature ranges.
- The Structure and Entropy of Ice and of Other Crystals with Some Randomness of Atomic Arrangement · Linus Pauling · 1935The counting argument for the residual entropy of ice.
- MIT OpenCourseWare 5.60: Thermodynamics and Kinetics · Massachusetts Institute of Technology
- Open Free EnergyAn open-source project for computing binding free energies, used in drug discovery.
- OpenMMOpen-source molecular simulation toolkit on which many free-energy methods are built.