---
title: "Equipartition and the Virial Theorem"
module: The Classical Ideal Gas
moduleNumber: 5
lessonNumber: 2
order: 502
summary: >
  The equipartition theorem derived from the canonical ensemble: every phase-space
  coordinate that enters the Hamiltonian quadratically carries a mean energy
  $\tfrac12 k_BT$. The generalized form $\langle x_i\,\partial H/\partial x_j\rangle
  = k_BT\,\delta_{ij}$ contains equipartition and the classical virial theorem as
  special cases. Equipartition fixes the classical heat capacities, fails by
  quantum freeze-out when a level gap exceeds $k_BT$, and shifts for a relativistic
  gas whose energy is linear rather than quadratic in momentum.
topics: [The Classical Ideal Gas]
sources:
  - book: Reif
    ref: "Ch. 7 — Simple Applications of Statistical Mechanics; §7.5"
  - book: Schroeder
    ref: "Ch. 6 — Boltzmann Statistics; §6.3 The Equipartition Theorem"
  - book: Kardar (Statistical Physics of Particles)
    ref: "Ch. 4 — Classical Statistical Mechanics; §4.9"
  - book: Tipler & Llewellyn
    ref: "Ch. 8 — Statistical Physics; §8-1 Classical Statistics"
draft: false
---

Equipartition assigns a fixed mean energy to each quadratic term in the
Hamiltonian, independent of the coefficient in front of it. It is the reason a
monatomic gas has $U = \tfrac32 Nk_BT$, a diatomic gas at room temperature has
$\tfrac52 Nk_BT$, and a classical solid obeys the Dulong–Petit law. The theorem is
a one-line consequence of a Gaussian integral, but its scope is broader than the
translational kinetic energy: the same argument covers rotational and vibrational
modes, the potential energy of an oscillator, and, in generalized form, the virial
theorem that links kinetic energy to the forces that confine a system. The places
where equipartition fails are as informative as where it holds, and they are all
failures of the classical assumption that energy varies continuously.

## Equipartition for one quadratic coordinate

Let one of the phase-space variables — call it $x$, standing for any coordinate or
momentum — enter the Hamiltonian through a single quadratic term,

$$
H = a\,x^2 + H'(\text{rest}),
$$

where $a>0$ is a constant and $H'$ does not depend on $x$. The canonical average of
the energy stored in that term is a ratio of Gaussian integrals,

$$
\langle a x^2\rangle
= \frac{\displaystyle\int_{-\infty}^{\infty} a x^2\, e^{-\beta a x^2}\,\d x}
       {\displaystyle\int_{-\infty}^{\infty} e^{-\beta a x^2}\,\d x},
$$

with the $H'$ factors cancelling between numerator and denominator. A compact way
to evaluate the ratio differentiates the denominator with respect to $\beta$. With
$I(\beta) = \int e^{-\beta a x^2}\,\d x = \sqrt{\pi/\beta a}$,

$$
\langle a x^2\rangle = -\frac{1}{I}\frac{\partial I}{\partial\beta}
= -\frac{\partial \ln I}{\partial\beta}
= -\frac{\partial}{\partial\beta}\!\left(-\tfrac12\ln\beta + \text{const}\right)
= \frac{1}{2\beta} = \frac{1}{2}k_B T.
$$

The coefficient $a$ has dropped out entirely: a stiff mode and a soft mode store the
same mean thermal energy. This is the essential content of the theorem.

> **Equipartition theorem.** In classical statistical mechanics, each term of the
> Hamiltonian that is quadratic in one phase-space coordinate contributes a mean
> energy $\tfrac12 k_BT$ to the equilibrium internal energy. If the Hamiltonian has
> $f$ independent quadratic terms, then $\langle H\rangle = \tfrac12 f\,k_BT$ and
> the heat capacity is $C_V = \tfrac12 f\,k_B$.

