Internal Energy from the Partition Function

A gas of N2N_2 molecules at room temperature stores energy in translation, rotation, and vibration all at once. How much energy lives in each mode? Statistical thermodynamics answers this with a single derivative of the partition function, no separate bookkeeping required. This is the payoff of building QQ in the first place: once you have it, thermodynamics falls out by calculus. This matters because it connects a purely combinatorial object, a sum over quantum states weighted by Boltzmann factors, to a measurable macroscopic quantity, the internal energy UU. It is the bridge between microscopic spectroscopy and bulk calorimetry. This article derives UU as a temperature derivative of ln⁡Q\ln Q. It shows how the total energy splits cleanly into translational, rotational, vibrational, and electronic contributions. It closes with two fully worked numerical examples and the equipartition limits you will use constantly in the next chapters.

Key takeaways
  • The internal energy relative to the ground state is U−U(0)=kBT2(∂ln⁡Q/∂T)VU - U(0) = k_BT^2(\partial \ln Q/\partial T)_V.
  • Equivalently, in terms of β=1/kBT\beta = 1/k_BT, U−U(0)=−(∂ln⁡Q/∂β)VU - U(0) = -(\partial \ln Q/\partial \beta)_V.
  • Because QQ factorizes over independent modes, ln⁡Q\ln Q is a sum, so UU is a sum of modal energies.
  • Each fully "active" quadratic degree of freedom contributes 12kBT\tfrac12 k_BT per molecule (equipartition), recovered as a high-temperature limit.
  • Vibrations freeze out at low TT because Θvib≫T\Theta_{vib} \gg T typically, giving contributions far below the equipartition value.
  • Key idea: Differentiating ln⁡Q\ln Q with respect to temperature converts a partition function into the average energy, and because ln⁡Q\ln Q splits additively over modes, so does UU.
The core insight

The internal energy is the ensemble average of energy, U−U(0)=⟨E⟩U - U(0) = \langle E \rangle, and this average is generated automatically by taking kBT2 ∂(ln⁡Q)/∂Tk_BT^2\,\partial(\ln Q)/\partial T, so every mode that contributes additively to ln⁡Q\ln Q contributes additively to UU.

The physical picture

Recall that the canonical partition function is a weighted sum over the accessible states of a system,

Q=∑igie−βεi,Q = \sum_i g_i e^{-\beta \varepsilon_i},

where gig_i is the degeneracy of a state with energy εi\varepsilon_i, measured from the ground state, and β=1/kBT\beta = 1/k_BT. As covered in "Physical Meaning of Beta and Temperature," β\beta sets the currency of exchange between energy and probability: states higher than ∼kBT\sim k_BT above the ground level are exponentially suppressed. QQ counts how many states are thermally accessible, but it also secretly contains the average energy of the system. The connection is that the probability of occupying state ii is pi=gie−βεi/Qp_i = g_i e^{-\beta \varepsilon_i}/Q, and the mean energy is ∑ipiεi\sum_i p_i \varepsilon_i. Differentiating ln⁡Q\ln Q with respect to β\beta generates exactly this weighted sum, because differentiating the exponential brings down a factor of −εi-\varepsilon_i. This is why UU is obtained by calculus on QQ rather than by re-summing anything from scratch. For an ideal gas of independent, distinguishable-in-energy molecules (translational and internal motions separable), the molecular partition function itself factorizes,

q=qtrans qrot qvib qelec,q = q_{trans}\, q_{rot}\, q_{vib}\, q_{elec},

and for NN indistinguishable gas molecules Q=qN/N!Q = q^N/N!. Because ln⁡Q=Nln⁡q−ln⁡N!\ln Q = N\ln q - \ln N!, the factorial term is temperature-independent and drops out of any temperature derivative. Thus ln⁡Q\ln Q becomes a sum of logarithms of modal partition functions, and the derivative distributes the total energy additively across translation, rotation, vibration, and electronic excitation. This additivity is the entire reason the method is powerful: you can compute each mode's partition function separately (a much easier task) and simply add the resulting energies.

Figure
From partition function to internal energy: the derivative route
Q = Σ g_i e^(-βε_i) state sum (partition function) ln ln Q additive over modes ∂/∂T at V U - U(0) = k_B T² (∂ln Q/∂T)_V internal energy q = q_trans q_rot q_vib q_elec factorized modes U = U_trans+U_rot+U_vib+U_elec sum of modal energies

The second useful picture is how each mode's contribution to UU climbs from zero (frozen out at low TT) toward its equipartition ceiling as temperature rises, with vibration lagging far behind translation and rotation because its energy-level spacing is much larger.

