Other Thermodynamic Functions from the Partition Function

A cylinder of gas pushes on a piston with a pressure you can measure on a gauge. That single number, pp, is hiding inside the molecular partition function QQ all along. Once you know how to extract internal energy UU and entropy SS from QQ, every other thermodynamic function falls out by pure algebra, no new physics required. This matters because chemists rarely want UU or SS alone. Reaction spontaneity needs Gibbs energy. Compressibility needs pressure as a function of volume. Bomb versus flow calorimetry needs the difference between UU and HH. Statistical thermodynamics only earns its keep as a working tool once it can deliver all four classical state functions from one partition function. This article builds AA, pp, HH, and GG systematically from QQ. You will see the master equation A=−kBTln⁡QA = -k_BT\ln Q derived. Then each remaining function follows from a derivative of AA. Two fully worked examples show the machinery on a real gas. The article closes by pointing toward equilibrium constants, the next payoff of this framework.

Key takeaways
  • The Helmholtz energy is the hub: A=−kBTln⁡QA = -k_BT\ln Q, derived directly from UU and SS.
  • Pressure follows from AA by a volume derivative: p=−(∂A/∂V)Tp = -(\partial A/\partial V)_T.
  • Enthalpy combines UU with the pVpV term, giving a clean partition-function expression for ideal gases.
  • Gibbs energy G=A+pVG = A + pV becomes remarkably simple for an ideal gas: it depends only on q/Nq/N through ln⁡\ln.
  • All four functions require nothing beyond ln⁡Q\ln Q and its first derivatives with respect to TT and VV.
  • Key idea: every classical thermodynamic function is a derivative of −kBTln⁡Q-k_BT\ln Q, so one partition function generates the entire state-function family.
The core insight

Because A=−kBTln⁡QA = -k_BT\ln Q is a complete thermodynamic potential in TT and VV, its total differential dA=−S dT−p dVdA = -S\,dT - p\,dV supplies SS and pp directly as derivatives of ln⁡Q\ln Q, and simple algebraic combinations then generate UU, HH, and GG without any further statistical input.

The physical picture

Earlier development of this framework established two results. The internal energy is

U−U(0)=kBT2(∂ln⁡Q∂T)VU - U(0) = k_BT^2\left(\frac{\partial \ln Q}{\partial T}\right)_V

and the entropy is

S=U−U(0)T+kBln⁡QS = \frac{U - U(0)}{T} + k_B \ln Q

Both came from treating QQ as an encoding of how molecular states populate with temperature. Now notice something structural: UU and TSTS combine to give exactly kBTln⁡Qk_BT\ln Q, apart from a sign and the zero-point term. That combination is not a coincidence — it is the Helmholtz energy, and it is the single quantity from which everything else in classical thermodynamics can be regenerated by differentiation. Think of AA as a thermodynamic "master key." In classical thermodynamics, A(T,V)A(T,V) is a complete potential: knowing AA as a function of TT and VV lets you compute SS, pp, UU, HH, and GG by taking derivatives and forming simple combinations, with no additional experimental input needed. Statistical thermodynamics reaches the same destination from a different starting point — molecular energy levels packaged into QQ — but the destination, the web of functions in the figure below, is identical.

Figure
The thermodynamic web radiating from A = −k_BT ln Q
A = −k_BT ln Q the hub function S = −(∂A/∂T)_V p = −(∂A/∂V)_T U = A + TS H = U + pV G = A + pV Every downstream box needs only ln Q and its T, V derivatives.

The second useful picture is quantitative rather than schematic: how pressure, built from −(∂A/∂V)T-(\partial A/\partial V)_T, reduces exactly to nRT/VnRT/V for an ideal gas because ln⁡Q\ln Q depends on VV only through the translational factor ln⁡V\ln V.

Figure
Why ideal-gas pressure emerges from ln Q depending on V only through translation
Q(T,V,N) = q(T,V)^N / N!, q = q_trans(V) · q_rot · q_vib · q_elec ln Q = N ln q_trans(V) + N ln(q_rot q_vib q_elec) − ln N! only this term depends on V q_trans = V (2πmk_BT/h²)^(3/2) ⇒ ∂ln q_trans/∂V = 1/V p = k_BT (∂ln Q/∂V)_T = N k_BT / V = nRT / V Ideal-gas law recovered directly from Q

The core relations

A−A(0)=−kBTln⁡QA - A(0) = -k_BT \ln Q

where: A(0)=U(0)A(0) = U(0) is the zero-point Helmholtz energy, and QQ is the canonical partition function.