$$
% caption: The Boltzmann weight $e^{-\beta a x^2}$ over a quadratic coordinate is a Gaussian; its variance sets $\langle a x^2\rangle=\tfrac12 k_BT$ regardless of the stiffness $a$. A stiffer mode (narrow curve) and a softer mode (wide curve) store the same mean energy.
\begin{tikzpicture}[>=Latex,font=\footnotesize,scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->,black] (-3.2,0)--(3.2,0) node[right,black]{$x$};
\draw[->,black] (0,0)--(0,3.0) node[above,black]{weight};
\draw[acc,very thick] plot[domain=-3.0:3.0,samples=90] (\x,{2.7*exp(-1.4*\x*\x)});
\draw[black,very thick,dashed] plot[domain=-3.0:3.0,samples=90] (\x,{2.7*exp(-0.4*\x*\x)});
\node[acc,align=left] at (1.9,2.35) {stif\/f mode};
\node[black,align=left] at (2.55,1.15) {soft mode};
\end{tikzpicture}
$$

## Heat capacities from counting quadratic terms

The power of the theorem is that it reduces the internal energy to a count. A
monatomic gas has three quadratic kinetic terms per particle,
$H_i = (p_{ix}^2+p_{iy}^2+p_{iz}^2)/2m$, so $f = 3N$ and $U = \tfrac32 Nk_BT$,
$C_V = \tfrac32 Nk_B$. A rigid diatomic molecule adds two rotational terms,
$\tfrac12 I\omega_1^2 + \tfrac12 I\omega_2^2$, for the two axes perpendicular to the
bond, giving $f = 5$ per molecule, $U = \tfrac52 Nk_BT$, $C_V = \tfrac52 Nk_B$.

A classical solid is the cleanest count. Each atom sits in a three-dimensional
harmonic well, contributing three quadratic kinetic terms and three quadratic
potential terms,

$$
H_i = \frac{\vec p_i\,^2}{2m} + \frac12 m\omega^2\,\vec r_i\,^2,
\qquad f = 6\ \text{per atom}.
$$

Then $U = 3Nk_BT$ and $C_V = 3Nk_B$, the **Dulong–Petit law**: the molar heat
capacity of a monatomic solid is $3R$, independent of the material. Each atom
carries $\tfrac12 k_BT$ six times over, three from motion and three from the springs
that hold it in place.

$$
% caption: Equipartition as a ledger of quadratic terms, each worth $\tfrac12 k_BT$. A monatomic gas has three (translation); a rigid diatomic adds two (rotation); a classical solid has six per atom (three kinetic, three potential), giving Dulong–Petit $C_V=3Nk_B$.
\begin{tikzpicture}[>=Latex,font=\footnotesize,scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->,black] (0,-0.3)--(0,4.4) node[above,black]{$\frac{C_V}{Nk_B}$};
\foreach \y in {0.5,1.0,...,3.0} \draw[black] (0,\y*1.2)--(6.6,\y*1.2);
% monatomic bar to 1.5
\draw[very thick,fill=black!6] (0.5,0)rectangle(1.7,1.8);
\node[black] at (1.1,-0.55) {monatomic};
\node[black] at (1.1,2.1) {$\tfrac32$};
% diatomic bar to 2.5
\draw[very thick,fill=black!6] (2.6,0)rectangle(3.8,3.0);
\node[black] at (3.2,-0.55) {diatomic};
\node[black] at (3.2,3.3) {$\tfrac52$};
% solid bar to 3.0
\draw[very thick,fill=black!6] (4.7,0)rectangle(5.9,3.6);
\node[black] at (5.3,-0.55) {solid};
\node[black] at (5.3,3.9) {$3$};
\end{tikzpicture}
$$

## The generalized equipartition theorem

The single-coordinate result generalizes to a statement about any phase-space
variable and any derivative of the Hamiltonian. Let $x_i$ be one of the $6N$
canonical coordinates $\{q,p\}$, and consider the average $\langle x_i\,\partial H/\partial x_j\rangle$
over the canonical distribution $\rho\propto e^{-\beta H}$. Writing the average as a
phase-space integral and integrating by parts in $x_j$,

$$
\left\langle x_i\frac{\partial H}{\partial x_j}\right\rangle
= \frac{\displaystyle\int x_i\,\frac{\partial H}{\partial x_j}\,e^{-\beta H}\,\d\Gamma}
       {\displaystyle\int e^{-\beta H}\,\d\Gamma}
= -\frac{1}{\beta}\,\frac{\displaystyle\int x_i\,\frac{\partial}{\partial x_j}e^{-\beta H}\,\d\Gamma}
                        {\displaystyle\int e^{-\beta H}\,\d\Gamma}.