Figure
Molar energy contribution per mode versus temperature, schematic
Temperature T (K) U_m per mode (3/2)RT trans RT rot (linear) vibration, rises late Θ_vib ~ 3000 K Θ_rot ~ few K

The core relations

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

where U(0)U(0) is the internal energy at T=0T=0 (all molecules in their ground states), and the derivative is at constant volume (and composition).

U−U(0)=−(∂ln⁡Q∂β)VU - U(0) = -\left(\frac{\partial \ln Q}{\partial \beta}\right)_V

where β=1/kBT\beta = 1/k_BT; this is the same relation in "beta language," often more convenient algebraically.

U−U(0)=−N(∂ln⁡q∂β)V(distinguishable-mode gas, Q=qN/N!)U - U(0) = -N\left(\frac{\partial \ln q}{\partial \beta}\right)_V \quad \text{(distinguishable-mode gas, } Q = q^N/N!\text{)}

where qq is the single-molecule partition function; the N!N! term vanishes upon differentiation.

Um−Um(0)=Um,trans+Um,rot+Um,vib+Um,elecU_m - U_m(0) = U_{m,trans} + U_{m,rot} + U_{m,vib} + U_{m,elec}

where each term is computed from the corresponding factor of qq, molar quantities obtained by multiplying per-molecule energies by Avogadro's constant NAN_A.

Derivation AU as a temperature derivative of ln Q

Goal. Show that kBT2(∂ln⁡Q/∂T)Vk_BT^2(\partial \ln Q/\partial T)_V equals the ensemble-averaged energy ⟨E⟩=U−U(0)\langle E\rangle = U - U(0), starting only from the definition of QQ.

Step 1. Write the average energy explicitly. Each accessible state ii has energy εi\varepsilon_i (measured from the ground state) and probability pi=gie−βεi/Qp_i = g_i e^{-\beta\varepsilon_i}/Q. The mean energy above the ground state is

U−U(0)=∑ipiεi=∑igiεie−βεiQ.U - U(0) = \sum_i p_i \varepsilon_i = \frac{\sum_i g_i \varepsilon_i e^{-\beta \varepsilon_i}}{Q}.

Step 2. Recognize the numerator as a derivative. Differentiate Q=∑igie−βεiQ = \sum_i g_i e^{-\beta \varepsilon_i} with respect to β\beta at constant VV:

(∂Q∂β)V=∑igi(−εi)e−βεi=−∑igiεie−βεi.\left(\frac{\partial Q}{\partial \beta}\right)_V = \sum_i g_i(-\varepsilon_i)e^{-\beta\varepsilon_i} = -\sum_i g_i \varepsilon_i e^{-\beta\varepsilon_i}.

The energies εi\varepsilon_i (eigenvalues of the Hamiltonian at fixed VV) do not depend on β\beta, so this differentiation is exact and no additional terms appear.

Step 3. Divide by QQ and identify ln⁡Q\ln Q. Combining Steps 1 and 2,

U−U(0)=−1Q(∂Q∂β)V=−(∂ln⁡Q∂β)V,U - U(0) = -\frac{1}{Q}\left(\frac{\partial Q}{\partial \beta}\right)_V = -\left(\frac{\partial \ln Q}{\partial \beta}\right)_V,

using the chain rule (∂ln⁡Q/∂β)=(1/Q)(∂Q/∂β)(\partial \ln Q/\partial \beta) = (1/Q)(\partial Q/\partial \beta).

Step 4. Convert back to temperature. Since β=1/(kBT)\beta = 1/(k_BT), we have dβ=−dT/(kBT2)d\beta = -dT/(k_BT^2), so

(∂ln⁡Q∂β)V=(∂ln⁡Q∂T)VdTdβ=−kBT2(∂ln⁡Q∂T)V.\left(\frac{\partial \ln Q}{\partial \beta}\right)_V = \left(\frac{\partial \ln Q}{\partial T}\right)_V \frac{dT}{d\beta} = -k_BT^2\left(\frac{\partial \ln Q}{\partial T}\right)_V.

Substituting into Step 3 flips the sign once more.

Step 5. Box the result.

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

Step 6. Additivity for independent modes. For a molecular gas with Q=qN/N!Q = q^N/N! and q=qtransqrotqvibqelecq = q_{trans}q_{rot}q_{vib}q_{elec},

ln⁡Q=Nln⁡qtrans+Nln⁡qrot+Nln⁡qvib+Nln⁡qelec−ln⁡N!.\ln Q = N\ln q_{trans} + N\ln q_{rot} + N\ln q_{vib} + N\ln q_{elec} - \ln N!.