p=−(∂A∂V)T=kBT(∂ln⁡Q∂V)Tp = -\left(\frac{\partial A}{\partial V}\right)_T = k_BT\left(\frac{\partial \ln Q}{\partial V}\right)_T

where: the derivative is taken at constant temperature and particle number.

H−H(0)=U−U(0)+pVH - H(0) = U - U(0) + pV

where: for an ideal gas pV=NkBTpV = Nk_BT, so H−H(0)=U−U(0)+NkBTH - H(0) = U - U(0) + Nk_BT.

G−G(0)=A−A(0)+pV=−kBTln⁡Q+NkBTG - G(0) = A - A(0) + pV = -k_BT\ln Q + Nk_BT

where: for indistinguishable ideal-gas molecules this collapses to G−G(0)=−NkBTln⁡(q/N)−NkBT+NkBT=−NkBTln⁡(q/N)G - G(0) = -Nk_BT\ln(q/N) - Nk_BT + Nk_BT = -Nk_BT\ln(q/N)... the clean form is derived below.

G−G(0)=−nRTln⁡(qN)G - G(0) = -nRT\ln\left(\frac{q}{N}\right)

where: qq is the molecular partition function, NN the number of molecules, n=N/NAn = N/N_A.

Derivation AFrom ln Q to A, p, H, and G

Goal. Starting only from the established expressions for UU and SS in terms of QQ, derive AA, then obtain pp, HH, and GG as consequences, specializing at the end to an ideal gas of independent, indistinguishable molecules.

Step 1: Assemble the Helmholtz energy. The Helmholtz energy is defined thermodynamically as A=U−TSA = U - TS. Insert the statistical expressions,

A−A(0)=[U−U(0)]−T[U−U(0)T+kBln⁡Q]A - A(0) = \left[U - U(0)\right] - T\left[\frac{U-U(0)}{T} + k_B\ln Q\right]

The U−U(0)U - U(0) terms cancel exactly, leaving

A−A(0)=−kBTln⁡QA - A(0) = -k_BT\ln Q

This is remarkable: the entire temperature dependence of UU has canceled, and AA depends on QQ through a single logarithm. No derivative of QQ is needed to get AA itself — only for the functions built from it.

Step 2: Extract pressure from the volume dependence of AA. Classical thermodynamics gives the exact differential dA=−S dT−p dVdA = -S\,dT - p\,dV for a closed system, so

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

Substitute A−A(0)=−kBTln⁡QA - A(0) = -k_BT\ln Q, noting A(0)A(0) is volume-independent for a gas whose zero-point energy does not shift with container size:

p=kBT(∂ln⁡Q∂V)Tp = k_BT\left(\frac{\partial \ln Q}{\partial V}\right)_T

This is now a completely general recipe: given any Q(T,V,N)Q(T,V,N), differentiate its logarithm with respect to VV and multiply by kBTk_BT.

Step 3: Specialize to an ideal gas to see pp become familiar. For NN independent, indistinguishable molecules, Q=qN/N!Q = q^N/N!, so

ln⁡Q=Nln⁡q−ln⁡N!\ln Q = N\ln q - \ln N!

Only the molecular partition function qq depends on volume, and it does so solely through the translational factor,

qtrans=V(2πmkBTh2)3/2q_{\text{trans}} = V\left(\frac{2\pi m k_BT}{h^2}\right)^{3/2}

so ∂ln⁡q/∂V=1/V\partial \ln q/\partial V = 1/V exactly, independent of the rotational, vibrational, and electronic factors (which carry no VV-dependence). Therefore

p=kBT⋅N⋅1V=NkBTV=nRTVp = k_BT \cdot N \cdot \frac{1}{V} = \frac{Nk_BT}{V} = \frac{nRT}{V}

the ideal gas law, obtained without ever assuming it.

Step 4: Build enthalpy from UU and pVpV. Enthalpy is defined as H=U+pVH = U + pV with no statistical content of its own — it is a bookkeeping combination. Using the ideal-gas pressure from Step 3,

H−H(0)=[U−U(0)]+NkBT=kBT2(∂ln⁡Q∂T)V+NkBTH - H(0) = \left[U - U(0)\right] + Nk_BT = k_BT^2\left(\frac{\partial \ln Q}{\partial T}\right)_V + Nk_BT

Step 5: Build Gibbs energy from AA and pVpV. Similarly G=A+pVG = A + pV, so using Step 1 and Step 3,

