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.

5.1. Free Energy

Course-wide Conventions & Notation

Overview and Learning Objectives

In Section 4.3 we derived the canonical entropy S=U/T+kBln⁡QS = U/T + k_{\mathrm B}\ln Q and showed that rearranging it gives the Helmholtz free energy A=U−TS=−kBTln⁡QA = U - TS = -k_{\mathrm B}T\ln Q. We noted that this makes AA a “master potential” — if you can compute QQ, you can derive all other thermodynamic quantities by taking appropriate derivatives. This section develops that machinery.

We begin by combining the Clausius inequality (Section 4.3) with the First Law to obtain a fundamental inequality, dU≤T dS−P dVdU \le T\,dS - P\,dV, that governs the direction of spontaneous change. From this single inequality we derive extremum principles: rules for which thermodynamic potential (UU, HH, AA, or GG) is minimized at equilibrium under a given set of constraints. These potentials are related to one another by Legendre transforms that swap “awkward” natural variables (like SS) for experimentally controllable ones (like TT).

With the potentials and their differentials in hand, we can read off measurable quantities as partial derivatives. In particular, we derive the pressure formula P=kBT(∂ln⁡Q/∂V)TP = k_{\mathrm B}T(\partial\ln Q/\partial V)_T that was previewed in Section 2.3, and we show that changes in the Gibbs free energy GG track reversible non-PVPV work under typical laboratory conditions.


Learning objectives:

Core Ideas and Derivations

The fundamental inequality

In Section 4.1 we derived the fundamental thermodynamic relation for a reversible, PVPV-only process:

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

This is an equality that holds when the process is reversible. For irreversible processes we need the Clausius inequality (Section 4.3),

dS≥δqT,dS \ge \frac{\delta q}{T},

which says that entropy can be produced by irreversibility beyond the entropy carried in by heat flow. Rearranging gives δq≤T dS\delta q \le T\,dS.

For a closed system doing only PVPV work against an external pressure, the First Law reads dU=δq+δwdU = \delta q + \delta w with δw=−Pext dV\delta w = -P_{\mathrm{ext}}\,dV. Since Pext≤PP_{\mathrm{ext}} \le P during a spontaneous expansion and Pext≥PP_{\mathrm{ext}} \ge P during a spontaneous compression, we have δw≥−P dV\delta w \ge -P\,dV in general, with equality in the reversible limit. Combining the two inequalities:

dU=δq+δw≤T dS−P dV.dU = \delta q + \delta w \le T\,dS - P\,dV.

We therefore arrive at the fundamental inequality for a simple compressible system:

dU≤T dS−P dVdU \le T\,dS - P\,dV

Equality holds for reversible changes; the inequality encodes the direction of spontaneous evolution for irreversible processes.


Thermodynamic equilibrium as an extremum principle

Equation (4) gives an “equilibrium test” once you specify what is held fixed. The idea is simple: if certain variables are constant, the inequality constrains what happens to the remaining ones.

Constant SS and VV ⇒ minimize UU

If SS and VV are both fixed, then dS=0dS = 0 and dV=0dV = 0, so (4) reduces to

dU≤0(S,V constant).dU \le 0 \quad (S, V\ \text{constant}).

At constant SS and VV, spontaneous evolution drives UU downward until equilibrium is reached at a minimum of UU.

Identifying TT and PP from derivatives of U(S,V)U(S,V)

Since the fundamental relation at equilibrium is dU=T dS−P dVdU = T\,dS - P\,dV, we can read off

T=(∂U∂S)V,P=−(∂U∂V)S.T = \left(\frac{\partial U}{\partial S}\right)_V,\qquad P = -\left(\frac{\partial U}{\partial V}\right)_S.

These partial-derivative identities are the natural-variable counterparts of the differential form. In Section 4.1 we noted that a state function’s natural variables are those that appear as independent variables in its total differential; for UU, these are SS and VV. The expressions above show that the conjugate intensive variables (TT and PP) are encoded as slopes of UU along its natural-variable axes.


Euler’s theorem and the Euler relation

Many thermodynamic functions are homogeneous in their extensive variables. If a function f(x1,…,xn)f(x_1,\dots,x_n) is homogeneous of degree kk — meaning f(sx1,…,sxn)=skf(x1,…,xn)f(sx_1,\dots,sx_n) = s^k f(x_1,\dots,x_n) for all s>0s > 0 — then Euler’s theorem states

k f=∑i=1nxi(∂f∂xi)others.k\,f = \sum_{i=1}^{n} x_i \left(\frac{\partial f}{\partial x_i}\right)_{\text{others}}.