Since ln⁡N!\ln N! is temperature-independent, differentiating term by term gives U−U(0)U - U(0) as an unweighted sum of four modal contributions, each computed exactly as in Steps 1 through 5 but using the relevant modal qq.

Worked examples

Example 1 — Translational energy of argon gas at 298 K (foundational). The translational partition function of a structureless atom in a container of volume VV is

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

We need ln⁡qtrans\ln q_{trans} as a function of TT only, holding VV fixed:

ln⁡qtrans=32ln⁡T+(terms independent of T).\ln q_{trans} = \frac{3}{2}\ln T + \text{(terms independent of } T\text{)}.

Differentiate:

(∂ln⁡qtrans∂T)V=32T.\left(\frac{\partial \ln q_{trans}}{\partial T}\right)_V = \frac{3}{2T}.

Apply the boxed result per molecule, then multiply by NAN_A for one mole:

Um,trans−Um,trans(0)=NAkBT2×32T=32RT.U_{m,trans} - U_{m,trans}(0) = N_A k_BT^2 \times \frac{3}{2T} = \frac{3}{2}RT.

Numerically, at T=298 KT = 298\ \text{K}, using R=8.314 J K−1mol−1R = 8.314\ \text{J K}^{-1}\text{mol}^{-1}:

Um,trans=32(8.314 J K−1mol−1)(298 K)=3716 J mol−1=3.72 kJ mol−1.U_{m,trans} = \frac{3}{2}(8.314\ \text{J K}^{-1}\text{mol}^{-1})(298\ \text{K}) = 3716\ \text{J mol}^{-1} = 3.72\ \text{kJ mol}^{-1}.

Sanity check: this is the textbook equipartition value 32RT\tfrac32 RT for three translational quadratic degrees of freedom, independent of the atom's mass or the container volume, exactly as required since ln⁡qtrans\ln q_{trans}'s TT-dependence (32ln⁡T\tfrac32\ln T) doesn't involve mm or VV.

Example 2 — Vibrational contribution of CO at 500 K (applied, exam-level). Carbon monoxide has a vibrational wavenumber ν~=2170 cm−1\tilde\nu = 2170\ \text{cm}^{-1}. Model it as a harmonic oscillator with the ground state as the energy zero, so

qvib=11−e−βhcν~.q_{vib} = \frac{1}{1 - e^{-\beta h c \tilde\nu}}.

Define the vibrational temperature Θvib=hcν~/kB\Theta_{vib} = hc\tilde\nu/k_B. First compute Θvib\Theta_{vib}:

hcν~=(6.626×10−34 J s)(2.998×1010 cm s−1)(2170 cm−1)=4.311×10−20 J.hc\tilde\nu = (6.626\times10^{-34}\,\text{J s})(2.998\times10^{10}\,\text{cm s}^{-1})(2170\ \text{cm}^{-1}) = 4.311\times10^{-20}\ \text{J}.
Θvib=4.311×10−20 J1.381×10−23 J K−1=3122 K.\Theta_{vib} = \frac{4.311\times10^{-20}\ \text{J}}{1.381\times10^{-23}\ \text{J K}^{-1}} = 3122\ \text{K}.

The standard result (obtained by differentiating ln⁡qvib=−ln⁡(1−e−Θvib/T)\ln q_{vib} = -\ln(1-e^{-\Theta_{vib}/T}) with respect to TT, exactly following Steps 1–5 with β→Θvib/T\beta \to \Theta_{vib}/T) is

Um,vib−Um,vib(0)=RΘvibeΘvib/T−1.U_{m,vib} - U_{m,vib}(0) = \frac{R\Theta_{vib}}{e^{\Theta_{vib}/T}-1}.

At T=500 KT = 500\ \text{K}, form the ratio:

ΘvibT=3122500=6.244.\frac{\Theta_{vib}}{T} = \frac{3122}{500} = 6.244.
e6.244=515.4,e6.244−1=514.4.e^{6.244} = 515.4, \qquad e^{6.244}-1 = 514.4.
Um,vib=(8.314 J K−1mol−1)(3122 K)514.4=25 957 J mol−1514.4=50.5 J mol−1.U_{m,vib} = \frac{(8.314\ \text{J K}^{-1}\text{mol}^{-1})(3122\ \text{K})}{514.4} = \frac{25\,957\ \text{J mol}^{-1}}{514.4} = 50.5\ \text{J mol}^{-1}.

Sanity check: compare to the equipartition ceiling for one vibrational mode, RT=(8.314)(500)=4157 J mol−1RT = (8.314)(500) = 4157\ \text{J mol}^{-1}. The actual value, 50.5 J/mol, is smaller by a factor of about 82. This confirms the mode is almost entirely frozen out at 500 K because T≪ΘvibT \ll \Theta_{vib} — consistent with CO's stiff triple bond and high vibrational frequency, and it foreshadows why vibrations barely contribute to heat capacity near room temperature.

