Draft

7  Entropy of Ideal and Real Systems

Part II — The Second Law

Last updated: 26-04-2026


7.1 The fundamental relation

7.1.1 Combining the First and Second Laws

For a quasi-static process of a closed system, the First Law gives \(dU = \delta Q - \delta W = \delta Q - p\, dV\), and the Second Law (for a reversible process) gives \(\delta Q_{\rm rev} = T\, dS\). Substituting:

\[dU = T\, dS - p\, dV. \tag{7.1}\]

This is the fundamental relation of thermodynamics. Several remarks are in order.

First, although it was derived by combining \(dU = \delta Q - p\, dV\) with \(dS = \delta Q_{\rm rev}/T\) for a reversible process, it is a relation between state functions — \(U\), \(S\), \(V\) — and holds for any infinitesimal change of state, reversible or not, provided only that the system passes through equilibrium states (i.e. the change is quasi-static). The quantities \(\delta Q\) and \(\delta W\) separately depend on the path; \(dU\) and \(T\, dS - p\, dV\) do not.

Second, Equation 7.1 shows that the natural variables for the internal energy are \(S\) and \(V\): if \(U\) is known as a function \(U(S, V)\), all thermodynamic properties follow by differentiation. The temperature and pressure can be read off as:

\[T = \left(\frac{\partial U}{\partial S}\right)_V, \qquad p = -\left(\frac{\partial U}{\partial V}\right)_S. \tag{7.2}\]

These relations will be central to Lecture 8, where the thermodynamic potentials are introduced.

Third, the fundamental relation is the starting point for computing entropy changes in any process. Rearranged:

\[dS = \frac{dU}{T} + \frac{p}{T}\, dV = \frac{1}{T}(dU + p\, dV). \tag{7.3}\]


7.2 The \(T\, dS\) equations

From the fundamental relation Equation 7.1 one obtains two practically useful expressions for \(T\, dS\), each suited to a different choice of independent variables.

7.2.1 First \(T\, dS\) equation (variables \(T\), \(V\))

Writing \(U = U(T, V)\):

\[dU = \left(\frac{\partial U}{\partial T}\right)_V dT + \left(\frac{\partial U}{\partial V}\right)_T dV.\]

Substituting into Equation 7.1:

\[T\, dS = \left(\frac{\partial U}{\partial T}\right)_V dT + \left[\left(\frac{\partial U}{\partial V}\right)_T + p\right] dV = C_V\, dT + \left[\left(\frac{\partial U}{\partial V}\right)_T + p\right] dV. \tag{7.4}\]

For an ideal gas \((\partial U/\partial V)_T = 0\) and \(p = nRT/V\), giving \(T\, dS = C_V\, dT + (nRT/V)\, dV\), which on dividing by \(T\) reproduces \(dS = C_V\, dT/T + nR\, dV/V\) from Lecture 6.

7.2.2 Second \(T\, dS\) equation (variables \(T\), \(p\))

Writing \(V = V(T, p)\) and using the enthalpy \(H = U + pV\) (whose differential is \(dH = dU + p\, dV + V\, dp = T\, dS + V\, dp\)):

\[T\, dS = dH - V\, dp = \left(\frac{\partial H}{\partial T}\right)_p dT + \left[\left(\frac{\partial H}{\partial p}\right)_T - V\right] dp. \tag{7.5}\]

The definition \(C_p = (\partial H/\partial T)_p\) (at constant pressure all heat goes into enthalpy) gives:

\[T\, dS = C_p\, dT + \left[\left(\frac{\partial H}{\partial p}\right)_T - V\right] dp. \tag{7.6}\]

For an ideal gas \((\partial H/\partial p)_T = 0\) (enthalpy depends only on temperature, by the same argument as for \(U\)), giving \(T\, dS = C_p\, dT - (nRT/p)\, dp\), consistent with the temperature–pressure entropy formula of Lecture 6 (\(S = nC_p\ln T - nR\ln p + \text{const}\)).