$$

Integrating the numerator by parts, the boundary term vanishes because $e^{-\beta H}\to 0$
as any momentum grows without bound and at the walls of the container, leaving
$\int (\partial x_i/\partial x_j)\,e^{-\beta H}\,\d\Gamma = \delta_{ij}\int e^{-\beta H}\,\d\Gamma$.
Hence the **generalized equipartition theorem**,

$$
\left\langle x_i\,\frac{\partial H}{\partial x_j}\right\rangle = k_B T\,\delta_{ij}.
$$

Two specializations recover the familiar results. Taking $x_i = x_j = p$ for a
momentum that appears as $p^2/2m$ gives $\langle p\,\partial H/\partial p\rangle
= \langle p^2/m\rangle = k_BT$, so $\langle p^2/2m\rangle = \tfrac12 k_BT$, the
kinetic form. Taking $x_i = x_j = q$ for a coordinate in a potential term
$\tfrac12\kappa q^2$ gives $\langle q\,\partial H/\partial q\rangle = \langle\kappa q^2\rangle = k_BT$,
so the potential energy $\langle\tfrac12\kappa q^2\rangle = \tfrac12 k_BT$. The
harmonic oscillator therefore holds $k_BT$ in total, split evenly between kinetic
and potential energy — the double count that gives the solid its factor of six.

## The virial theorem

Summing the generalized theorem over the coordinate part yields the classical
virial theorem. For $N$ particles with positions $\vec r_i$ and the total force
$\vec F_i = -\partial H/\partial \vec r_i$ on each, set $x_i = q$ and $x_j = q$ for
each Cartesian position component and add. The diagonal generalized-equipartition
identity $\langle \vec r_i\cdot\partial H/\partial\vec r_i\rangle = 3k_BT$ per
particle becomes, after summing over the $N$ particles,

$$
\left\langle \sum_{i} \vec r_i\cdot\vec F_i\right\rangle = -3N k_B T.
$$

The quantity $\mathcal V = \tfrac12\sum_i\vec r_i\cdot\vec F_i$ is the **virial** of
Clausius, and the theorem relates its average to the temperature. For an ideal gas
the only forces are the wall reactions confining the particles, and evaluating the
wall virial reproduces $PV = Nk_BT$; the same relation, extended to interparticle
forces, generates the virial expansion of a non-ideal gas.

