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

See also: Course-wide Conventions & Notation

Run the code: Notebook for Section 4.1, in which you can change and rerun the Python cells of this section in your browser.

The course map shows where this module sits in the course and which relations connect the microscopic and macroscopic descriptions. Select a module to unfold its sections.

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 Module 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 Module 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-571.66\ \mathrm{kJ} for two moles of H2O(l)\mathrm{H_2O(l)}, so the reaction is exothermic.

The formation of water is spontaneous under standard conditions, and the heat that it releases favors this direction.

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 stopper is opened (Figure 4.1.1).

Source
Loading...

Figure 4.1.1:Mixing of two ideal gases, Ar and Kr, (a) before and (b) after opening the stopper between the two bulbs. Because the atoms of an ideal gas do not interact, ΔH=0\Delta H = 0 for this process.

Even though ΔH=0\Delta H = 0, the process is still spontaneous. If you were shown panels (a) and (b) of Figure 4.1.1 without their titles, 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, which the rest of this section defines.

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 noted that dividing the reversible heat δqrev\delta q_{\mathrm{rev}} by TT produces the exact differential dSdS.

It can be shown from the Clausius theorem (a consequence of the Second Law) that δqrev/T\delta q_{\mathrm{rev}}/T is always an exact differential, regardless of the substance. The factor 1/T1/T is called an integrating factor for δqrev\delta q_{\mathrm{rev}}; Appendix A reviews exact and inexact differentials. We therefore define entropy through

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

The change in entropy between two states AA and BB is

ΔS  =  ∫ABδqrevT.\Delta S \;=\; \int_{A}^{B} \frac{\delta q_{\mathrm{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_{\mathrm{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_{\mathrm{rev}} = C_V\,dT + \frac{Nk_{\mathrm{B}}T}{V}\,dV.

To decide whether a differential is exact, we use the cross-derivative test. A differential f(x,y) dx+g(x,y) dyf(x,y)\,dx + g(x,y)\,dy is exact if and only if

(∂f∂y)x=(∂g∂x)y,\left(\frac{\partial f}{\partial y}\right)_x = \left(\frac{\partial g}{\partial x}\right)_y,

because the two sides are then the mixed second derivatives of a single function, which do not depend on the order of differentiation.

Here x=Tx = T, y=Vy = V, f=CVf = C_V, and g=NkBT/Vg = Nk_{\mathrm{B}}T/V. For an ideal gas, UU depends only on TT, so CV=(∂U/∂T)VC_V = (\partial U/\partial T)_V depends only on TT as well, and (∂CV/∂V)T=0(\partial C_V/\partial V)_T = 0. However, (∂(NkBT/V)/∂T)V=NkB/V≠0\left(\partial(Nk_{\mathrm{B}}T/V)/\partial T\right)_V = Nk_{\mathrm{B}}/V \neq 0. The two derivatives differ, so δqrev\delta q_{\mathrm{rev}} is inexact.

Now divide by TT:

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

Apply the cross-derivative test with f=CV/Tf = C_V/T and g=NkB/Vg = Nk_{\mathrm{B}}/V:

(∂f∂V)T=(∂(CV/T)∂V)T=0,(∂g∂T)V=(∂(NkB/V)∂T)V=0.\left(\frac{\partial f}{\partial V}\right)_T = \left(\frac{\partial (C_V/T)}{\partial V}\right)_T = 0, \qquad \left(\frac{\partial g}{\partial T}\right)_V = \left(\frac{\partial (Nk_{\mathrm{B}}/V)}{\partial T}\right)_V = 0.

Both derivatives 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.

Integrating between two states gives the entropy change of an ideal gas:

ΔS=∫T1T2CVT dT+NkBln⁡(V2V1).\Delta S = \int_{T_1}^{T_2}\frac{C_V}{T}\,dT + Nk_{\mathrm{B}}\ln\left(\frac{V_2}{V_1}\right).

At constant temperature only the second term remains (Example 1 below).

Fundamental Thermodynamic Relation

From the definition of entropy, δqrev=T dS\delta q_{\mathrm{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_{\mathrm{rev}} + \delta w_{\mathrm{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.

The relation was derived for a reversible process, but it contains only state functions and their differentials. It therefore holds for any infinitesimal change between equilibrium states of a closed system with only PVPV work, whether the change is reversible or not. What is lost in an irreversible change is the identification of the two terms: T dST\,dS is then not the heat, and −P dV-P\,dV is not the work.

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=(1 mol)(8.314 J mol−1 K−1)ln⁡2=5.76 J K−1.\Delta S = (1\ \mathrm{mol})(8.314\ \mathrm{J\,mol^{-1}\,K^{-1}})\ln 2 = 5.76\ \mathrm{J\,K^{-1}}.

Result. Doubling the volume reversibly at constant TT increases the entropy by Rln⁡2R\ln 2 per mole.


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 worked example of Section 3.1).

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)=5.76 J K−1.\Delta S_{\mathrm{free\ expansion}} = \Delta S_{\mathrm{rev.\ isotherm}} = nR\ln\left(\frac{V_2}{V_1}\right) = 5.76\ \mathrm{J\,K^{-1}}.

Result. The entropy change of the gas is the same as for the reversible isothermal expansion, because entropy is a state function. Figure 4.3.3 in Section 4.3 follows this expansion particle by particle.

Section 4.2 states the Second Law in terms of the total entropy of an isolated system.

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