Equations Equation 7.4 and Equation 7.6 are exact for any substance. The terms \((\partial U/\partial V)_T\) and \((\partial H/\partial p)_T\) characterize the departure from ideal-gas behavior and will be evaluated for real substances in the sections below.


7.3 Internal energy and entropy of a van der Waals gas

7.3.1 The internal energy derivative \((\partial U/\partial V)_T\)

For a van der Waals gas (Lecture 4), the equation of state is:

\[\left(p + \frac{an^2}{V^2}\right)(V - nb) = nRT. \tag{7.7}\]

The general thermodynamic identity

\[\left(\frac{\partial U}{\partial V}\right)_T = T\left(\frac{\partial p}{\partial T}\right)_V - p \tag{7.8}\]

(to be derived in Lecture 8 as a Maxwell relation consequence) can be applied immediately. From Equation 7.7:

\[\left(\frac{\partial p}{\partial T}\right)_V = \frac{nR}{V - nb}.\]

Therefore:

\[\left(\frac{\partial U}{\partial V}\right)_T = T \cdot \frac{nR}{V-nb} - p = \frac{nRT}{V-nb} - p = \frac{an^2}{V^2}, \tag{7.9}\]

where in the last step we used the van der Waals equation Equation 7.7 to write \(nRT/(V-nb) = p + an^2/V^2\). The quantity \(an^2/V^2\) is called the internal pressure: it is the contribution to the total pressure from intermolecular attractions. It vanishes for an ideal gas (\(a = 0\)).

7.3.2 Internal energy of a van der Waals gas

From Equation 7.8 and Equation 7.9, \((\partial U/\partial V)_T = an^2/V^2\). Integrating at constant \(T\):

\[U(T, V) = U_{\rm ideal}(T) - \frac{an^2}{V}, \tag{7.10}\]

where \(U_{\rm ideal}(T) = nC_V T + \text{const}\) is the internal energy the gas would have if it were ideal (the \(b\) correction does not appear in \(U\)). The attractive term \(-an^2/V\) represents the potential energy of intermolecular attraction: it decreases \(U\) as the molecules are brought closer together (smaller \(V\)). This is the thermodynamic basis for the temperature drop observed in free expansion of a real gas.

7.3.3 Entropy of a van der Waals gas

Substituting Equation 7.9 into the first \(T\, dS\) equation Equation 7.4:

\[T\, dS = C_V\, dT + \frac{nRT}{V - nb}\, dV,\]

hence:

\[dS = C_V \frac{dT}{T} + nR \frac{dV}{V - nb}. \tag{7.11}\]

Integrating:

\[S(T, V) = C_V \ln T + nR \ln(V - nb) + \text{const}. \tag{7.12}\]

Comparing with the ideal gas result (Lecture 6), the volume \(V\) is replaced by the excluded-volume-corrected quantity \(V - nb\): the entropy is reduced because the effective free volume available to the molecules is smaller. The attraction constant \(a\) does not appear in the entropy at all — it appears only in the internal energy Equation 7.10.


7.4 Entropy changes in irreversible processes

The Clausius inequality \(dS \geq \delta Q/T\) (Lecture 6) allows us to quantify the entropy generated by irreversible processes even when we cannot follow the process in detail.

7.4.1 Free expansion

One mole of gas at temperature \(T\) expands freely from volume \(V_1\) into an evacuated space, reaching final volume \(V_2 > V_1\). Since \(W = 0\) and \(Q = 0\), by the First Law \(\Delta U = 0\). For an ideal gas, \(U\) depends only on \(T\), so \(T\) is unchanged.

To compute \(\Delta S\), replace the irreversible path by a reversible isothermal expansion from \(V_1\) to \(V_2\) at temperature \(T\) (same initial and final states, since \(\Delta U = 0\) implies \(\Delta T = 0\) for an ideal gas):

\[\Delta S = \int_{V_1}^{V_2} \frac{p}{T}\, dV = R\int_{V_1}^{V_2} \frac{dV}{V} = R\ln\!\left(\frac{V_2}{V_1}\right) > 0. \tag{7.13}\]