For a simple system at fixed composition (NN fixed), the internal energy U(S,V)U(S,V) is homogeneous of degree 1 in its extensive arguments. Applying Euler’s theorem with k=1k=1:

U=S(∂U∂S)V+V(∂U∂V)S=TS−PVU = S\left(\frac{\partial U}{\partial S}\right)_V + V\left(\frac{\partial U}{\partial V}\right)_S = TS - PV

Equation (8) is the Euler relation for this simplified case (fixed NN).


Thermodynamic potentials

Holding SS or VV constant is experimentally awkward — most laboratory work is done at controlled TT and/or controlled PP. The solution is to define new state functions whose natural variables match the experimentally convenient ones. This is the same strategy we used in Section 3.3 when we defined enthalpy H=U+PVH = U + PV to simplify the First Law at constant pressure; now we extend it systematically.

Each new potential is obtained from UU by a Legendre transform: a mathematical operation that swaps an extensive variable for its conjugate intensive variable while preserving all thermodynamic information. For example, replacing the natural variable SS in U(S,V)U(S,V) with its conjugate T=(∂U/∂S)VT = (\partial U/\partial S)_V gives the Helmholtz free energy A(T,V)=U−TSA(T,V) = U - TS.

Summary table

potentialsymboldefinitiondifferential (equilibrium)natural variables
internal energyUU—dU=T dS−P dVdU = T\,dS - P\,dVS,VS, V
enthalpyHHU+PVU + PVdH=T dS+V dPdH = T\,dS + V\,dPS,PS, P
Helmholtz free energyAAU−TSU - TSdA=−S dT−P dVdA = -S\,dT - P\,dVT,VT, V
Gibbs free energyGGH−TS=U+PV−TSH - TS = U + PV - TSdG=−S dT+V dPdG = -S\,dT + V\,dPT,PT, P

Each differential can be verified by direct computation. For example, for the Helmholtz free energy:

dA=d(U−TS)=dU−T dS−S dT=(T dS−P dV)−T dS−S dT=−S dT−P dV.dA = d(U - TS) = dU - T\,dS - S\,dT = (T\,dS - P\,dV) - T\,dS - S\,dT = -S\,dT - P\,dV.

The other differentials follow by the same approach.

Which potential is minimized?

Each thermodynamic potential satisfies an inequality analogous to Eq. (4), derived by applying the same fundamental inequality to the appropriate Legendre-transformed quantity. The results are:

These extremum principles are immensely practical. Most chemistry and biology occurs at constant temperature (thermostatted lab or regulated body temperature) and either constant volume (rigid container, computational simulation) or constant pressure (open to the atmosphere). Under these conditions:


The Helmholtz free energy as a master potential

Section 4.3 established the central connection between the canonical partition function and thermodynamics:

A=−kBTln⁡Q.A = -k_{\mathrm B}T\ln Q.

From this single equation, combined with the Helmholtz differential dA=−S dT−P dVdA = -S\,dT - P\,dV, we can extract every equilibrium property of the system by differentiation.

Entropy

Reading off the coefficient of dTdT in the Helmholtz differential:

S=−(∂A∂T)VS = -\left(\frac{\partial A}{\partial T}\right)_V

This is consistent with the canonical entropy expression S=U/T+kBln⁡QS = U/T + k_{\mathrm B}\ln Q derived in Section 4.3, as can be verified by differentiating Eq. (13) directly.

Pressure

Reading off the coefficient of dVdV:

P=−(∂A∂V)TP = -\left(\frac{\partial A}{\partial V}\right)_T

Substituting A=−kBTln⁡QA = -k_{\mathrm B}T\ln Q:

P=kBT(∂ln⁡Q∂V)TP = k_{\mathrm B}T\left(\frac{\partial\ln Q}{\partial V}\right)_T

This is the result previewed (without derivation) in Section 2.3. The route is now clear: the Helmholtz differential tells us that pressure is −(∂A/∂V)T-(\partial A/\partial V)_T, and the partition-function bridge A=−kBTln⁡QA = -k_{\mathrm B}T\ln Q converts that into a derivative of ln⁡Q\ln Q.

Internal energy

From A=U−TSA = U - TS and the expressions above:

U=A+TS=−kBTln⁡Q+T[−(∂A∂T)V]U = A + TS = -k_{\mathrm B}T\ln Q + T\left[-\left(\frac{\partial A}{\partial T}\right)_V\right]

After simplification (or using the Section 2.3 result directly):

U=−(∂ln⁡Q∂β)N,V,β=1kBTU = -\left(\frac{\partial\ln Q}{\partial\beta}\right)_{N,V}, \qquad \beta = \frac{1}{k_{\mathrm B}T}