Limiting cases & common traps

RegimeBehavior of UmU_m per modeWhy
T≫ΘmodeT \gg \Theta_{mode} (translation, rotation at ordinary TT)Equipartition value: 12RT\tfrac12 RT per quadratic termEnergy levels finely spaced compared to kBTk_BT; sum behaves like integral
T≪ΘvibT \ll \Theta_{vib} (vibration near/below 298 K for most molecules)Um,vib→0U_{m,vib}\to 0 exponentially, as RTe−Θvib/TRTe^{-\Theta_{vib}/T}Level spacing ≫kBT\gg k_BT; almost all population in v=0v=0
T→0T \to 0 for any modeU−U(0)→0U - U(0) \to 0Only the ground state is populated; that is the definition of the energy zero
Electronic modes, most molecules near 298 KUm,elec≈0U_{m,elec} \approx 0Gaps typically ≫kBT\gg k_BT unless low-lying excited states exist (e.g., NO, O2_2)

The chemist behind it

The additive, mode-by-mode dissection of energy realized here traces back to the statistical mechanics built by Josiah Willard Gibbs, who formalized the ensemble concept and the free-energy-like role of ln⁡Q\ln Q, and to Ludwig Boltzmann, whose probability distribution over energy states is the microscopic content of pi∝e−βεip_i \propto e^{-\beta\varepsilon_i}. The specific machinery of factorizing molecular partition functions into translational, rotational, and vibrational pieces — the version used daily by physical chemists to compute thermodynamic functions from spectroscopic data — was systematized in the twentieth century, notably in the classic texts that made statistical thermodynamics a routine tool for interpreting heat capacities and equilibrium constants from molecular spectra.

Origins · 1 minJosiah Willard Gibbs and how this was discovered
JW
Josiah Willard Gibbs
1839-1903 · Founded the ensemble formalism that makes ln Q the generating function for all thermodynamic quantities

Ask the tutor: How does this same derivative trick, applied to ln⁡Q\ln Q with respect to VV or NN instead of TT, generate pressure and chemical potential?

Why is U written as U minus U(0) instead of just U

The partition function Q=∑igie−βεiQ = \sum_i g_i e^{-\beta\varepsilon_i} is built with energies εi\varepsilon_i measured relative to the lowest accessible state, chosen as zero for convenience. Differentiating ln⁡Q\ln Q therefore only ever recovers the thermally excited energy above that zero, not any absolute energy scale (rest mass, bond dissociation energy, zero-point vibrational energy). Reporting U−U(0)U - U(0) keeps the formula clean and universal; if you need an absolute internal energy, you add U(0)U(0) separately from a known reference, such as spectroscopic zero-point energies.

How does this connect to heat capacity

Heat capacity at constant volume is CV=(∂U/∂T)VC_V = (\partial U/\partial T)_V, and since U(0)U(0) is temperature-independent, CV=∂(U−U(0))/∂TC_V = \partial (U-U(0))/\partial T. Because U−U(0)U - U(0) splits additively across modes here, so does CVC_V: translational, rotational, vibrational, and electronic contributions each get differentiated separately. This is exactly the route explored next in "Contributions to Heat Capacity from Molecular Modes," where the frozen-out vibrational term explains why diatomic gas heat capacities near room temperature look almost purely translational-plus-rotational.

Does this derivation assume classical or quantum mechanics

Nothing here assumes classical mechanics. The sum Q=∑igie−βεiQ = \sum_i g_i e^{-\beta\varepsilon_i} runs over genuine quantum states with quantized energies εi\varepsilon_i, and the derivative trick works for any discrete or continuous spectrum. Classical equipartition, 12kBT\tfrac12 k_BT per quadratic degree of freedom, emerges only as a high-temperature limit where level spacing becomes negligible compared to kBTk_BT, which is why translation and rotation look "classical" at room temperature but vibration usually does not.

Why does N factor out for translational and rotational but the formula still uses q rather than Q directly

For a gas of 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!. Differentiating with respect to TT or β\beta kills the ln⁡N!\ln N! term because it carries no temperature dependence, leaving U−U(0)=−N(∂ln⁡q/∂β)VU - U(0) = -N(\partial \ln q/\partial\beta)_V. Working with the single-molecule qq is simpler because spectroscopic data (bond lengths, vibrational frequencies, electronic term energies) naturally give you qq, not QQ.

Before this

Where this leads