G−G(0)=−kBTln⁡Q+NkBTG - G(0) = -k_BT\ln Q + Nk_BT

Substitute ln⁡Q=Nln⁡q−ln⁡N!\ln Q = N\ln q - \ln N! and use Stirling's approximation, ln⁡N!≈Nln⁡N−N\ln N! \approx N\ln N - N:

G−G(0)=−kBT(Nln⁡q−Nln⁡N+N)+NkBTG - G(0) = -k_BT\left(N\ln q - N\ln N + N\right) + Nk_BT
G−G(0)=−NkBTln⁡q+NkBTln⁡N−NkBT+NkBTG - G(0) = -Nk_BT\ln q + Nk_BT\ln N - Nk_BT + Nk_BT
G−G(0)=−NkBTln⁡(qN)=−nRTln⁡(qN)\boxed{G - G(0) = -Nk_BT\ln\left(\frac{q}{N}\right) = -nRT\ln\left(\frac{q}{N}\right)}

The −NkBT-Nk_BT and +NkBT+Nk_BT terms cancel exactly — a small algebraic miracle that only happens for GG, not for AA, and it is why GG is the natural function to use for indistinguishable-particle gases in equilibrium calculations.

Worked examples

Example 1 — Foundational: Gibbs energy of argon gas at 298 K. Compute G−G(0)G - G(0) for 1.00 mol of argon at 298 K confined to 24.79 dm³ (1 bar standard molar volume), using only translational and electronic contributions (argon is monatomic, so no rotational or vibrational factors, and the ground electronic state is non-degenerate). Step 1: molecular mass and thermal wavelength.

m=39.95×10−3 kg mol−16.022×1023 mol−1=6.634×10−26 kgm = \frac{39.95 \times 10^{-3}\ \text{kg mol}^{-1}}{6.022 \times 10^{23}\ \text{mol}^{-1}} = 6.634\times 10^{-26}\ \text{kg}
Λ=h(2πmkBT)1/2\Lambda = \frac{h}{(2\pi m k_BT)^{1/2}}

Numerically, with h=6.626×10−34h = 6.626\times10^{-34} J s, kB=1.381×10−23k_B = 1.381\times10^{-23} J K⁻¹, T=298T = 298 K:

2πmkBT=2π(6.634×10−26)(1.381×10−23)(298)=1.716×10−45 kg2m2s−22\pi m k_B T = 2\pi (6.634\times10^{-26})(1.381\times10^{-23})(298) = 1.716\times10^{-45}\ \text{kg}^2\text{m}^2\text{s}^{-2}
(2πmkBT)1/2=4.142×10−23 kg m s−1(2\pi m k_BT)^{1/2} = 4.142\times10^{-23}\ \text{kg m s}^{-1}
Λ=6.626×10−344.142×10−23=1.600×10−11 m\Lambda = \frac{6.626\times10^{-34}}{4.142\times10^{-23}} = 1.600\times10^{-11}\ \text{m}

Step 2: translational partition function.

qtrans=VΛ3,V=24.79×10−3 m3q_{\text{trans}} = \frac{V}{\Lambda^3}, \quad V = 24.79\times10^{-3}\ \text{m}^3
Λ3=(1.600×10−11)3=4.096×10−33 m3\Lambda^3 = (1.600\times10^{-11})^3 = 4.096\times10^{-33}\ \text{m}^3
qtrans=2.479×10−24.096×10−33=6.051×1030q_{\text{trans}} = \frac{2.479\times10^{-2}}{4.096\times10^{-33}} = 6.051\times10^{30}

Step 3: q/Nq/N.

N=NA=6.022×1023N = N_A = 6.022\times10^{23}
qN=6.051×10306.022×1023=1.005×107\frac{q}{N} = \frac{6.051\times10^{30}}{6.022\times10^{23}} = 1.005\times10^{7}

Step 4: Gibbs energy.

G−G(0)=−nRTln⁡(q/N)=−(1.00)(8.314 J K−1mol−1)(298 K)ln⁡(1.005×107)G - G(0) = -nRT\ln(q/N) = -(1.00)(8.314\ \text{J K}^{-1}\text{mol}^{-1})(298\ \text{K})\ln(1.005\times10^7)
ln⁡(1.005×107)=16.12\ln(1.005\times10^{7}) = 16.12
G−G(0)=−(8.314)(298)(16.12)=−3.994×104 J mol−1=−39.9 kJ mol−1G - G(0) = -(8.314)(298)(16.12) = -3.994\times10^{4}\ \text{J mol}^{-1} = -39.9\ \text{kJ mol}^{-1}

