Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

4.1. Entropy

Course-wide Conventions & Notation

Overview and Learning Objectives

Entropy completes the thermodynamic description of spontaneity by accounting for the dispersal of energy and matter. This section motivates entropy through examples where enthalpy alone fails, defines entropy as a state function via reversible heat, and derives the fundamental relation dU=T dS−P dVdU=T\,dS-P\,dV for simple compressible systems.

In Chapter 3, we established the First Law toolkit: internal energy UU, enthalpy HH, heat capacities CVC_V and CPC_P, and the five-step workflow for computing qq, ww, and ΔU\Delta U under various process constraints. That toolkit tells us how much energy is exchanged — but not which direction a process will spontaneously proceed. We will see that exothermicity (ΔH<0\Delta H < 0) often favors spontaneity but does not fully determine it. The missing piece is entropy, a state function that provides crucial insight into the direction of spontaneous change.

In Chapter 2, we built a statistical-mechanical framework in which macroscopic properties emerge as ensemble averages over microstates. Entropy turns out to have a particularly natural microscopic interpretation: it measures how many microstates are consistent with a given macrostate. This section introduces entropy from the macroscopic side; Section 4.3 will close the loop by connecting entropy to the partition function QQ.

Learning objectives:

Core Ideas and Derivations

Exothermicity and Spontaneity

Exothermic reactions are often — but not always — spontaneous. An exothermic process releases heat to its surroundings, corresponding to a negative enthalpy change, ΔH<0\Delta H < 0. While this heat release can drive a process forward, enthalpy alone does not guarantee spontaneity; we must also consider entropy.

An Example: Formation of Liquid Water

Consider the formation of two moles of liquid water from hydrogen and oxygen gases at 298.15 K and 1 bar:

2 HX2(g)+OX2(g)→2 HX2O(l)\ce{2H2(g) + O2(g) -> 2H2O(l)}

The standard enthalpy change for this reaction is -571.66 kJ for two moles of H2_2O(l), indicating an exothermic process. The reaction releases heat:

It is fortunate that water formation is exothermic, as this makes the reaction more likely to proceed spontaneously under standard conditions.

A Counter Example: Mixing of Two Ideal Gases

If we mix two ideal gases, such as Ar and Kr, their intermolecular interactions are negligible (ideal-gas behavior), so ΔH=0\Delta H = 0. Nonetheless, mixing occurs spontaneously once the partition is removed.

Source
import numpy as np
import matplotlib.pyplot as plt
from scipy.constants import k, eV
from labellines import labelLines
from myst_nb import glue

rng = np.random.default_rng(8251991)

fig, axs = plt.subplot_mosaic([[0, 1]], figsize=(8, 4), constrained_layout=True, sharex=True, sharey=True)

# Before
axs[0].set_title('Before Opening the Stopper')
x_Ar = rng.uniform(-4, 4, 6)
y_Ar = rng.uniform(2, 5, 6)
axs[0].scatter(x_Ar, y_Ar, color='r', label='Ar', s=100)

x_Kr = rng.uniform(-4, 4, 6)
y_Kr = rng.uniform(-5, -2, 6)
axs[0].scatter(x_Kr, y_Kr, color='b', label='Kr', s=100)

# Ar region
axs[0].plot([1, 1], [0, 1], color='k')
axs[0].plot([1, 5], [1, 1], color='k')
axs[0].plot([5, 5], [1, 6], color='k')
axs[0].plot([5, -5], [6, 6], color='k')
axs[0].plot([-5, -5], [6, 1], color='k')
axs[0].plot([-5, -1], [1, 1], color='k')
axs[0].plot([-1, -1], [1, 0], color='k')

# Kr region
axs[0].plot([1, 1], [0, -1], color='k')
axs[0].plot([1, 5], [-1, -1], color='k')
axs[0].plot([5, 5], [-1, -6], color='k')
axs[0].plot([5, -5], [-6, -6], color='k')
axs[0].plot([-5, -5], [-6, -1], color='k')
axs[0].plot([-5, -1], [-1, -1], color='k')
axs[0].plot([-1, -1], [-1, 0], color='k')

# Closed stopper
axs[0].plot([-1.5, 1.5], [0, 0], color='m', lw=2)
axs[0].text(2, 0, "Stopper (closed)", fontsize=10, ha='left', va='center', color='m')
axs[0].set_aspect('equal')
axs[0].axis('off')