$$
% caption: The virial theorem splits the confining forces on the particles into the wall reaction (ideal-gas pressure) and the interparticle forces. For an ideal gas only the wall term survives and $\langle\sum \vec r_i\cdot\vec F_i\rangle=-3Nk_BT$ reproduces $PV=Nk_BT$.
\begin{tikzpicture}[>=Latex,font=\footnotesize,scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\draw[black,very thick] (0,0) rectangle (5.0,3.2);
\foreach \p in {(1.0,1.0),(2.2,2.3),(3.6,0.9),(2.9,1.7),(4.1,2.4),(1.6,2.6)}{\filldraw[black!70] \p circle (1.8pt);}
% wall reaction arrows pointing inward
\draw[->,acc,very thick] (0,1.6)--(0.55,1.6);
\draw[->,acc,very thick] (5.0,1.6)--(4.45,1.6);
\draw[->,acc,very thick] (2.5,0)--(2.5,0.55);
\draw[->,acc,very thick] (2.5,3.2)--(2.5,2.65);
\node[acc] at (3.9,3.5) {wall reaction};
\node[black] at (1.2,3.5) {ideal gas: no pair forces};
\end{tikzpicture}
$$

## Quantum freeze-out

Equipartition is a classical theorem, and its assumption is that the energy of a
mode varies continuously so that the Gaussian integral is over an unrestricted real
variable. Real modes are quantized, with a level spacing $\Delta\varepsilon$. When
$k_BT\gg\Delta\varepsilon$ the levels are effectively continuous and equipartition
holds; when $k_BT\ll\Delta\varepsilon$ the mode cannot be excited beyond its ground
state, its mean energy saturates, and its contribution to the heat capacity
vanishes. The mode is **frozen out**.

The vibrational mode of a diatomic molecule is the standard example. Its level
spacing $\hbar\omega$ corresponds to a temperature $\theta_{\rm vib}=\hbar\omega/k_B$
of order $10^3$ K, far above room temperature, so vibration is frozen and does not
contribute the $k_BT$ that equipartition would assign. Rotation, with a much smaller
spacing $\theta_{\rm rot}$ of order $10$ K, is active at room temperature but
freezes below it. The heat capacity therefore rises in steps as temperature crosses
each characteristic scale, and only in the high-temperature plateau of every mode
does the full equipartition count apply.

$$
% caption: A quantized mode with level spacing $\Delta\varepsilon$. For $k_BT\gg\Delta\varepsilon$ many levels are populated, the spectrum is effectively continuous, and equipartition gives $\tfrac12 k_BT$ per quadratic term. For $k_BT\ll\Delta\varepsilon$ only the ground level is occupied and the mode is frozen, contributing nothing to $C_V$.
\begin{tikzpicture}[>=Latex,font=\footnotesize,scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
% left: hot, many levels populated
\foreach \n in {0,1,2,3,4} \draw[acc,very thick] (0,\n*0.55)--(1.6,\n*0.55);
\draw[black,very thick,<->] (2.0,0)--(2.0,2.2) node[midway,right,black]{$k_BT$};
\node[black,align=center] at (0.8,-0.55) {hot: active};
% right: cold, only ground
\begin{scope}[xshift=5.2cm]
\foreach \n in {0,1,2,3,4} \draw[black,very thick] (0,\n*0.55)--(1.6,\n*0.55);
\draw[acc,very thick] (0,0)--(1.6,0);
\draw[black,very thick,->] (2.0,0)--(2.0,0.42) node[above,black]{$k_BT$};
\node[black,align=center] at (0.8,-0.55) {cold: frozen};
\end{scope}
\end{tikzpicture}
$$

## The relativistic gas as a contrast

Equipartition depends on the energy being quadratic in the phase-space variable, so
a mode whose energy is not quadratic carries a different mean energy. The
ultrarelativistic gas is the sharp case: a particle with $\varepsilon = c\,|\vec p|$
has energy linear in the momentum magnitude. The generalized theorem still applies
with $\langle p\,\partial H/\partial p\rangle = k_BT$ per momentum, but now
$p\,\partial\varepsilon/\partial p = p\cdot c = \varepsilon$ for each of the three
Cartesian directions gives, on summing, $\langle\varepsilon\rangle = 3k_BT$ per
particle rather than $\tfrac32 k_BT$. A homogeneous energy of degree $s$ in the
momentum, $\varepsilon\propto p^s$, gives $\langle\varepsilon\rangle = (3/s)\,k_BT$;
the nonrelativistic quadratic case is $s=2$ and the ultrarelativistic linear case is
$s=1$. The mean energy per particle, and with it the equation of state relating
pressure to energy density, tracks the degree of the dispersion relation, not the
mere count of momentum components.

## Summary

- Each quadratic term in the classical Hamiltonian contributes $\tfrac12 k_BT$ to
  the mean energy, independent of its coefficient: a Gaussian-integral fact.
- Counting quadratic terms gives $U = \tfrac12 f\,k_BT$ and $C_V = \tfrac12 f\,k_B$:
  $f=3$ per monatomic particle, $5$ for a rigid diatomic, $6$ per atom in a
  classical solid (Dulong–Petit, $C_V = 3Nk_B$).
- The generalized theorem $\langle x_i\,\partial H/\partial x_j\rangle = k_BT\,\delta_{ij}$
  contains both the kinetic and potential forms; summed over positions it gives the
  virial theorem $\langle\sum\vec r_i\cdot\vec F_i\rangle = -3Nk_BT$, which returns
  $PV = Nk_BT$ for an ideal gas.
- Equipartition fails by quantum freeze-out when a level gap exceeds $k_BT$: the
  mode saturates and drops out of $C_V$, producing the temperature staircase of the
  molecular heat capacity.
- For a dispersion $\varepsilon\propto p^s$ the mean energy is $(3/s)k_BT$ per
  particle; the nonrelativistic gas is $s=2$, the ultrarelativistic gas $s=1$ with
  $\langle\varepsilon\rangle = 3k_BT$.