For a van der Waals gas the argument is slightly more involved because \(\Delta U = 0\) no longer implies \(\Delta T = 0\), but the same method applies: connect the actual initial and final states by any convenient reversible path and integrate \(\delta Q_{\rm rev}/T\).

7.4.2 Irreversible heat transfer

A small body at temperature \(T_1\) is placed in contact with a large reservoir at \(T_2 \neq T_1\) and allowed to reach equilibrium. Suppose the body has heat capacity \(C\) and its temperature changes from \(T_1\) to \(T_2\).

The entropy change of the body is:

\[\Delta S_{\rm body} = C \ln\!\left(\frac{T_2}{T_1}\right).\]

The reservoir is large (constant temperature), so its entropy change is:

\[\Delta S_{\rm res} = -\frac{C(T_2 - T_1)}{T_2}.\]

The total entropy change of the universe is:

\[\Delta S_{\rm univ} = C\left[\ln\!\left(\frac{T_2}{T_1}\right) - 1 + \frac{T_1}{T_2}\right]. \tag{7.14}\]

For any \(T_1 \neq T_2\), the function \(\ln x - 1 + 1/x > 0\) for \(x \neq 1\) (where \(x = T_2/T_1\)). Hence \(\Delta S_{\rm univ} > 0\), confirming irreversibility. The equal sign holds only when \(T_1 = T_2\) — the trivial reversible case.


7.5 Entropy of a composite system

7.5.1 Extensivity and additivity

Entropy is extensive: for a homogeneous system, \(S\) is proportional to \(n\) at fixed intensive state. For a composite system made of two or more subsystems with no mutual constraints (e.g. two parts of the same gas separated by a permeable partition), the total entropy is the sum of the individual entropies:

\[S_{\rm total} = S_1 + S_2 + \cdots \tag{7.15}\]

This additivity, combined with the entropy-maximum principle, determines the equilibrium conditions between subsystems.

7.5.2 Equilibrium between two subsystems

Consider two systems 1 and 2, each individually in internal equilibrium, placed in thermal contact but isolated from the rest of the world. The total energy \(U = U_1 + U_2\) is fixed; energy can be redistributed between them as heat. The total entropy \(S = S_1(U_1) + S_2(U_2)\) must be maximized subject to the constraint \(U_1 + U_2 = U\).

Setting \(dS = 0\) with \(dU_1 = -dU_2\):

\[\frac{\partial S_1}{\partial U_1} = \frac{\partial S_2}{\partial U_2}. \tag{7.16}\]

From the fundamental relation Equation 7.1, \((\partial S/\partial U)_V = 1/T\). Hence Equation 7.16 is equivalent to \(T_1 = T_2\): thermal equilibrium requires equal temperatures. This reproduces, from entropy considerations, the empirical content of the Zeroth Law.

A similar analysis for mechanical equilibrium (movable partition, \(V_1 + V_2\) fixed, maximize \(S\)) gives \(p_1 = p_2\); and for diffusive equilibrium (\(n_1 + n_2\) fixed) gives equality of the chemical potentials (to be defined in Lecture 8).


7.6 Summary

  1. The fundamental relation \(dU = T\, dS - p\, dV\) (Equation 7.1) combines the First and Second Laws for quasi-static processes; it holds for all changes between equilibrium states and gives \(T = (\partial U/\partial S)_V\) and \(p = -(\partial U/\partial V)_S\) (Equation 7.2).

  2. The two \(T\, dS\) equations express \(T\, dS\) in terms of \((T,V)\) (Equation 7.4) or \((T,p)\) (Equation 7.6); the departure from ideal-gas behavior is encoded in \((\partial U/\partial V)_T\) and \((\partial H/\partial p)_T\) respectively.

  3. For a van der Waals gas: \((\partial U/\partial V)_T = an^2/V^2\) (Equation 7.9), \(U = U_{\rm ideal}(T) - an^2/V\) (Equation 7.10), and \(S = C_V \ln T + nR\ln(V - nb) + \text{const}\) (Equation 7.12). The attraction constant \(a\) affects \(U\) but not \(S\); the excluded volume \(b\) affects \(S\) but not \(U\) (for fixed \(T\)).

  4. Entropy changes in irreversible processes are computed by connecting the same initial and final states by a convenient reversible path and evaluating \(\int \delta Q_{\rm rev}/T\) along it.

  5. The entropy-maximum principle for a composite isolated system reproduces the equilibrium conditions: \(T_1 = T_2\) (thermal), \(p_1 = p_2\) (mechanical), and equal chemical potentials (diffusive).