# After
axs[1].set_title('After Opening the Stopper')
x_Ar = rng.uniform(-4, 4, 6)
y_Ar_1 = rng.uniform(2, 5, 3)
y_Ar_2 = rng.uniform(-5, -2, 3)
y_Ar = np.concatenate((y_Ar_1, y_Ar_2))
axs[1].scatter(x_Ar, y_Ar, color='r', label='Ar', s=100)

x_Kr = rng.uniform(-4, 4, 6)
y_Kr_1 = rng.uniform(2, 5, 3)
y_Kr_2 = rng.uniform(-5, -2, 3)
y_Kr = np.concatenate((y_Kr_1, y_Kr_2))
axs[1].scatter(x_Kr, y_Kr, color='b', label='Kr', s=100)

axs[1].plot([1, 1], [0, 1], color='k')
axs[1].plot([1, 5], [1, 1], color='k')
axs[1].plot([5, 5], [1, 6], color='k')
axs[1].plot([5, -5], [6, 6], color='k')
axs[1].plot([-5, -5], [6, 1], color='k')
axs[1].plot([-5, -1], [1, 1], color='k')
axs[1].plot([-1, -1], [1, 0], color='k')
axs[1].plot([1, 1], [0, -1], color='k')
axs[1].plot([1, 5], [-1, -1], color='k')
axs[1].plot([5, 5], [-1, -6], color='k')
axs[1].plot([5, -5], [-6, -6], color='k')
axs[1].plot([-5, -5], [-6, -1], color='k')
axs[1].plot([-5, -1], [-1, -1], color='k')
axs[1].plot([-1, -1], [-1, 0], color='k')

# Open stopper
axs[1].plot([-5, -2], [0, 0], color='m', lw=2)
axs[1].text(2, 0, "Stopper (open)", fontsize=10, ha='left', va='center', color='m')
axs[1].axis('off')
axs[1].set_aspect('equal')
axs[1].legend(bbox_to_anchor=(1.05, 1), loc='upper left', borderaxespad=0.)

fig.suptitle(r'$\Delta H = 0$')

plt.show()
plt.close(fig)
<Figure size 800x400 with 2 Axes>

Mixing of two ideal gases before and after opening the stopper that separates them.

Even though ΔH=0\Delta H = 0, the process is still spontaneous. If you were shown the “before” and “after” snapshots without additional labels, you would know the natural direction of mixing. This spontaneous behavior underscores that enthalpy alone cannot capture whether a process will occur without additional driving forces. That driving force is entropy — and we can already anticipate why. From each gas’s perspective, removing the partition is equivalent to a free expansion: the volume accessible to each gas doubles. As we will show below, doubling the available volume at constant temperature increases the entropy by nRln⁡2nR\ln 2 per component. For a symmetric mixture of nn moles each of Ar and Kr,

ΔSmix=2×nRln⁡2>0.\Delta S_{\mathrm{mix}} = 2 \times nR\ln 2 > 0.

The entropy of the mixed state exceeds that of the separated state, so mixing is the spontaneous direction. (We will derive the result ΔS=nRln⁡(V2/V1)\Delta S = nR\ln(V_2/V_1) in full below; we quote it here to motivate what follows.)

Definition of Entropy

Entropy
A state function denoted by SS, quantifying the degree of dispersal or spread of energy and matter, thereby predicting the direction of spontaneous change.

The General Claim

In Section 3.1, we noted a key distinction: dUdU is an exact differential, while δq\delta q and δw\delta w are inexact — their values depend on the path. We also foreshadowed that “dividing the inexact differential δq\delta q by TT produces the exact differential dSdS.”

It can be shown — via the Clausius theorem (a consequence of the second law) or by identifying 1/T1/T as an integrating factor (Appendix A) — that δqrev/T\delta q_{\mathrm{rev}}/T is always an exact differential, regardless of the substance. We therefore define entropy through

dS  =  δqrevT.dS \;=\; \frac{\delta q_{\text{rev}}}{T}.

The change in entropy between two states AA and BB is

ΔS  =  ∫ABδqrevT.\Delta S \;=\; \int_{A}^{B} \frac{\delta q_{\text{rev}}}{T}.

