PHYS-261 · Lesson 8 of 12 · 23 min
Entropy and irreversibility
Carnot's theorem contains a hidden conservation law. For a reversible engine, \(Q_h/T_h = Q_c/T_c\): the quantity heat divided by temperature that enters at the hot side equals the quantity that leaves at the cold side. Clausius saw in 1865 that this ratio defines a new function of state, which he called entropy, from the Greek for transformation. Entropy is conserved in reversible processes and increases in irreversible ones, and with it the second law becomes a single quantitative statement that applies to any process, not just to engines. This lesson derives the Clausius inequality, defines entropy, shows how to calculate entropy changes for the common processes, and explains why entropy production measures how much useful work has been thrown away.
The Clausius inequality
Treat heat entering a system as positive and heat leaving as negative. For a Carnot cycle, \(Q_h/T_h - Q_c/T_c = 0\), so the sum of \(Q/T\) over the cycle vanishes. For an irreversible engine between the same reservoirs, Carnot's theorem says that less work is produced, so more heat is rejected and the sum is negative. Clausius generalized this to any cycle in which a system exchanges heat \(\delta Q\) with reservoirs at temperatures \(T\):
with equality if and only if the cycle is reversible. The proof breaks an arbitrary cycle into small steps and imagines each step's heat \(\delta Q\) being supplied by a tiny reversible Carnot engine running between a single master reservoir at \(T_0\) and the reservoir at \(T\). That auxiliary engine draws \(T_0\,\delta Q/T\) from the master reservoir. Around the whole cycle the system returns to its initial state, and the only net effect is that heat \(T_0 \oint \delta Q/T\) has been taken from the master reservoir and turned into work. Kelvin–Planck forbids that being positive, which is the inequality.
Entropy as a function of state
For a reversible cycle the integral of \(\delta Q_{\text{rev}}/T\) vanishes. That means the integral between two states A and B is the same along every reversible path, exactly as the vanishing of \(\oint \mathbf{F} \cdot d\mathbf{r}\) for a conservative force makes work path-independent. We can therefore define a function of state, the entropy \(S\), by
The units are J/K. Only differences are defined this way; the third law, which says that \(S \to 0\) for a perfect crystal as \(T \to 0\), fixes the zero. Now consider an irreversible process from A to B, and close it into a cycle by returning reversibly from B to A. The Clausius inequality gives \(\int_A^B \delta Q/T - (S_B - S_A) \le 0\), that is
For an isolated system no heat flows at all, so \(\Delta S \ge 0\): the entropy of an isolated system never decreases, and it increases in every irreversible process. This is the most general form of the second law. Applied to the universe, taken as an isolated system, it is Clausius's famous summary that the entropy of the world tends to a maximum.
Calculating entropy changes
Because entropy is a function of state, the change between two equilibrium states can be calculated along any convenient reversible path, even if the actual process was violently irreversible. This is the key practical idea. Some standard results follow directly. Heating a body of constant heat capacity \(C\) from \(T_1\) to \(T_2\):
A phase change at constant temperature, absorbing latent heat \(L\) per unit mass: \(\Delta S = mL/T\). For an ideal gas changing from \((T_1, V_1)\) to \((T_2, V_2)\), using \(dU = nC_{V,m}dT\) and \(\delta Q_{\text{rev}} = dU + P\,dV\):
In a free expansion, where a gas rushes into an evacuated chamber, no work is done and no heat flows, so \(\Delta U = 0\) and the temperature of an ideal gas is unchanged. Yet the entropy increases by \(nR\ln(V_2/V_1)\), as the formula shows when we evaluate it along a reversible isothermal path between the same two states. The process is irreversible: the gas will never gather itself back into the first chamber, which, as lesson 1 showed, is a statement about probabilities.
When two different ideal gases at the same temperature and pressure are allowed to mix, each expands into the whole volume, and the total entropy of mixing for amounts \(n_1\) and \(n_2\) is
which is largest, \(nR\ln 2\), for an equal mixture. If the two gases are identical, nothing measurable happens when the partition is removed and the entropy does not change. That a change in the formula should depend on whether the molecules are distinguishable puzzled Gibbs, and the resolution of the Gibbs paradox requires the quantum notion that identical particles are truly indistinguishable, which lesson 10 builds in when it counts microstates.
Irreversibility in everyday processes
The program computes the entropy changes in six common processes and checks the Clausius inequality for a real engine. In each, it calculates the change of every body involved along a reversible path and adds them up.
import math
R = 8.314462618
c_w, L_f = 4186.0, 3.34e5
def dS_heat(m, c, T1, T2): # heating at constant pressure, constant c
return m * c * math.log(T2 / T1)
# 1. Mixing 1 kg of water at 80 C with 1 kg at 20 C
T1, T2 = 353.15, 293.15
Tf = (T1 + T2) / 2
dS1, dS2 = dS_heat(1, c_w, T1, Tf), dS_heat(1, c_w, T2, Tf)
print(f"1. mixing hot and cold water: final {Tf - 273.15:.1f} C, "
f"dS hot {dS1:.2f} J/K, dS cold {dS2:+.2f} J/K, total {dS1 + dS2:+.2f} J/K")
# 2. Melting 100 g of ice at 0 C in a room at 20 C
m = 0.100
dS_ice = m * L_f / 273.15
dS_room = -m * L_f / 293.15
print(f"2. melting 100 g of ice: ice {dS_ice:+.2f} J/K, room {dS_room:+.2f} J/K, total {dS_ice + dS_room:+.2f} J/K")
# 3. Free expansion of 1 mol of ideal gas into a vacuum, volume doubles
dS_free = R * math.log(2)
print(f"3. free expansion V -> 2V: gas {dS_free:+.3f} J/K, surroundings +0.000 J/K")
# 4. Reversible isothermal expansion V -> 2V at 300 K in contact with a reservoir
Q = 300 * R * math.log(2)
print(f"4. reversible isothermal V -> 2V: gas {Q / 300:+.3f} J/K, reservoir {-Q / 300:+.3f} J/K, total +0.000 J/K")
# 5. Ideal mixing of two gases (1 mol each), each doubling its volume
dS_mix = -2 * R * (0.5 * math.log(0.5) + 0.5 * math.log(0.5)) * 1
print(f"5. mixing 1 mol of N2 with 1 mol of O2: dS = {dS_mix:+.3f} J/K = 2 R ln 2")
# 6. Heat flowing through a wall: 100 W for one hour from 21 C to -30 C
Qw = 100 * 3600
dS_wall = Qw / 243.15 - Qw / 294.15
print(f"6. 100 W through a wall for 1 h, 21 C -> -30 C: entropy produced {dS_wall:+.1f} J/K")
# Clausius check on a real engine: takes 1000 J at 600 K, rejects 700 J at 300 K
print(f"\nClausius sum Q/T for an engine: {1000 / 600 - 700 / 300:+.4f} J/K (must be <= 0)")1. mixing hot and cold water: final 50.0 C, dS hot -371.62 J/K, dS cold +407.85 J/K, total +36.23 J/K 2. melting 100 g of ice: ice +122.28 J/K, room -113.93 J/K, total +8.34 J/K 3. free expansion V -> 2V: gas +5.763 J/K, surroundings +0.000 J/K 4. reversible isothermal V -> 2V: gas +5.763 J/K, reservoir -5.763 J/K, total +0.000 J/K 5. mixing 1 mol of N2 with 1 mol of O2: dS = +11.526 J/K = 2 R ln 2 6. 100 W through a wall for 1 h, 21 C -> -30 C: entropy produced +256.7 J/K Clausius sum Q/T for an engine: -0.6667 J/K (must be <= 0)
Mixing a kilogram of water at 80 °C with a kilogram at 20 °C lowers the entropy of the hot water by 372 J/K and raises that of the cold water by 408 J/K, a net increase of 36 J/K, even though energy is exactly conserved. The cold water gains more entropy than the hot water loses because the same heat is divided by a lower temperature. The same asymmetry appears when ice melts in a warm room: the ice gains \(Q/273\) and the room loses only \(Q/293\). A free expansion produces \(R\ln 2 = 5.76\) J/K per mole with no change in the surroundings, while a reversible isothermal expansion between the same states produces exactly the same change in the gas, balanced by an equal and opposite change in the reservoir. Mixing two different gases produces \(2R\ln 2\) for one mole of each. Heat leaking through a wall from a 21 °C room to the \(-30\) °C outdoors produces entropy steadily: 100 W for an hour generates 257 J/K. Finally, an engine that takes 1000 J at 600 K and rejects 700 J at 300 K gives a Clausius sum of \(-0.67\) J/K, so it is allowed; an engine that rejected only 400 J would give a positive sum and could not exist, because it would beat Carnot's 50%.
Entropy and lost work
Entropy production has a direct economic meaning. Suppose an irreversible process generates entropy \(S_{\text{gen}}\) in a world whose coldest available reservoir, usually the environment, is at \(T_0\). Then the work that could have been obtained but was not, called the lost work or exergy destruction, is
This is the Gouy–Stodola theorem, found independently by Louis Georges Gouy in 1889 and Aurel Stodola in 1905. When the hot and cold water were simply mixed, \(36\) J/K was produced; with the environment at 293 K, about 10.6 kJ of work could in principle have been extracted by running an engine between them instead. Every irreversibility, whether friction, heat flow across a temperature difference, unrestrained expansion or mixing, generates entropy and wastes work in proportion. Engineers use this to find where in a plant the losses are largest, and it explains why heating a house by burning natural gas at 1900 °C to obtain air at 21 °C is so wasteful in second-law terms, even when the furnace is 95% efficient by first-law accounting: a heat pump does the same job by moving heat across a small temperature difference.
The TS diagram
Since \(\delta Q_{\text{rev}} = T\,dS\), the heat absorbed in a reversible process is the area under its path on a temperature–entropy diagram, just as work is the area under a path on a PV diagram. On a TS diagram, isotherms are horizontal lines and reversible adiabats are vertical lines, since \(dS = 0\) when no heat flows; reversible adiabatic processes are therefore also called isentropic. The Carnot cycle becomes a rectangle, as the figure in lesson 7 shows, with \(Q_h = T_h\Delta S\), \(Q_c = T_c\Delta S\) and efficiency \(1 - T_c/T_h\) read off at a glance. Real cycles drawn on TS diagrams show how far the heat absorption falls short of the top temperature, which is why engineers prefer them to PV diagrams for steam and refrigeration plants.
Combining \(dU = \delta Q - \delta W\) with \(\delta Q = T\,dS\) and \(\delta W = P\,dV\) for reversible changes gives the fundamental relation of thermodynamics,
Although derived for reversible processes, it relates functions of state only, so it holds for any infinitesimal change between equilibrium states. It says that \(U\) is naturally a function of \(S\) and \(V\), with \(T = (\partial U/\partial S)_V\) and \(P = -(\partial U/\partial V)_S\). The next lesson builds the other thermodynamic potentials from this relation.
Worked problem
Warming a cold stone
A 2.0 kg block of granite (\(c = 790\) J/(kg K)) at \(-20\) °C is brought into a house and warms to 20 °C. Find the entropy change of the block, of the house air (which stays at 20 °C), and of the universe.
Show solution
- Heat absorbed by the block: \(Q = 2.0 \times 790 \times 40 = 63\,200\) J.
- Block: \(\Delta S = mc\ln(T_2/T_1) = 1580 \ln(293.15/253.15) = 1580 \times 0.1467 = 231.8\) J/K.
- House air: it supplies 63 200 J at 293.15 K, so \(\Delta S = -63\,200/293.15 = -215.6\) J/K.
- Universe: \(231.8 - 215.6 = +16.2\) J/K, positive as the second law requires.
Answer: The block gains 231.8 J/K, the room loses 215.6 J/K, and the universe gains 16.2 J/K.
Common mistakes
MistakeComputing \(\Delta S\) as \(Q/T\) along an irreversible path.
InsteadFind a reversible path between the same equilibrium states and integrate \(\delta Q_{\text{rev}}/T\) along it.
MistakeConcluding that the entropy of a system can never decrease.
InsteadIt can, if the system is not isolated; the entropy of the system plus its surroundings never decreases.
MistakeThinking that an adiabatic process always has \(\Delta S = 0\).
InsteadOnly reversible adiabatic processes are isentropic; a free expansion is adiabatic and increases entropy.
MistakeUsing Celsius temperatures in \(\ln(T_2/T_1)\) or \(Q/T\).
InsteadUse kelvins.
MistakeTreating entropy as a measure of disorder in every context.
InsteadDisorder is a useful image, but entropy is precisely defined by heat flow or by counting microstates, and sometimes ordered-looking states have higher entropy.
Summary and key terms
- The Clausius inequality \(\oint \delta Q/T \le 0\) holds for any cycle, with equality for reversible cycles.
- Entropy is a function of state defined by \(dS = \delta Q_{\text{rev}}/T\); in general \(\Delta S \ge \int \delta Q/T\).
- The entropy of an isolated system never decreases; irreversible processes generate entropy.
- Standard results: \(C\ln(T_2/T_1)\) for heating, \(mL/T\) for phase changes, \(nC_V\ln(T_2/T_1) + nR\ln(V_2/V_1)\) for ideal gases.
- Lost work equals \(T_0 S_{\text{gen}}\), the Gouy–Stodola theorem.
- The fundamental relation is \(dU = T\,dS - P\,dV\); heat is the area under a path on a TS diagram.
- entropy
- A function of state defined by dS = dQ_rev/T; it never decreases in an isolated system.
- Clausius inequality
- The cyclic integral of dQ/T is less than or equal to zero.
- isentropic
- At constant entropy; a reversible adiabatic process.
- free expansion
- Expansion of a gas into a vacuum with no work and no heat transfer.
- entropy of mixing
- The entropy increase when different substances mix; nR ln 2 for an equal binary mixture.
- lost work
- The work that could have been obtained, T0 times the entropy generated.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Find the entropy change when 1.0 kg of water is heated from 20 °C to 100 °C.
Show answer
\(4186 \ln(373.15/293.15) = 4186 \times 0.2413 = 1010\) J/K.
Find the entropy change when 1.0 kg of water boils at 100 °C.
Show answer
\(2\,257\,000/373.15 = 6048\) J/K.
Two moles of an ideal gas double their volume in a free expansion. Find \(\Delta S\).
Show answer
\(2R\ln 2 = 11.53\) J/K.
A reservoir at 500 K transfers 1000 J directly to one at 300 K. How much entropy is generated, and how much work is lost if the environment is at 300 K?
Show answer
\(S_{\text{gen}} = 1000/300 - 1000/500 = 1.333\) J/K; \(W_{\text{lost}} = 300 \times 1.333 = 400\) J, exactly the work a Carnot engine would have produced.
Find the entropy of mixing for 1 mol of a mixture with mole fractions 0.25 and 0.75.
Show answer
\(-R(0.25\ln 0.25 + 0.75\ln 0.75) = 8.314 \times 0.5623 = 4.67\) J/K.
From \(dU = T\,dS - P\,dV\), show that \(T = (\partial U/\partial S)_V\).
Show answer
At constant volume \(dV = 0\), so \(dU = T\,dS\) and \(T = (\partial U/\partial S)_V\).
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.