Heat capacity

CV=(∂U∂T)N,VC_V = \left(\frac{\partial U}{\partial T}\right)_{N,V}

Takeaway. Knowing Q(T,V,N)Q(T,V,N) gives access to AA, SS, UU, CVC_V, and the equation of state P(T,V)P(T,V) — all from derivatives of a single function.


Example: monatomic ideal gas

To see the derivative machinery in action, we return to a system whose partition function we derived in Section 2.5. For a monatomic ideal gas:

Q(T,V,N)=1N! VNΛ3N,Λ=h2πmkBT.Q(T,V,N) = \frac{1}{N!}\,\frac{V^N}{\Lambda^{3N}}, \qquad \Lambda = \frac{h}{\sqrt{2\pi m k_{\mathrm B}T}}.

Helmholtz free energy

Using Eq. (13):

A=−kBTln⁡Q=−kBT ⁣[−ln⁡N!+Nln⁡V−3Nln⁡Λ].A = -k_{\mathrm B}T\ln Q = -k_{\mathrm B}T\!\left[-\ln N! + N\ln V - 3N\ln\Lambda\right].

Applying Stirling’s approximation (ln⁡N!≈Nln⁡N−N\ln N! \approx N\ln N - N):

A≈−NkBT ⁣[ln⁡ ⁣(VNΛ3)+1]A \approx -Nk_{\mathrm B}T\!\left[\ln\!\left(\frac{V}{N\Lambda^3}\right) + 1\right]

Pressure (recovering the ideal gas law)

From Eq. (16), and noting that ln⁡Q\ln Q depends on VV only through the Nln⁡VN\ln V term:

P=kBT ⁣(∂ln⁡Q∂V)T=kBT ⁣(NV)⇒PV=NkBT.P = k_{\mathrm B}T\!\left(\frac{\partial\ln Q}{\partial V}\right)_T = k_{\mathrm B}T\!\left(\frac{N}{V}\right) \quad\Rightarrow\quad PV = Nk_{\mathrm B}T.

The microscopic translational partition function reproduces the macroscopic equation of state. This was also shown in Section 2.5 using the pressure formula stated there; the difference is that we can now trace its origin through the Helmholtz free energy.

Entropy (the Sackur–Tetrode equation)

From Eq. (14), noting that Λ∝T−1/2\Lambda \propto T^{-1/2} so ∂(3Nln⁡Λ)/∂T=−3N/(2T)\partial(3N\ln\Lambda)/\partial T = -3N/(2T):

S=NkB ⁣[ln⁡ ⁣(VNΛ3)+52]S = Nk_{\mathrm B}\!\left[\ln\!\left(\frac{V}{N\Lambda^3}\right) + \frac{5}{2}\right]

This is the Sackur–Tetrode equation for the entropy of an ideal monatomic gas — a result that connects statistical mechanics (through Λ\Lambda and QQ) to a measurable thermodynamic quantity.


Gibbs free energy and non-PVPV work

The Gibbs free energy is defined as

G=H−TS=U+PV−TS.G = H - TS = U + PV - TS.

Its equilibrium differential is

dG=−S dT+V dP.dG = -S\,dT + V\,dP.

But what if the system can do work other than PVPV expansion/compression — for example, electrical work in a battery or an electrolyzer? To see how GG handles this, consider a reversible process that includes both PVPV work and non-PVPV work. The First Law gives

dU=T dS+δwPV,rev+δwnon-PV,rev=T dS−P dV+δwnon-PV,rev.dU = T\,dS + \delta w_{PV,\text{rev}} + \delta w_{\text{non-}PV,\text{rev}} = T\,dS - P\,dV + \delta w_{\text{non-}PV,\text{rev}}.

Substituting into dG=dU+P dV+V dP−T dS−S dTdG = dU + P\,dV + V\,dP - T\,dS - S\,dT:

dG=δwnon-PV,rev+V dP−S dT.dG = \delta w_{\text{non-}PV,\text{rev}} + V\,dP - S\,dT.

At constant TT and PP:

dG∣T,P=δwnon-PV,revdG\Big|_{T,P} = \delta w_{\text{non-}PV,\text{rev}}

Under the most common laboratory conditions (constant TT and PP), changes in GG equal the reversible non-PVPV work. This is why GG is sometimes called the “free energy” — it measures the energy “free” to do useful work beyond unavoidable PVPV work against the atmosphere.

Example: water splitting (electrolysis)

The standard-state water-splitting reaction at room temperature is