Because dSdS is exact, ΔS\Delta S depends only on the initial and final states — not on the path. However, computing ΔS\Delta S requires evaluating the integral along a reversible path (since dS=δqrev/TdS = \delta q_{\mathrm{rev}}/T holds only for reversible processes). For an irreversible process between the same two states, we construct any convenient reversible path connecting them and integrate along that path instead.

Verification: Ideal Gas

Rather than proving the general result, let us verify that δqrev/T\delta q_{\mathrm{rev}}/T is exact for an ideal gas — a case where we can check directly.

From Section 3.2, the First Law for a reversible process with only PVPV work, using VV and TT as independent variables, gives

δqrev=CV dT+[(∂U∂V)T+P]dV.\delta q_{\text{rev}} = C_V\,dT + \left[\left(\frac{\partial U}{\partial V}\right)_T + P\right] dV.

For any ideal gas (not just monatomic), (∂U/∂V)T=0(\partial U/\partial V)_T = 0 and P=NkBT/VP = Nk_{\mathrm{B}}T/V, so

δqrev=CV dT+NkBTV dV.\delta q_{\text{rev}} = C_V\,dT + \frac{Nk_{\mathrm{B}}T}{V}\,dV.

This is inexact: the cross-derivative test gives (∂CV/∂V)T=0(\partial C_V/\partial V)_T = 0 but ∂(NkBT/V)/∂T∣V=NkB/V≠0\partial(Nk_{\mathrm{B}}T/V)/\partial T\big|_V = Nk_{\mathrm{B}}/V \neq 0.

Now divide by TT:

δqrevT  =  CVT dT  +  NkBV dV.\frac{\delta q_{\text{rev}}}{T} \;=\; \frac{C_V}{T}\,dT \;+\; \frac{Nk_{\mathrm{B}}}{V}\,dV.

Apply the cross-derivative test to M(T,V)=CV/TM(T,V) = C_V/T and N(T,V)=NkB/VN(T,V) = Nk_{\mathrm{B}}/V:

(∂M∂V)T=∂∂V(CVT)T=0,(∂N∂T)V=∂∂T(NkBV)V=0.\left(\frac{\partial M}{\partial V}\right)_T = \frac{\partial}{\partial V}\left(\frac{C_V}{T}\right)_T = 0, \qquad \left(\frac{\partial N}{\partial T}\right)_V = \frac{\partial}{\partial T}\left(\frac{Nk_{\mathrm{B}}}{V}\right)_V = 0.

Both mixed partials are zero, so they are equal: δqrev/T\delta q_{\mathrm{rev}}/T is exact. Dividing by TT converted an inexact differential into an exact one, confirming the entropy definition for this case.

Fundamental Thermodynamic Relation

From the definition of entropy, δqrev=T dS\delta q_{\text{rev}} = T\,dS. For a simple closed system with only PVPV work (δwrev=−P dV\delta w_{\mathrm{rev}} = -P\,dV), the First Law gives

dU=δqrev+δwrev=T dS−P dV.dU = \delta q_{\text{rev}} + \delta w_{\text{rev}} = T\,dS - P\,dV.

This is the fundamental thermodynamic relation for a simple compressible system:

dU=T dS−P dV.dU = T\,dS - P\,dV.

Notice what has happened: the First Law in the form dU=δq+δwdU = \delta q + \delta w involves two inexact differentials that combine to give one exact differential. The fundamental relation rewrites the same physics using three exact differentials — dUdU, dSdS, and dVdV. The path-dependent δqrev\delta q_{\mathrm{rev}} has been replaced by the state-function product T dST\,dS, and the path-dependent δwrev\delta w_{\mathrm{rev}} by −P dV-P\,dV. Converting inexact differentials into exact ones is the central mathematical achievement of introducing entropy.

Here, UU is naturally expressed as a function of the extensive variables SS and VV. In systems with additional types of work (e.g., electrical, surface, magnetic), the more general relation becomes

dU  =  T dS  +  ∑iF⃗i⋅dx⃗i.dU \;=\; T\,dS \;+\; \sum_{i} \vec{F}_{i}\cdot d\vec{x}_{i}.

Worked Examples

Example 1: Isothermal expansion (reversible)

