Why heat flows from hot to cold, why a gas spreads out and never gathers back by itself, and how entropy, S=klnW, gives time its direction.
Twenty gas molecules start in the left half of a box. When the wall is removed they spread through the whole box and practically never crowd back: the number W of possible arrangements, and with it the entropy S = k·ln W, rises and stays high.
On its own, heat always flows from hot to cold, until both are at the same temperature.
Left alone, things spread out and mix, but they never un-mix by themselves.
Entropy measures how spread out things are; for a system left completely alone it never goes down.
Spread-out arrangements win simply because there are vastly more of them than tidy ones, like five heads in ten coin tosses.
No engine can turn all of its heat into work: some energy always spreads out as waste heat.
Some things happen by themselves in only one direction.
Step 1: heat goes downhill. Leave a hot mug of cocoa on the table and it cools until it matches the room; the room never pushes heat back into the mug to make it hotter. Energy passes from the faster-jiggling molecules of the hot object to the slower ones of the cold object until both jiggle the same on average.
Step 2: things spread out. Spray perfume in one corner and soon the whole room smells of it. The molecules wander about at random, and they never gather back into the bottle by themselves.
Step 3: it is a matter of counting. Toss ten coins. Getting all ten heads can happen in only one way, but getting five heads and five tails can happen in 252 different ways. Molecules are like trillions of coins: tidy arrangements (all in one corner) are rare, spread-out ones are overwhelmingly common, so random motion lands in them and stays there.
Step 4: entropy. Physicists measure how spread out energy and matter are with a quantity called entropy. For a system left completely alone, entropy can only grow or stay the same. This is the second law of thermodynamics, and it gives time a direction: a film of a mug warming up by itself looks wrong.
The same law is why no engine can turn all its heat into work, and why a fridge needs a motor.
Check yourself: you drop an ice cube into warm lemonade. Which way does heat flow? Could it ever reverse by itself? (From the lemonade into the ice; no.)
In the animation, a wall keeps 20 molecules in the left half of a box. When it is removed they spread out until the bars show about 10 on each side, and they practically never all crowd back to the left.
Intermediate
Key ideas
Clausius: heat never flows by itself from cold to hot. Kelvin–Planck: no cycle turns all the heat of one reservoir into work.
Heat Q received reversibly at temperature T changes entropy by ΔS=Q/T; in an isolated system ΔStotal≥0.
S=klnW: with 10 of 20 molecules on each side W=184756, with all on one side W=1.
Heat pumps and fridges move heat from cold to hot only with work: COP=Qh/Win≤Th/(Th−Tc).
Two statements of one law
Energy conservation alone would let a hot mug grow hotter by drawing heat from the cooler room. That never happens. The second law of thermodynamics picks out which energy-conserving processes really occur, in two classic statements:
Clausius: heat never flows by itself from a colder body to a hotter one.
Kelvin–Planck: no engine working in a cycle can take heat from a single reservoir and turn all of it into work.
The two are equivalent. If heat could leak by itself from cold to hot, an engine's waste heat Qc could leak straight back to the hot reservoir, and heat from that reservoir alone would have become work; a perfect engine driving a refrigerator would break Clausius in turn. A refrigerator does move heat from cold to hot, but not by itself: a motor supplies work.
Entropy: heat divided by temperature
Entropy turns the law into arithmetic. When a body at a constant absolute temperature T receives heat Q reversibly (slowly, without friction or temperature jumps), its entropy S changes by ΔS=TQ(reversible heat, T in K) in joules per kelvin (J/K). Heat leaving a body is a negative Q. A reservoir is a body so large that its temperature does not change. The entropy of a reservoir changes by Q/T however the heat arrives.
The second law then says that in an isolated system, which exchanges neither heat nor work with its surroundings, the total entropy never decreases: ΔStotal≥0(isolated system) The equal sign holds only for idealised reversible processes. Friction, mixing and heat crossing a temperature gap all give ΔStotal>0, so they cannot run backwards by themselves.
When heat Q passes from a body at Th to one at Tc, the hot body loses Q/Th and the cold one gains Q/Tc: ΔS=TcQ−ThQ>0(heat Q from hot to cold) This is positive exactly when Tc<Th, because a joule carries more entropy at a lower temperature: the Clausius statement in symbols.
Entropy as a count of arrangements
Why must the total grow? The answer is counting. A macrostate is what you see from outside, such as how many molecules are in each half of a box; a microstate is the full microscopic detail, such as which molecules are in which half. The number W of microstates that look like one macrostate is its multiplicity, and S=klnW where k=1.38×10−23J/K is the Boltzmann constant.
With nL of the N molecules on the left and nR=N−nL on the right, the number of ways to choose which molecules are on the left is W=nL!nR!N! Random motion visits every microstate equally often, so the gas spends nearly all its time near the macrostate with the largest W.
Worked example: the gas in the animation
The box holds N=20 molecules, all on the left behind a wall: one way only, so W=1 and S=kln1=0. This S counts only the left-or-right part of the entropy; the rest does not change, because the temperature does not.
At t=1.8s the wall disappears. One molecule across gives W=20; five across give W=20!/(15!5!)=15504 and S=9.6k; ten on each side give W=10!10!20!=184756,S=kln184756≈12.1k These are the values on the W and S readouts when the blue and green bars show 10 and 10. Once the gas is mixed, nL drifts between 7 and 12, so S stays between 11.3 k and 12.1 k, never near zero.
Nothing pushes the gas: the gold v arrows show three molecules flying straight and bouncing off the walls. Each molecule is equally likely to be in either half, so all 220=1048576 assignments are equally likely, and all-on-the-left has probability (1/2)20≈10−6, the middle line of the table. For 2 molecules it would be 1 in 4; for 1023, zero for all practical purposes. Even ten and ten occurs only 184756/1048576≈18% of the time, so the bars keep jiggling.
Worked example: a hotplate heating water
A hotplate at 600 K passes 1200 J of heat to a large pan of water at 300 K. Both keep their temperatures, so ΔSplate=−6001200=−2J/K,ΔSwater=+3001200=+4J/K The total rises by 2 J/K. The reverse transfer would give −2J/K and is forbidden: the Clausius statement in numbers.
The 2 J/K measures lost work. An ideal engine between the same temperatures could have turned 1−300/600=50% of the heat, 600 J, into work and rejected the other 600 J to the water, which would then gain only 600/300=2J/K, exactly what the hotplate lost. Leaking directly throws away TcΔStotal=300⋅2=600J of possible work. Each joule per kelvin created beside surroundings at T wastes T joules of work.
Heat pumps and refrigerators
A heat pump uses work Win to take heat Qc from a cold place and deliver Qh=Qc+Win to a warm one: a narrow heat arrow in from the cold side, a work arrow from the motor, a broad heat arrow out into the house. The warm side must gain at least the entropy the cold side loses, Qh/Th≥Qc/Tc, which caps the coefficient of performance: COP=WinQh≤Th−TcTh(heat pump) COP=WinQc≤Th−TcTc(refrigerator)
For a house at 20 °C and outdoor air at 0 °C, Th=293.15K and Th−Tc=20K: at most 293.15/20≈14.7 joules of heat per joule of electricity. A refrigerator across the same gap could remove at most 273.15/20≈13.7 joules per joule. Real machines reach 3 to 4, which is still three to four times the heat an electric heater gives. On a −20 °C day the limit falls to 293.15/40≈7.3.
Common mistakes
Entropy can fall locally. A kilogram of water freezing at 0 °C loses 334000/273.15≈1223J/K, so the freezer must release at least 293.15⋅1223≈358kJ into the kitchen at 20 °C, at least 24 kJ of it from its motor.
Temperatures must be in kelvins: dividing 1200 J by 27 instead of 300 for water at 27 °C gives 44 J/K instead of 4 J/K.
The body that gives heat loses entropy: in the hotplate example the total is −2+4=+2J/K, not 6 J/K.
A COP above 1 creates no energy: the ideal heat pump delivers 14.7 J per joule of work by moving 13.7 J that were already outdoors.
Entropy is not visible untidiness: shuffling a sorted 52-card deck adds at most kln52!≈2×10−21J/K, while warming the 100 g deck by 1 K adds about 0.4 J/K.
Where you meet it
Power stations are heat engines bound by the second law: coal and nuclear plants turn only 33–45 % of their heat into electricity. Fridges, air conditioners and heat pumps run the same cycle backwards. The Earth absorbs sunlight emitted at about 5800 K and returns the same energy to space as infrared at about 255 K, exporting some 20 times more entropy than it receives; that outflow drives weather and life.
The Carnot efficiency comes from First Law of Thermodynamics and Heat Engines, and the speed distribution of Kinetic Theory of Gases is the one with the greatest entropy at a given energy. Counting ways to share energy with S=klnW gave the first quantum formula, in Blackbody Radiation and the Quantum.
Advanced
Key ideas
dS=δQrev/T; the Clausius inequality ∮δQ/T≤0 makes S a state function with ΔS≥0 when isolated.
Free expansion: Q=0, yet ΔS=nRln(V2/V1)=Nkln2, evaluated along a reversible isotherm.
S=klnW: doubling the room multiplies W by 2N; the peak of W(nL) has relative width about 1/N.
A ratchet and pawl at one temperature cannot turn thermal jiggling into work; it runs only as a heat engine between two temperatures.
The laws are time-reversible; irreversibility comes from a low-entropy start (the early universe) and the huge count of high-W states.
From Carnot's postulate to entropy
This section builds entropy from a single experimental fact, so that S is not merely defined but shown to exist. The fact is Carnot's postulate in its modern form: no cycle can take heat at one temperature and turn it into work with no other change. The lesson First Law of Thermodynamics and Heat Engines drew two consequences from it. All reversible engines working between the same two temperatures have the same efficiency, and that common efficiency defines the absolute temperature T. A reversible engine that takes heat Qh at Th and rejects Qc at Tc therefore obeys ThQh=TcQc Read this as a conservation rule: a reversible engine passes the quantity Q/T from the hot reservoir to the cold one unchanged. Entropy is that quantity, made into a property of the working substance.
Figure 1. A reversible cycle drawn as a loop on the p–V diagram, cut into thin strips by dashed adiabats. The purple strip is a small Carnot cycle: it takes in δQ1 at T1 and gives out δQ2 at T2, with δQ1/T1=δQ2/T2=dS. Not to scale.Legend
p
Pressure of the gas.
Pa
V
Volume of the gas.
m3
T1
Temperature at the hot end of the strip.
K
T2
Temperature at the cold end of the strip.
K
δQ1
Heat taken in along the hot end, at T1.
J
δQ2
Heat given out along the cold end, at T2.
J
dS
Step in entropy between the two adiabats that bound the strip: δQ1/T1, which equals δQ2/T2.
J/K
Figure 1 extends the rule from a two-temperature engine to any reversible cycle, drawn as an arbitrary closed loop on the p–V diagram. The trick is to slice the loop with adiabats, the curves along which a gas changes state without exchanging heat; the dashed curves are a few of a dense family. Look at the purple strip between two neighbouring adiabats, drawn far wider than it really needs to be. Its long sides are adiabats, so no heat crosses them. Its short ends are tiny pieces of the loop: the hot end at the upper left, at temperature T1, and the cold end at the lower right, at T2. Each end is so short that its temperature hardly changes along it, so it acts as an isotherm.
Two adiabats and two isotherms make a Carnot cycle, so the strip is a small Carnot engine: it takes in δQ1 at T1, gives out δQ2 at T2, and by the rule above T1δQ1=T2δQ2=dS This common value, marked dS inside the strip, depends only on which two adiabats bound the strip, not on where the loop happens to cross them.
Now add up all the strips. Together they trace the loop: each inner adiabat is run once in each direction by the two strips that share it, so those legs cancel, and the ends join up into the outline of the loop. Counting heat as positive when it enters the gas, every strip contributes δQ1/T1−δQ2/T2=0, so for the whole loop ∮TδQrev=0
A quantity whose integral round every closed path vanishes has the same integral along every path between two given states. That integral is therefore the change of a function of state, the entropy S, with dS=TδQrev and the adiabats are the curves of constant S. Heat itself is not a function of state, because the heat a gas absorbs between two states depends on the path. Dividing by T repairs this: 1/T is the integrating factor that turns δQrev into the exact differential dS.
What changes when a process is irreversible? An engine with friction, or with heat leaking across a finite temperature difference, delivers less work than a reversible engine from the same Qh. By energy conservation it then rejects more heat, so Qh/Th−Qc/Tc<0. For a general cycle, imagine every heat δQ the system receives being supplied, at the temperature T where it enters, by a small reversible engine fed from one large reservoir at T0. That engine draws T0δQ/T from the reservoir. Over a cycle everything returns to its starting state, so the net heat T0∮δQ/T drawn from that single reservoir has all become work. Carnot's postulate forbids this to be positive, which gives the Clausius inequality ∮TδQ≤0 Here T is the temperature of the reservoir that supplies each δQ, since a system out of equilibrium need not have one temperature of its own; equality holds only for a reversible cycle.
Apply the inequality to a cycle that goes from state a to state b by any process and comes back reversibly. The reversible return contributes −(Sb−Sa), so ΔS=Sb−Sa≥∫abTδQ An isolated system takes in no heat at all, so for it ΔS≥0: its entropy can grow or stay the same, never fall. That is the second law in its most general form.
The Carnot limits as an entropy balance
Every limit on engines, heat pumps and refrigerators follows from one balance. Over a full cycle the working substance returns to its starting state, so its own entropy change is zero. Only the reservoirs' entropy changes, and the second law requires their total change to be zero or positive.
Figure 2. Entropy bookkeeping for a heat engine on a T–S diagram, where heats are areas. The cold reservoir gains more entropy, Qc/Tc, than the hot one loses, Qh/Th; the purple strip, of area TcΔS, is the work lost. Drawn for Th=2Tc and half the Carnot work.Legend
S
Entropy, along the horizontal axis.
J/K
T
Absolute temperature, along the vertical axis.
K
Th
Temperature of the hot reservoir.
K
Tc
Temperature of the cold reservoir.
K
Qh
Heat taken from the hot reservoir: the area of the tall rectangle, of height Th.
J
Qc
Heat given to the cold reservoir: the area of the lower rectangle, blue and purple together.
J
Qh/Th
Entropy lost by the hot reservoir: the width of the tall rectangle.
J/K
Qc/Tc
Entropy gained by the cold reservoir: the width of the lower rectangle.
J/K
ΔS
Entropy created in total, ΔStotal=Qc/Tc−Qh/Th: the width of the purple strip that sticks out.
J/K
TcΔS
Area of the purple strip: the extra heat rejected, which is the work lost when the surroundings are at Tc.
J
Figure 2 keeps this account on a T–S diagram, temperature up and entropy across. The point of this choice is that heat exchanged at a fixed temperature T moves an entropy Q/T, so it can be drawn as a rectangle of height T and width Q/T, whose area is Q: heats become areas. The engine takes Qh from the hot reservoir at Th, rejects Qc to the cold reservoir at Tc, and delivers the work Wout=Qh−Qc.
Now read the figure. The tall rectangle has height Th and width Qh/Th, the entropy the hot reservoir loses, so its area is Qh. The lower rectangle, blue and purple together, has height Tc and width Qc/Tc, the entropy the cold reservoir gains, so its area is Qc. The total entropy change is ΔStotal=TcQc−ThQh≥0 so the lower rectangle must be at least as wide as the tall one. A reversible engine makes the two exactly as wide, up to the dashed line. The real engine drawn overshoots: the purple strip that sticks out has width ΔS, the entropy created, and area TcΔS, the heat dumped into the cold reservoir beyond what a reversible engine would dump.
The work is what is left of Qh after Qc has been paid out. For a reversible engine it is the part of the tall rectangle above the level Tc, the fraction 1−Tc/Th of Qh, and no engine can do better. The engine drawn, with Th=2Tc, also loses the purple area: its surplus width is half of Qh/Th, so the lost area TcΔS is a quarter of Qh, and it delivers half the Carnot work. In symbols, Qc/Tc≥Qh/Th means Qc≥QhTc/Th, hence η=QhWout=1−QhQc≤1−ThTc
Run the cycle backwards and the work Win pumps the heat Qc out of the cold side and delivers Qh=Qc+Win to the hot side. Now the hot side gains entropy and the cold side loses it, and the same balance, Qh/Th≥Qc/Tc, caps the coefficients of performance of a heat pump and of a refrigerator: COPheat=WinQh≤Th−TcTh COPcool=WinQc≤Th−TcTc
Irreversibility therefore has a price in work. In a device that keeps running, the entropy created cannot pile up inside it; it must leave as heat into the surroundings at T0, and that heat, T0ΔStotal, is energy a reversible process would have delivered as work: Wlost=T0ΔStotal In Figure 2 the cold reservoir plays the surroundings, T0=Tc, and the lost work is exactly the purple area. Engineers use this rule to find the waste in a power station: combustion, and the large drop in temperature from the flame to the boiler water, create most of the entropy, so they cost most of the work.
Free expansion: entropy without heat
Entropy can grow with no heat at all, and this case is the classic trap. The gas in the animation expands into a vacuum. It pushes against nothing, so it does no work, and no heat crosses the walls, so ΔU=0. The energy of an ideal gas depends only on its temperature, so the temperature stays the same. Yet nobody ever sees the gas gather itself back into one half: the process is irreversible, and S must rise. Writing ΔS=∫δQ/T=0 is the mistake, because that integral gives ΔS only along a reversible path, and a free expansion is not one.
Figure 3. The reversible isotherm joining the same end states 1 and 2 as the free expansion. The strip of height p and width dV has area pdV=δQ and adds dS=pdV/T; the whole area under the curve is the heat Q.Legend
p
Pressure of the gas.
Pa
V
Volume of the gas.
m3
V1
Volume in state 1, before the expansion.
m3
V2
Volume in state 2, after it.
m3
T
Temperature of the gas, constant along the curve, which is the isotherm p=nRT/V.
K
dV
Width of one thin strip: a small step in volume.
m3
pdV
Area of the strip: the work done in that step, which equals the heat δQ taken in.
J
Q
Heat taken in over the whole path: the area under the curve, nRTln(V2/V1).
J
Because S is a function of state, its change can be computed along any reversible path that joins the same two end states. Figure 3 draws the convenient one: a slow isothermal expansion against a piston, for an ideal gas at temperature T. The curve is the isotherm p=nRT/V, from state 1 at volume V1 to state 2 at V2. The free expansion itself cannot be drawn on this diagram: between its end states the gas is churning, out of equilibrium, and has no single pressure.
Look at the thin strip of width dV. Over that step the pressure is p, so the gas does the work pdV, the area of the strip. The temperature, and with it U, stays fixed, so by the first law the gas takes in exactly that much heat, δQ=pdV; the whole area under the curve is the total heat Q. Each strip adds δQ/T=pdV/T to the entropy. Substituting p=nRT/V makes T cancel: ΔS=∫V1V2TpdV=∫V1V2VnRdV=nRln(V1V2) With nR=Nk, where N is the number of molecules and k is Boltzmann's constant, ΔS=nRln(V1V2)=Nkln(V1V2)(ideal gas, same T) The free expansion has exactly this entropy change, although it took in no heat. Doubling the volume adds kln2 per molecule: Rln2≈5.76J/K for a mole, and 20kln2≈1.9×10−22J/K for the 20 molecules in the animation's box.
The same recipe handles a change of temperature. Along a reversible path the first law gives δQrev=dU+pdV=nCVdT+nRTdV/V, where CV is the molar heat capacity at constant volume. Dividing by T, dS=nCVTdT+nRVdV so an ideal gas with constant CV has S=nCVlnT+nRlnV+const. For a liquid, whose volume hardly changes, only the first term matters: a mass m with specific heat capacity c, heated from T1 to T2, gains mcln(T2/T1). Warming 1 kg of water from 20 °C to 80 °C adds 4180ln(353.15/293.15)≈778J/K, with the temperatures in kelvin.
Counting microstates: the graph and the histogram
Thermodynamics says how much entropy changes; counting says why. A macrostate is what we observe, here how many molecules are in each half of the box. A microstate is the full detail: which molecule is where. Boltzmann's relation ties entropy to W, the number of microstates that look like the same macrostate: S=klnW Doubling the volume doubles the number of places open to each molecule, so W grows by a factor 2N and ΔS=kln2N=Nkln2, exactly the thermodynamic result. Requiring the two to agree is what fixes Boltzmann's constant, k=R/NA.
Counting also explains why heat flows from hot to cold, the Clausius statement of the second law. At fixed volume 1/T=∂S/∂U, so one joule changes lnW by 1/(kT). A joule leaving a hot body therefore lowers its lnW by less than the same joule raises the lnW of a cold body. The flow increases the total number of microstates, which is why it is overwhelmingly what happens.
Figure 4. Twenty molecules, nL of them in the left half of the box. Below, the number of microstates W of each split peaks at nL=10; above, S/k=lnW forms a dome whose top lies 21ln(πN/2) below the line Nln2.Legend
nL
Number of molecules in the left half of the box.
W
Number of microstates of the macrostate with nL molecules on the left: N!/(nL!nR!), with nR=N−nL.
σ
Width of the peak: the standard deviation N/2 of nL. The arrow ends at 10+σ.
S/k
Entropy of the macrostate in units of k, equal to lnW.
Nln2
Value of S/k for all 2N microstates together: the dashed line.
21ln(πN/2)
Gap between the top of the dome and Nln2, from Stirling's formula.
Figure 4 unpacks the two panels of the animation for N=20 molecules. Both parts of the figure share the horizontal axis nL, the number of molecules in the left half. Start with the histogram at the bottom. The bar over each nL has height W=N!/(nL!nR!), the number of ways to choose which molecules are on the left. It is 1 at both ends, since all-left and all-right can each happen in only one way, and it is largest, 184 756, at nL=10. The peak is binomial, with standard deviation σ=N/2≈2.2; the arrow runs from the centre to 10+σ. Relative to the mean N/2 that width is 1/N, which is why the animation's blue dot stays near the top of the histogram yet keeps jiggling, between about 7 and 12.
The upper part plots the entropy of each of those macrostates, S/k=lnW. Taking the logarithm flattens the sharp peak into a dome: zero at both ends, broad and flat at the top. The animation's S(t)/k graph reads this dome as nL changes with time: zero until the wall is removed at 1.8 s, a climb lasting about 3 s, then a plateau near 12 that never comes back down.
Why does the plateau sit below the dashed line Nln2≈13.9? The dashed line is ln2N, which counts all 2N microstates of the gas, every split included; the top of the dome counts only those of the single likeliest split. The bracket in the figure marks the gap, and Stirling's formula, lnN!≈NlnN−N+21ln(2πN), gives its size: lnWmax≈Nln2−21ln(2πN) For N=20 this is 13.86−1.72=12.14, against the exact 12.13. The gap grows only like lnN, whereas Nln2 grows like N: for 1023 molecules the correction is about 27 against 7×1022, utterly negligible.
The dome also gives probabilities. Every microstate is equally likely, so a macrostate with W microstates has probability W/2N=e−(Nkln2−S)/k. Each k of entropy below Nkln2, the entropy of all 2N microstates together, costs a factor e; the all-left state, with S=0, has probability 2−N. For the 2.7×1019 molecules in a cubic centimetre of air the relative width 1/N is 2×10−10: the histogram becomes a spike, and the gas is never seen far from an even split.
Can thermal jiggling be harvested?
If molecules never stop jiggling, why not harvest that motion? Picture a tiny toothed wheel held by a spring-loaded pawl that lets it turn only forwards, on an axle that also carries vanes standing in a gas. Molecules strike the vanes from both sides, and the pawl seems to keep only the forward kicks. It fails. The pawl is just as small, so at the same temperature it is shaken too: now and then it lifts just as the wheel is kicked backwards, and on average the slips exactly cancel the steps. With the vanes hotter than the pawl the wheel does turn, but then the device is a heat engine working between two temperatures, bound by 1−Tc/Th.
Maxwell's demon fails more subtly. It is a being that opens a trapdoor between the two halves only for fast molecules, sorting hot from cold without doing work. To decide, it must measure and record each molecule's speed, and its memory fills up. To keep going it must erase old records, and erasing one bit at temperature T costs at least kTln2 of work, 2.9×10−21J at 300 K. This is Landauer's principle; the entropy the erasure creates is at least the entropy the sorting removed. Information is physical, and this cost has been measured with single colloidal beads.
Worked problem: three ways to double a volume
One mole of ideal gas at 300 K, in contact with a large reservoir at 300 K, doubles its volume. The gas always ends in the same state, at the same temperature with twice the volume, so its entropy change is always ΔSgas=Rln2=5.763J/K. Since ΔU=0, the heat drawn from the reservoir equals the work the gas does, and the reservoir loses the entropy Q/T. Compare three methods.
Free expansion into vacuum, as in the animation: no work and no heat, so ΔStotal=5.763J/K.
Sudden expansion against a constant outside pressure equal to the final pressure p1/2, where p1 and V1 are the starting pressure and volume: the volume grows by V1, so the work is (p1/2)V1=21RT=1247J, the reservoir loses 1247/300=4.157J/K, and ΔStotal=5.763−4.157=1.606J/K.
Slow, reversible isothermal expansion: the work is RTln2=1729J, the reservoir loses 1729/300=5.763J/K, and ΔStotal=0.
The work missing, compared with the reversible method, is T0ΔStotal each time: 300⋅5.763=1729J, all of it, for the free expansion, and 300⋅1.606=482J, exactly 1729−1247, for the sudden one. The gas's own entropy change is the same in all three; the entropy change of everything together is not, and it measures the waste. For the 20 molecules of the animation the lost work at 300 K is 20kTln2≈5.7×10−20J.
Limits of validity and the arrow of time
The second law is statistical: effectively certain for very many particles, only a strong tendency for a few. In the box, all 20 molecules back on the left has probability 2−20 at any moment. Fluctuation theorems make this precise: over a short time, histories that destroy an entropy ΔS are eΔS/k times rarer than those that create it. Beads a few micrometres across, held in optical traps, show such entropy-consuming stretches; for everyday processes ΔS/k is 1020 or more, and they never happen.
Thermodynamic entropy belongs to equilibrium states. For a gas that is still spreading, the value depends on how coarse the description is, here halves only. Counting also needs quantum mechanics: phase-space cells have a size set by Planck's constant, and identical molecules must not be counted as different, or mixing two samples of the same gas would seem to create entropy (the Gibbs paradox). As T→0, S tends to a constant, zero for a perfect crystal: the third law. Gravity reverses the everyday intuition: a self-gravitating gas raises its entropy by clumping into stars.
Finally, the arrow of time. Apart from a tiny asymmetry in some weak decays, the laws governing the collisions work equally well backwards: reverse every velocity and the gas would gather back on the left. Irreversibility comes from the starting point, a state of very low entropy from which almost every trajectory leads to higher S. Our world's starting point goes back to the early universe, whose matter was spread almost perfectly evenly, a very low-entropy state for gravitating matter.
Where this leads
In Blackbody Radiation and the Quantum, Planck derived his radiation law in 1900 by counting the ways to share energy quanta among oscillators with S=klnW; the formula is carved on Boltzmann's tombstone in Vienna. The latent heats of Phase Changes and Latent Heat are entropy changes in disguise: L/T is 1223 J/K for each kilogram of ice that melts. A heat flow P through a wall, as in Conduction, Convection and Radiation, creates entropy at the rate P(1/Tc−1/Th). Black holes, treated in Gravity as Curved Spacetime, carry an entropy proportional to the area of their horizon. And information in bits, −∑pilog2pi, is the general entropy S=−k∑pilnpi in other units.
Key formulas
Entropy change for heat exchanged reversibly
ΔS=TQ(reversible heat, T in K)
Heat added slowly at a fixed absolute temperature raises a body's entropy by the heat divided by that temperature. The same joule counts for more at a low temperature, which is why heat flowing from hot to cold raises the total. Heat leaving the body is a negative Q and lowers its entropy.
Symbols
ΔS
entropy change of the body
J/K
Q
heat received (negative if given out)
J
T
absolute temperature at which the heat is exchanged
K
When it holds: For heat exchanged reversibly at constant T, and for any heat entering or leaving a reservoir. If T changes, integrate δQrev/T; in an irreversible process ΔS exceeds ∫δQ/T.
Example: The pan of water at 300 K receiving 1200 J: ΔS=1200/300=4J/K.
Second law: the total entropy of an isolated system
ΔStotal≥0(isolated system)
Whatever happens inside an isolated system, the entropies of its parts add up to a total that can only grow or, in the reversible limit, stay the same. A part can lose entropy, as water does when it freezes, provided other parts gain at least as much. The inequality fixes the direction of every spontaneous process.
Symbols
ΔStotal
change of the total entropy of all the parts
J/K
When it holds: For an isolated system, or for a system together with all the surroundings it interacts with. The law is statistical: for a handful of molecules, brief decreases do occur but are rare.
Example: Heat leaking from a hotplate at 600 K into water at 300 K: ΔStotal=−2+4=+2J/K.
Entropy created by heat flowing from hot to cold
ΔS=TcQ−ThQ>0(heat Q from hot to cold)
The cold body gains Q/Tc and the hot body loses Q/Th. Since Tc<Th, the gain is larger and the total rises; the reverse flow would lower it, which is the Clausius statement. The entropy created measures the work lost by letting the heat flow without an engine.
Symbols
ΔS
total entropy change of the two bodies
J/K
Q
heat transferred
J
Tc
temperature of the colder body
K
Th
temperature of the hotter body
K
When it holds: For bodies large enough to keep their temperatures. Bodies that warm or cool as the heat flows need ∫mcdT/T for each one instead.
Example: 1200 J from 600 K to 300 K: 1200/300−1200/600=2J/K; an ideal engine could have turned 600 J of that heat into work.
Boltzmann's entropy
S=klnW
Entropy is k times the natural logarithm of the number of microstates that look like the observed macrostate. The logarithm makes entropy additive, because the microstate counts of independent systems multiply. Systems drift towards macrostates with larger W simply because there are more ways to be in them.
Symbols
S
entropy of the macrostate
J/K
k
Boltzmann constant, 1.38×10−23J/K
J/K
W
number of microstates of the macrostate
When it holds: When all microstates are equally likely, as in an isolated system in equilibrium; in general S=−k∑pilnpi. A classical W depends on the size of the cells used for counting, so only differences of S are meaningful.
Example: Ten of 20 molecules on each side: W=184756 and S=kln184756≈12.1k=1.67×10−22J/K.
Number of ways to share N molecules between two halves
W=nL!nR!N!
There are N! ways to put the molecules in order; the order within each half does not matter, so divide by nL! and nR!. The result, a binomial coefficient, is 1 when all molecules are on one side and largest for an even split. Summed over all splits it gives 2N, the total number of left–right assignments.
Symbols
W
number of microstates of the macrostate
N
total number of molecules
nL
number of molecules in the left half
nR
number of molecules in the right half, N−nL
When it holds: Counts only which half each molecule is in, for halves of equal size and independent molecules (an ideal gas).
Example:N=20: W=1 for 20 and 0, 15504 for 15 and 5, 184756 for 10 and 10.
Entropy change of an ideal gas at constant temperature
ΔS=nRln(V1V2)=Nkln(V1V2)(ideal gas, same T)
In a slow isothermal expansion the gas absorbs heat equal to the work it does, nRTln(V2/V1); dividing by T gives the entropy change. Because S is a state function, the result holds for any process between the same end states, including a free expansion with no heat at all. The second form is the counting view: the room open to each molecule grows by the factor V2/V1.
Symbols
ΔS
entropy change of the gas
J/K
n
amount of gas
mol
R
molar gas constant, 8.314J/(mol⋅K)
J/(mol⋅K)
V2
final volume
m3
V1
initial volume
m3
N
number of molecules
k
Boltzmann constant
J/K
T
temperature of the gas, the same at the start and at the end
K
When it holds: For an ideal gas whose initial and final temperatures are equal. If the temperature changes too, add nCVln(T2/T1), where CV is the molar heat capacity at constant volume.
Example: One mole doubling its volume: ΔS=8.314ln2=5.76J/K; for the 20 molecules of the animation, 20kln2≈1.9×10−22J/K.
Coefficient of performance of a heat pump
COP=WinQh≤Th−TcTh(heat pump)
A heat pump uses work to lift heat from a cold place into a warm one, delivering Qh=Qc+Win. Because it adds the work to heat that already exists outdoors, its COP exceeds 1. The upper limit comes from requiring that the warm side gain at least the entropy the cold side loses, Qh/Th≥Qc/Tc.
Symbols
COP
coefficient of performance (heat delivered per unit of work)
Qh
heat delivered to the warm side
J
Win
work supplied
J
Th
absolute temperature of the warm side
K
Tc
absolute temperature of the cold side
K
When it holds: The equality needs an ideal reversible machine; real heat pumps reach 3 to 4 in mild weather. Temperatures must be in kelvins, although their difference is the same in °C.
Example: House at 20 °C, outdoor air at 0 °C: COP≤293.15/20≈14.7.
Coefficient of performance of a refrigerator
COP=WinQc≤Th−TcTc(refrigerator)
A refrigerator is the same machine with another goal: the useful output is the heat Qc removed from the cold inside. Because Qh=Qc+Win, its limit is exactly 1 less than the heat pump's across the same gap. The narrower the gap, the more heat each joule of work can remove.
Symbols
COP
coefficient of performance (heat removed per unit of work)
Qc
heat removed from the cold side
J
Win
work supplied
J
Tc
absolute temperature of the cold side
K
Th
absolute temperature of the warm side
K
When it holds: Reached only by an ideal reversible refrigerator. It falls quickly as the gap grows and tends to zero as Tc approaches absolute zero.
Example: A freezer at −18 °C in a kitchen at 20 °C: COP≤255.15/38≈6.7.
Glossary
Second law of thermodynamics
The law that fixes which way natural processes run: the total entropy of an isolated system never decreases, ΔStotal≥0. Energy conservation allows a process and its reverse alike; the second law allows only one of them.
Clausius statement
Heat never flows by itself from a colder body to a hotter one. A refrigerator does move heat that way, but only because work is supplied.
Kelvin–Planck statement
No engine working in a cycle can take heat from a single reservoir and turn all of it into work: some heat must go to a colder body. It is equivalent to the Clausius statement.
Isolated system (thermodynamics)
A system that exchanges neither energy nor matter with anything outside. The second law forbids a decrease of entropy only for such a system, or for a system and its surroundings taken together.
Heat reservoir
A body so large that heat going in or out does not change its temperature, such as the atmosphere or the sea. Its entropy changes by Q/T whatever the process.
Reversible process
An idealised process that runs slowly, without friction and with heat crossing only vanishing temperature differences, so that a tiny change could run it backwards. It creates no entropy: ΔStotal=0.
Irreversible process
A real process that cannot be undone without leaving a change elsewhere, such as heat crossing a temperature gap, friction, mixing or free expansion. It creates entropy: ΔStotal>0.
Entropy
A function of state, in J/K, that grows by δQrev/T when heat is added reversibly and that counts microstates, S=klnW. Often called disorder, it really measures how many microscopic arrangements fit what is seen from outside.
Microstate
A complete microscopic description of a system, for example which half of the box each of the 20 molecules is in. In equilibrium every accessible microstate is equally likely.
Macrostate
What can be observed from outside, for example only how many molecules are in each half. With 10 molecules on each side one macrostate covers 184 756 microstates; with all 20 on the left, just one.
Free expansion
Expansion of a gas into a vacuum, with no heat exchanged and no work done. For an ideal gas the temperature stays the same, yet the entropy rises by nRln(V2/V1).
Arrow of time
The one-way direction of everyday processes, set by the growth of entropy. The microscopic laws work equally well backwards; the arrow comes from a low-entropy starting state.
Quantities
S
Entropy
J/K
k times the logarithm of the number of microstates, or the sum of δQrev/T along a reversible path. In most problems only its changes matter, such as ΔS=nRln(V2/V1) for n moles of ideal gas going from volume V1 to V2 (in m3) at a fixed temperature.
ΔStotal
Total entropy change
J/K
The entropy change of everything involved in a process, taken together. It is zero for a reversible process and positive for every real one: +2 J/K for the hotplate heating water.
Q
Heat
J
Energy transferred because of a temperature difference; positive when it enters the body being described, negative when it leaves. Qh and Qc are the heats exchanged with the hot and the cold side, as positive amounts.
T
Absolute temperature
K
Temperature counted from absolute zero: 20 °C is 293.15 K. Every Q/T and every Carnot limit needs it. Th and Tc are the temperatures of the hot and the cold side.
k
Boltzmann constant
J/K
k=1.38×10−23J/K, the gas constant per molecule, R/NA. It converts the count lnW into thermodynamic units. Per mole it becomes the gas constant R=NAk=8.314J/(mol⋅K), so nR=Nk.
W
Number of microstates
How many microscopic arrangements give the same macrostate; here it is not work. In the animation it ranges from 1 (all on the left) to 184 756 (ten and ten).
N
Number of molecules
20 in the animation, about 6.02×1023 in a mole: the reason fluctuations vanish in everyday life.
nL
Molecules in the left half
The macrostate variable of the animation; the other nR=N−nL molecules are in the right half.
COP
Coefficient of performance
Heat moved per unit of work: Qh/Win for a heat pump, Qc/Win for a refrigerator. It can exceed 1; heating at 20 °C from air at 0 °C caps it at about 14.7.
Win
Work input
J
The work, usually electrical, that drives a heat pump or a refrigerator. Not to be confused with W, the number of microstates.
Quiz
Beginner A hot cup of tea is left on a table in a cool room. What happens?
The tea gets even hotter by taking heat from the cooler air
The tea cools down until it reaches room temperature
The tea keeps its temperature, because a cup holds the heat in
The room cools down while the tea warms up
Show answer
Answer: B. The tea cools down until it reaches room temperature
On its own, heat flows only from hot to cold, so the tea gives heat to the room until both are at the same temperature. The reverse never happens by itself.
Beginner In the animation, the wall is removed and the gas fills the whole box. Why do the molecules practically never all crowd back into the left half on their own?
A force pushes them towards the right
They slow down and run out of energy
There are vastly more ways to be spread out than to be all on one side
The left half has become too hot for them
Show answer
Answer: C. There are vastly more ways to be spread out than to be all on one side
Nothing pushes the molecules: they just move at random. Spread-out arrangements vastly outnumber the single all-on-the-left one, so random motion almost never finds it. For 20 molecules the chance is about one in a million at any moment.
Beginner An inventor claims a ship engine that takes heat from the sea water and turns all of it into motion, with no waste heat at all. What is wrong with the idea?
Nothing: the sea holds plenty of heat, so it would work
It breaks energy conservation, because heat is not a form of energy
It fails only because of friction, which a cleverer design could remove
Some heat must go to something colder; no engine turns all its heat into work
Show answer
Answer: D. Some heat must go to something colder; no engine turns all its heat into work
Energy would be conserved, but the second law is broken: an engine turns heat into work only while heat flows from a hot place to a colder one, and some of it must end up on the cold side. With the sea as its only source, the engine cannot run.
Intermediate 500 J of heat flows from a body at 500 K into a body at 250 K. What is the total change in entropy of the two bodies?
0 J/K
−1 J/K
+1 J/K
+3 J/K
Show answer
Answer: C. +1 J/K
The hot body loses 500/500 = 1 J/K and the cold one gains 500/250 = 2 J/K, so ΔS_total = 2 − 1 = +1 J/K. Adding the two terms (3 J/K) forgets that the hot body loses entropy; 0 J/K would mean entropy is conserved, which it is not.
Intermediate Which statement is a correct form of the second law of thermodynamics?
Energy can be neither created nor destroyed
Heat cannot flow by itself from a colder body to a hotter one
The entropy of every object always increases
A refrigerator cannot move heat from cold to hot
Show answer
Answer: B. Heat cannot flow by itself from a colder body to a hotter one
That is the Clausius statement. The first option is the first law; the entropy of one object can fall if more is produced elsewhere; and a refrigerator does move heat from cold to hot, but only because work is supplied.
Intermediate A heat pump keeps a house at 20 °C while the outdoor air is at 0 °C. What is the largest possible coefficient of performance (heat delivered per unit of work)?
About 14.7
About 13.7
At most 1, because energy is conserved
About 0.07
Show answer
Answer: A. About 14.7
COP_max = T_h/(T_h − T_c) = 293.15/20 ≈ 14.7. It exceeds 1 without breaking energy conservation, because the pump moves heat that already exists outdoors. 13.7 is the limit for a refrigerator, T_c/(T_h − T_c), and 0.07 is the ratio upside down.
Advanced In the free expansion of the animation, the gas exchanges no heat (Q = 0). How can its entropy increase?
It cannot: ΔS = Q/T = 0, so the entropy stays the same
Its temperature rises, so ΔS = C·ln(T₂/T₁) > 0
Removing the wall does work on the gas, which adds entropy
S is a state function: a reversible path between the same states gives nR·ln(V₂/V₁)
Show answer
Answer: D. S is a state function: a reversible path between the same states gives nR·ln(V₂/V₁)
ΔS = ∫δQ/T holds only for reversible processes; for an irreversible one ΔS > ∫δQ/T. A reversible isothermal expansion between the same end states gives ΔS = nR·ln 2 for a doubled volume. The temperature of an ideal gas does not change in a free expansion, and no work is done.
Advanced In the S(t) graph of the animation, S/k levels off near 12.1, a little below the dashed line N·ln 2 ≈ 13.9. Why?
The plateau is ln C(20, 10) ≈ N·ln 2 − ½·ln(πN/2), and the gap only matters for small N
Some energy is lost in collisions with the walls, so S cannot reach N·ln 2
The animation stops before the gas has had time to reach equilibrium
Entropy can approach its maximum but never reach it in a finite time
Show answer
Answer: A. The plateau is ln C(20, 10) ≈ N·ln 2 − ½·ln(πN/2), and the gap only matters for small N
S/k counts only the arrangements of the most likely macrostate, ln C(20, 10) = 12.1, while N·ln 2 = 13.9 counts all 2²⁰ arrangements. By Stirling's formula the difference is ½·ln(πN/2) ≈ 1.7, which is negligible next to N·ln 2 when N ≈ 10²³.