Sanity check: q/N≫1q/N \gg 1 confirms the classical (Maxwell–Boltzmann, non-degenerate) limit is valid, and the negative sign correctly reflects that a gas expanding to fill accessible translational states lowers GG relative to the hypothetical T=0T=0 crystal-like reference. The magnitude, tens of kJ/mol, matches tabulated statistical entropies of monatomic gases (argon's standard molar entropy is about 154.8 J K⁻¹mol⁻¹, and −TS≈−46-TS \approx -46 kJ/mol is the right order of magnitude once U−U(0)=32RT≈3.7U-U(0) = \tfrac{3}{2}RT \approx 3.7 kJ/mol is added back).

Example 2 — Applied: pressure and enthalpy correction for a diatomic gas. For 2.00 mol of CO gas at 350 K in a 10.0 dm³ vessel, verify that the partition-function route reproduces the ideal gas pressure, and compute H−H(0)H - H(0) using the rotational contribution to ∂ln⁡Q/∂T\partial\ln Q/\partial T. Take the rotational constant B=1.9313B = 1.9313 cm⁻¹ and treat vibration as fully frozen (only the ground state populated, contributing zero to ∂ln⁡Q/∂T\partial \ln Q/\partial T at 350 K, since θvib≈3103\theta_{\text{vib}} \approx 3103 K for CO). Step 1: pressure from QQ. Since only translation depends on VV, Step 3 of the derivation gives directly

p=nRTV=(2.00 mol)(8.314 J K−1mol−1)(350 K)10.0×10−3 m3p = \frac{nRT}{V} = \frac{(2.00\ \text{mol})(8.314\ \text{J K}^{-1}\text{mol}^{-1})(350\ \text{K})}{10.0\times10^{-3}\ \text{m}^3}
p=58200.0100=5.82×105 Pa=5.82 barp = \frac{5820}{0.0100} = 5.82\times10^{5}\ \text{Pa} = 5.82\ \text{bar}

This matches the ordinary ideal gas law calculation exactly, confirming Step 3 of the derivation for a real (non-monatomic) molecule: rotation and vibration are irrelevant to pp because they carry no volume dependence. Step 2: translational contribution to U−U(0)U - U(0).

Utrans−Utrans(0)=32nRT=32(2.00)(8.314)(350)=8730 J=8.73 kJU_{\text{trans}} - U_{\text{trans}}(0) = \tfrac{3}{2}nRT = \tfrac{3}{2}(2.00)(8.314)(350) = 8730\ \text{J} = 8.73\ \text{kJ}

Step 3: rotational contribution. For a linear molecule with θrot=hcB/kB\theta_{\text{rot}} = hcB/k_B, first find θrot\theta_{\text{rot}}:

θrot=hcBkB=(6.626×10−34)(2.998×1010 cm s−1)(1.9313 cm−1)1.381×10−23\theta_{\text{rot}} = \frac{hcB}{k_B} = \frac{(6.626\times10^{-34})(2.998\times10^{10}\ \text{cm s}^{-1})(1.9313\ \text{cm}^{-1})}{1.381\times10^{-23}}
=3.836×10−231.381×10−23=2.778 K= \frac{3.836\times10^{-23}}{1.381\times10^{-23}} = 2.778\ \text{K}

Since T=350 K≫θrotT = 350\ \text{K} \gg \theta_{\text{rot}}, the high-temperature (equipartition) limit applies:

Urot−Urot(0)=nRT=(2.00)(8.314)(350)=5820 J=5.82 kJU_{\text{rot}} - U_{\text{rot}}(0) = nRT = (2.00)(8.314)(350) = 5820\ \text{J} = 5.82\ \text{kJ}

Step 4: total internal energy change and enthalpy.

U−U(0)=8.73+5.82+0 (vib)=14.55 kJU - U(0) = 8.73 + 5.82 + 0\ (\text{vib}) = 14.55\ \text{kJ}
pV=nRT=5820 J=5.82 kJpV = nRT = 5820\ \text{J} = 5.82\ \text{kJ}
H−H(0)=(U−U(0))+pV=14.55+5.82=20.37 kJH - H(0) = (U-U(0)) + pV = 14.55 + 5.82 = 20.37\ \text{kJ}

Sanity check: for a linear molecule with translation and rotation fully active but vibration frozen, kinetic theory predicts CV=52RC_V = \tfrac{5}{2}R and Cp=72RC_p = \tfrac{7}{2}R, so H−H(0)H - H(0) should equal nCpT=2.00×3.5×8.314×350=20,370 Jn C_p T = 2.00 \times 3.5 \times 8.314 \times 350 = 20{,}370\ \text{J} — matching to four significant figures. The partition-function route and classical equipartition agree exactly in this high-temperature regime, as they must.

Limiting cases & common traps

SituationWhat happensWhy
q/N≫1q/N \gg 1 (dilute gas, high TT)Maxwell–Boltzmann statistics valid, GG formula holdsClassical limit of quantum statistics
q/N≲1q/N \lesssim 1Formula for GG breaks downIndistinguishability correction from N!N! becomes inadequate; need Fermi–Dirac or Bose–Einstein statistics
T→0T \to 0A,G→U(0)A, G \to U(0); ln⁡Q→ln⁡(ground degeneracy)\ln Q \to \ln(\text{ground degeneracy})Only the ground state is populated
Rigid rotor, harmonic oscillatorH−H(0)H - H(0), U−U(0)U - U(0) differ only by nRTnRT (ideal gas)pV=nRTpV = nRT exactly regardless of internal structure
Solids/liquidsp≠nRT/Vp \ne nRT/V; must differentiate the actual Q(V)Q(V)Translational factor no longer separates as VΛ−3V\Lambda^{-3}

The chemist behind it

The bridge from molecular partition functions to bulk thermodynamic functions was built by Josiah Willard Gibbs, who invented the ensemble formalism underlying QQ itself, and refined into practical chemical use by Richard Chace Tolman and later systematized in the textbooks of McQuarrie. Gibbs's 1902 treatise Elementary Principles in Statistical Mechanics introduced the canonical ensemble and showed that A=−kBTln⁡QA = -k_BT\ln Q (in his notation, using the "index of probability") reproduces every classical thermodynamic relation, work that predates the Schrödinger equation and yet remains the operational backbone of every statistical thermodynamics course today.

Origins · 1 minJosiah Willard Gibbs and how this was discovered
JW
Josiah Willard Gibbs
1839–1903 · American mathematical physicist who founded statistical mechanics and chemical thermodynamics, connecting microscopic ensembles to macroscopic state functions

Ask the tutor: How does the same q/N≫1q/N \gg 1 condition that validates classical statistics here also guarantee that equilibrium constants built from partition functions match experiment?

Why does the Helmholtz energy simplify so much compared to U or S?

Because A=U−TSA = U - TS, and the statistical formulas for UU and SS share an identical U−U(0)U - U(0) term that cancels exactly when you subtract TSTS from UU. What remains is just −kBTln⁡Q-k_BT\ln Q, with no leftover temperature derivative. This is not a numerical coincidence — it reflects that AA is the natural potential of the canonical ensemble, the one whose logarithm-of-partition-function form is built into the ensemble's definition from the start, before any derivatives are taken.

Why is Gibbs energy, not Helmholtz energy, used for equilibrium constants?

Chemical reactions are usually run at constant pressure and temperature, the natural variables of GG, not at constant volume, the natural variables of AA. The compact formula G−G(0)=−nRTln⁡(q/N)G - G(0) = -nRT\ln(q/N) also isolates the molecular partition function per particle, q/Nq/N, which is exactly the quantity that appears when partition functions of reactants and products are compared to build an equilibrium constant, foreshadowed in the next stage of this framework.

Does the pressure formula p = nRT/V hold for all gases, or only ideal ones?

It holds whenever the partition function factorizes as Q=qN/N!Q = q^N/N! with qq containing a translational factor proportional to VV, and no other volume dependence. This is the defining condition of an ideal gas: molecules that do not interact, so their available volume enters only through translational kinetic energy levels. Real gases have intermolecular potentials that make qq, and hence QQ, depend on VV in additional ways, producing deviations captured by virial or van der Waals corrections.

What goes wrong if I forget the N! in Q = q^N/N! when computing G?

Omitting N!N! leaves an extra +kBTln⁡N!+k_BT\ln N! in AA, which via Stirling's approximation is roughly NkBT(ln⁡N−1)Nk_BT(\ln N - 1), an enormous spurious term of order 102410^{24} times kBTk_BT for a mole of gas. It also destroys the exact cancellation that produces the clean −NkBTln⁡(q/N)-Nk_BT\ln(q/N) result for GG, replacing a well-behaved intensive-looking expression with a wildly incorrect extensive miscount, sometimes called the Gibbs paradox when entropy is computed instead.

Before this

Where this leads