Problem. Compute ΔS\Delta S when one mole of an ideal gas expands reversibly and isothermally from V1V_1 to V2=2V1V_2 = 2V_1.

Solution. For a reversible isothermal expansion of an ideal gas,

ΔS=∫12δqrevT.\Delta S = \int_{1}^{2}\frac{\delta q_{\mathrm{rev}}}{T}.

Along a reversible isotherm of an ideal gas, dU=0dU = 0 (since UU depends only on TT), so δqrev=−δwrev=P dV=nRT dV/V\delta q_{\mathrm{rev}} = -\delta w_{\mathrm{rev}} = P\,dV = nRT\,dV/V. Therefore

ΔS=nR∫V1V2dVV=nRln⁡(V2V1).\Delta S = nR\int_{V_1}^{V_2}\frac{dV}{V}=nR\ln\left(\frac{V_2}{V_1}\right).

With n=1 moln = 1\ \mathrm{mol} and V2=2V1V_2 = 2V_1:

ΔS=Rln⁡2=(8.314)ln⁡2=5.76 J mol−1 K−1.\Delta S = R\ln 2 = (8.314)\ln 2 = 5.76\ \mathrm{J\,mol^{-1}\,K^{-1}}.

Result. Doubling the volume reversibly at constant TT increases the entropy by Rln⁡2R\ln 2 per mole. This is the result we quoted earlier when computing ΔSmix\Delta S_{\mathrm{mix}} for ideal-gas mixing.


Example 2: Free expansion (irreversible)

Problem. Compute ΔS\Delta S when one mole of an ideal gas undergoes free expansion from V1V_1 to V2=2V1V_2 = 2V_1 inside a rigid, insulated container (as in the Section 3.1 worked example).

Solution. In the free expansion, Pext=0P_{\mathrm{ext}} = 0, so w=0w = 0. The container is insulated, so q=0q = 0. By the First Law, ΔU=0\Delta U = 0, which means ΔT=0\Delta T = 0 for an ideal gas.

But q=0q = 0 does not mean ΔS=0\Delta S = 0! The definition dS=δqrev/TdS = \delta q_{\mathrm{rev}}/T applies to a reversible path, and free expansion is decidedly irreversible. To compute ΔS\Delta S, we need a reversible path connecting the same initial and final states.

The initial and final states have the same TT but different VV — exactly the endpoints of Example 1. Since SS is a state function,

ΔSfree expansion=ΔSrev. isotherm=nRln⁡(V2V1)=Rln⁡2=5.76 J mol−1 K−1.\Delta S_{\mathrm{free\ expansion}} = \Delta S_{\mathrm{rev.\ isotherm}} = nR\ln\left(\frac{V_2}{V_1}\right) = R\ln 2 = 5.76\ \mathrm{J\,mol^{-1}\,K^{-1}}.

Result. The entropy change is the same as for the reversible isothermal expansion — because entropy is a state function. What differs between the two processes is the entropy of the surroundings: in the reversible case, ΔSsurr=−Rln⁡2\Delta S_{\mathrm{surr}} = -R\ln 2 (the reservoir loses heat qrevq_{\mathrm{rev}} at temperature TT), so ΔStotal=0\Delta S_{\mathrm{total}} = 0. In the free expansion, ΔSsurr=0\Delta S_{\mathrm{surr}} = 0 (no heat exchanged), so ΔStotal=Rln⁡2>0\Delta S_{\mathrm{total}} = R\ln 2 > 0 — entropy was produced by the irreversible process.

Concept Checks

  1. In the ideal-gas mixing example, why can ΔH=0\Delta H = 0 but the process still be spontaneous?

  2. Why must ΔS\Delta S be computed along a reversible path even for an irreversible process between the same states?

  3. What are the natural variables of UU for a simple compressible system, and how do they appear in dUdU?

  4. How does the sign of ΔStotal\Delta S_{\mathrm{total}} (system + surroundings) relate to “directionality” (arrow of time) in spontaneous processes?

  5. Two ideal-gas processes connect the same initial and final states: one reversible, one irreversible. Compare ΔSsystem\Delta S_{\mathrm{system}}, ΔSsurroundings\Delta S_{\mathrm{surroundings}}, and ΔStotal\Delta S_{\mathrm{total}} for the two processes.

Key Takeaways