7.7 Problems

Problem 7.1 (The \(T\, dS\) equations.)

(a) Using the definition of \(C_p\) and the relation \(dH = T\, dS + V\, dp\), show that \((\partial H/\partial T)_p = C_p\) without reference to any specific equation of state.

(b) For an ideal gas, show that \((\partial H/\partial p)_T = 0\), and hence verify the second \(T\, dS\) equation Equation 7.6 reduces to \(T\, dS = C_p\, dT - (nRT/p)\, dp\).

(c) Using \((\partial H/\partial p)_T = V - T(\partial V/\partial T)_p\) (to be derived in Lecture 8), verify this result again using \(V = nRT/p\).

Problem 7.2 One mole of a van der Waals gas (\(a = 0.364\ \mathrm{J\ m^3\ mol^{-2}}\) for argon, \(b = 3.22 \times 10^{-5}\ \mathrm{m^3\ mol^{-1}}\)) expands isothermally and reversibly at \(T = 300\ \mathrm{K}\) from \(V_1 = 1.00 \times 10^{-3}\ \mathrm{m^3}\) to \(V_2 = 5.00 \times 10^{-3}\ \mathrm{m^3}\).

(a) Compute \(\Delta S\) using Equation 7.12 and compare with the ideal gas result \(\Delta S = R\ln(V_2/V_1)\).

(b) Compute \(\Delta U\) using Equation 7.10.

(c) Compute the heat \(Q\) absorbed and the work \(W\) done in the process. Verify the First Law.

Problem 7.3 Use the result Equation 7.9 and the identity Equation 7.8 to show that the general thermodynamic identity \((\partial U/\partial V)_T = T(\partial p/\partial T)_V - p\) holds exactly for a van der Waals gas.

Problem 7.4 Two containers, each holding 1 mole of ideal gas, are initially at the same temperature \(T\) and the same pressure \(p\) but contain different gases (say, nitrogen and oxygen). A partition separating them is removed and the gases mix irreversibly.

(a) Show that the temperature and pressure do not change during mixing (assuming ideal-gas behavior).

(b) Compute the total entropy change \(\Delta S_{\rm mix}\) (in J K\(^{-1}\)). (Hint: the entropy of an ideal gas at fixed \(T\) increases by \(nR\ln 2\) when its volume doubles at constant pressure; apply this to each component.)

(c) Show that \(\Delta S_{\rm mix} > 0\), confirming irreversibility. Explain physically why mixing is irreversible.

Problem 7.5 (More demanding.) A real gas obeys the truncated virial equation of state (Lecture 4):

\[pV = nRT\left[1 + B(T)\frac{n}{V}\right],\]

where \(B(T)\) is the second virial coefficient.

(a) Compute \((\partial U/\partial V)_T\) using Equation 7.8.

(b) Show that the entropy at fixed \(T\) satisfies:

\[S(T, V) = nR\ln V - n^2 R\left[B(T) + T B'(T)\right] \frac{1}{V} + \text{(function of } T \text{ only)},\]

where \(B'(T) = dB/dT\). Compare with the ideal-gas result.

(c) For the van der Waals gas at low density (\(V \gg nb\)), expand the vdW entropy Equation 7.12 and the vdW \(B(T) = b - a/(RT)\) to first order in \(1/V\) and verify that the two expressions agree.