H2O(ℓ)→H2(g)+12O2(g),ΔG∘≈+237 kJ mol−1.\mathrm{H_2O(\ell) \rightarrow H_2(g) + \tfrac{1}{2}O_2(g)}, \qquad \Delta G^\circ \approx +237\ \mathrm{kJ\,mol^{-1}}.

Because ΔG∘>0\Delta G^\circ > 0, the reaction is non-spontaneous under standard conditions. It must be driven by supplying non-PVPV work — in this case, electrical work in an electrolyzer. In the reversible limit, the minimum electrical work required per mole equals ΔG∘\Delta G^\circ.


Worked Examples

Example 1: Recovering the ideal-gas law from QQ

Problem. Use the pressure formula Eq. (16) and the monatomic ideal-gas partition function Eq. (20) to derive the equation of state.

Solution.

  1. Compute ln⁡Q\ln Q.

    ln⁡Q=−ln⁡N!+Nln⁡V−3Nln⁡Λ.\ln Q = -\ln N! + N\ln V - 3N\ln\Lambda.
  2. Differentiate with respect to VV. Only the Nln⁡VN\ln V term depends on VV, so

    (∂ln⁡Q∂V)T,N=NV.\left(\frac{\partial\ln Q}{\partial V}\right)_{T,N} = \frac{N}{V}.
  3. Insert into the pressure formula.

    P=kBT NV⇒PV=NkBT.P = k_{\mathrm B}T\,\frac{N}{V} \quad\Rightarrow\quad PV = Nk_{\mathrm B}T.

Result. The microscopic translational partition function reproduces the ideal gas law via derivatives of ln⁡Q\ln Q.


Example 2: Entropy and internal energy of the ideal gas from AA

Problem. Starting from the Helmholtz free energy of the monatomic ideal gas, Eq. (22), derive expressions for SS and UU.

Solution.

The Helmholtz free energy is

A=−NkBT ⁣[ln⁡ ⁣(VNΛ3)+1].A = -Nk_{\mathrm B}T\!\left[\ln\!\left(\frac{V}{N\Lambda^3}\right) + 1\right].

Since Λ=h/2πmkBT\Lambda = h/\sqrt{2\pi m k_{\mathrm B}T}, we have Λ∝T−1/2\Lambda \propto T^{-1/2} and ln⁡Λ=−12ln⁡T+const\ln\Lambda = -\tfrac{1}{2}\ln T + \text{const}. Therefore

A=−NkBT ⁣[ln⁡V−ln⁡N+32ln⁡T+const+1],A = -Nk_{\mathrm B}T\!\left[\ln V - \ln N + \tfrac{3}{2}\ln T + \text{const} + 1\right],

where “const” collects terms independent of TT and VV.

  1. Entropy. Using S=−(∂A/∂T)VS = -(\partial A/\partial T)_V:

    S=NkB ⁣[ln⁡ ⁣(VNΛ3)+52].S = Nk_{\mathrm B}\!\left[\ln\!\left(\frac{V}{N\Lambda^3}\right) + \frac{5}{2}\right].

    This is the Sackur–Tetrode equation.

  2. Internal energy. From U=A+TSU = A + TS:

    U=−NkBT ⁣[ln⁡ ⁣(VNΛ3)+1]+T⋅NkB ⁣[ln⁡ ⁣(VNΛ3)+52]=32NkBT.U = -Nk_{\mathrm B}T\!\left[\ln\!\left(\frac{V}{N\Lambda^3}\right) + 1\right] + T \cdot Nk_{\mathrm B}\!\left[\ln\!\left(\frac{V}{N\Lambda^3}\right) + \frac{5}{2}\right] = \frac{3}{2}Nk_{\mathrm B}T.

Result. Differentiating AA with respect to TT gives the entropy (Sackur–Tetrode), and adding back TSTS recovers the equipartition result U=32NkBTU = \frac{3}{2}Nk_{\mathrm B}T. All thermodynamic properties of the ideal gas follow from a single function, A(T,V,N)A(T,V,N).

Concept Checks

  1. Why do extremum principles involve minimization of a potential rather than maximization of entropy in most lab settings?

  2. In the derivation of Eq. (4), which inequality comes from the Clausius inequality and which comes from the work bound? What physical process does each represent?

  3. Why does AA (not GG) naturally appear for systems at fixed TT and VV?

  4. Equation (29) gives dG∣T,P=δwnon-PV,revdG\big|_{T,P} = \delta w_{\text{non-}PV,\text{rev}} for a reversible process. How does this change for an irreversible process, and what does the change mean for the maximum useful work a spontaneous reaction can deliver?

  5. Why does differentiating the same function A(T,V)A(T,V) give both a thermal quantity (SS) and a mechanical quantity (PP)?

Key Takeaways