Fiveable

🎲Statistical Mechanics Unit 5 Review

QR code for Statistical Mechanics practice questions

5.6 Virial theorem

5.6 Virial theorem

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
🎲Statistical Mechanics
Unit & Topic Study Guides

Virial Theorem Fundamentals

The virial theorem connects a system's average kinetic energy to its average potential energy. This relationship turns out to be remarkably useful: it lets you extract information about complex many-body systems without solving every equation of motion. From the behavior of real gases to the structure of galaxies, the virial theorem provides a direct link between microscopic forces and macroscopic observables.

Definition and Origin

Rudolf Clausius formulated the virial theorem in 1870. The name comes from the Latin word vis, meaning force. The core statement is straightforward: for a stable, bound system of particles, the time-averaged total kinetic energy T\langle T \rangle is related to the virial Φ\langle \Phi \rangle by

2T=Φ2\langle T \rangle = -\langle \Phi \rangle

The virial Φ\Phi is defined as the sum over all particles of the dot product of each particle's position with the force acting on it:

Φ=iriFi\Phi = \sum_i \mathbf{r}_i \cdot \mathbf{F}_i

For a potential that scales as a power law VrnV \propto r^n, the theorem simplifies to 2T=nV2\langle T \rangle = n\langle V \rangle. Gravity, for instance, has n=1n = -1, giving 2T=V2\langle T \rangle = -\langle V \rangle. The Coulomb potential also has n=1n = -1, so the same relation holds for electrostatic systems.

Applications in Physics

  • Thermodynamics: Predicts how real gases deviate from ideal behavior through the virial expansion.
  • Astrophysics: Determines the stability and internal temperatures of stars, and estimates total masses of galaxies and clusters.
  • Molecular dynamics: Computes pressures and stress tensors in simulations of liquids and solids.
  • Plasma physics: Analyzes confinement and energy balance in high-temperature plasmas.
  • Equations of state: Provides a systematic route from pair interactions to bulk thermodynamic properties.

Derivation of the Virial Theorem

Classical Mechanics Approach

The derivation starts from a quantity called the virial function GG, defined as:

G=ipiriG = \sum_i \mathbf{p}_i \cdot \mathbf{r}_i

where pi\mathbf{p}_i and ri\mathbf{r}_i are the momentum and position of particle ii.

  1. Take the time derivative of GG: dGdt=ip˙iri+ipir˙i\frac{dG}{dt} = \sum_i \dot{\mathbf{p}}_i \cdot \mathbf{r}_i + \sum_i \mathbf{p}_i \cdot \dot{\mathbf{r}}_i

  2. Recognize that p˙i=Fi\dot{\mathbf{p}}_i = \mathbf{F}_i (Newton's second law) and pir˙i=2Ti\mathbf{p}_i \cdot \dot{\mathbf{r}}_i = 2T_i (twice the kinetic energy of particle ii). So: dGdt=iFiri+2T\frac{dG}{dt} = \sum_i \mathbf{F}_i \cdot \mathbf{r}_i + 2T

  3. For a bound, stable system, GG remains finite and bounded. Over a long time interval τ\tau, the time average of dGdt\frac{dG}{dt} vanishes: dGdt=G(τ)G(0)τ0as τ\left\langle \frac{dG}{dt} \right\rangle = \frac{G(\tau) - G(0)}{\tau} \to 0 \quad \text{as } \tau \to \infty

  4. Setting the time average to zero gives the classical virial theorem: 2T=iriFi2\langle T \rangle = -\left\langle \sum_i \mathbf{r}_i \cdot \mathbf{F}_i \right\rangle

The key assumption is that the system is bound, so positions and momenta don't diverge. If the system is expanding or dissipating, the dGdt\frac{dG}{dt} term doesn't vanish and the theorem breaks down.

Statistical Mechanics Approach

In the canonical ensemble, you can derive the same result without time averages:

  1. Start from the canonical partition function and the Hamiltonian H=T+VH = T + V.
  2. Use the identity xiHxj=δijkBT\left\langle x_i \frac{\partial H}{\partial x_j} \right\rangle = \delta_{ij} k_B T, which follows from integration by parts over phase space (assuming the distribution vanishes at the boundaries).
  3. Summing over all coordinates yields 2T=iriFi2\langle T \rangle = -\langle \sum_i \mathbf{r}_i \cdot \mathbf{F}_i \rangle, exactly matching the classical result.

The ergodic hypothesis justifies equating these ensemble averages with the time averages from the classical derivation.

Virial Expansion

The virial expansion is the most direct application of virial-theorem ideas to the thermodynamics of gases. It systematically corrects the ideal gas law by accounting for particle interactions.

Series Representation

The compressibility factor Z=PVnRTZ = \frac{PV}{nRT} equals 1 for an ideal gas. For a real gas, it's expanded as a power series in the number density ρ=N/V\rho = N/V:

Z=1+B2(T)ρ+B3(T)ρ2+B4(T)ρ3+Z = 1 + B_2(T)\rho + B_3(T)\rho^2 + B_4(T)\rho^3 + \cdots

Each successive term captures interactions among larger clusters of particles:

  • B2(T)B_2(T): pairwise interactions (two-body)
  • B3(T)B_3(T): three-body interactions
  • B4(T)B_4(T): four-body interactions, and so on

At low to moderate densities, truncating after B2B_2 or B3B_3 is usually sufficient. Familiar model equations of state like van der Waals and Redlich-Kwong can be viewed as specific truncations or resummations of this series.

Coefficients and Interpretation

The second virial coefficient B2(T)B_2(T) is the most important in practice. It's calculated directly from the pair interaction potential u(r)u(r):

B2(T)=2π0[eu(r)/kBT1]r2drB_2(T) = -2\pi \int_0^{\infty} \left[ e^{-u(r)/k_BT} - 1 \right] r^2 \, dr

  • Negative B2B_2: attractive forces dominate (gas is easier to compress than ideal).
  • Positive B2B_2: repulsive forces dominate (gas resists compression more than ideal).
  • At the Boyle temperature, B2=0B_2 = 0 and the gas behaves approximately ideally at moderate densities.

Higher-order coefficients are harder to compute because they involve multi-body integrals, but they become important near the critical point or at high densities. Virial coefficients can also be measured experimentally from precise PVT data.

Virial Theorem in Astrophysics

Gravitational systems are where the virial theorem really shines, because gravity has the clean power-law form Vr1V \propto r^{-1}, giving the simple relation 2T=V2\langle T \rangle = -\langle V \rangle.

Definition and origin, Virial theorem - Knowino

Stellar Structure Analysis

For a self-gravitating star in hydrostatic equilibrium, the virial theorem relates the total gravitational potential energy to the thermal energy of the stellar interior. This leads to a useful estimate of central temperature: for a star of mass MM and radius RR,

TcentralGMμkBRT_{\text{central}} \sim \frac{GM\mu}{k_B R}

where μ\mu is the mean particle mass. This relation explains why more massive stars are hotter and more luminous. The virial theorem also governs stellar pulsations (like Cepheid variables): a star that contracts converts gravitational energy into thermal energy, and the virial theorem quantifies that conversion.

Galaxy Dynamics

The virial theorem lets astronomers estimate the total mass of a galaxy or cluster from velocity measurements alone. If you measure the velocity dispersion v2\langle v^2 \rangle of stars or galaxies in a bound system of radius RR, the virial mass is approximately:

MvirialRv2GM_{\text{virial}} \sim \frac{R \langle v^2 \rangle}{G}

When this was applied to galaxy clusters (Fritz Zwicky did this in the 1930s), the virial mass turned out to be much larger than the visible mass. This was one of the earliest pieces of evidence for dark matter. The same approach helps explain flat rotation curves in spiral galaxies.

Virial Theorem for Gases

Ideal Gas Applications

For a gas of NN non-interacting particles in a container, the only forces are from the container walls. The virial theorem gives:

PV=23NTkinPV = \frac{2}{3}N\langle T_{\text{kin}} \rangle

Combined with the equipartition result Tkin=32kBT\langle T_{\text{kin}} \rangle = \frac{3}{2}k_BT per particle, this directly yields the ideal gas law PV=NkBTPV = Nk_BT. The virial theorem thus provides a clean derivation of the ideal gas law from mechanics, without needing to invoke any thermodynamic postulates.

Real Gas Corrections

When intermolecular forces are included, the virial of the internal forces adds correction terms to the pressure equation. These corrections are exactly the virial coefficients discussed earlier. The virial approach naturally accounts for:

  • Attractive interactions at moderate distances (which reduce pressure below ideal)
  • Hard-core repulsion at short distances (which increase pressure above ideal)
  • The Joule-Thomson effect: whether a gas cools or heats upon expansion depends on the sign and magnitude of B2(T)B_2(T) and its temperature derivative
  • Behavior near the critical point, where higher-order virial coefficients become significant

Virial Theorem in Quantum Mechanics

Quantum Mechanical Formulation

The quantum virial theorem replaces classical time averages with expectation values. For a system in a stationary state with potential V(r)V(\mathbf{r}):

2T=rV2\langle T \rangle = \langle \mathbf{r} \cdot \nabla V \rangle

For any potential of the form VrnV \propto r^n, this becomes 2T=nV2\langle T \rangle = n\langle V \rangle, just like the classical case. For Coulomb systems (n=1n = -1):

T=12V\langle T \rangle = -\frac{1}{2}\langle V \rangle

and the total energy satisfies E=T+V=12V=TE = \langle T \rangle + \langle V \rangle = \frac{1}{2}\langle V \rangle = -\langle T \rangle. This means knowing any one of EE, T\langle T \rangle, or V\langle V \rangle immediately gives you the other two.

The quantum virial theorem connects to the Hellmann-Feynman theorem and can be extended to time-dependent situations through the Ehrenfest theorem.

Helium Atom Example

The helium atom is a classic test case because it has two electrons and can't be solved exactly. The virial theorem constrains the solution:

  • The exact ground state energy must satisfy T=E\langle T \rangle = -E and V=2E\langle V \rangle = 2E.
  • Variational trial wavefunctions can be checked for consistency: if your trial wavefunction doesn't satisfy the virial theorem, it can be improved by scaling the coordinates (this is the basis of virial scaling).
  • For helium, the electron-electron repulsion partially screens the nuclear charge. The virial theorem helps quantify this screening: the effective nuclear charge seen by each electron is about Zeff1.69Z_{\text{eff}} \approx 1.69 rather than 2.

Limitations and Extensions

Definition and origin, Virial theorem - Knowino

Assumptions and Constraints

The virial theorem holds under specific conditions. Be aware of when it breaks down:

  • The system must be bound and stable with finite spatial extent. Expanding or evaporating systems violate the key assumption that dG/dt=0\langle dG/dt \rangle = 0.
  • It requires long-time averages (or equivalently, equilibrium ensemble averages). Transient or strongly driven systems may not satisfy it.
  • Forces must be conservative. Dissipative forces (friction, radiation damping) require modified treatments.
  • The classical version ignores quantum effects. For systems where \hbar matters, you need the quantum formulation.
  • Strongly non-linear or chaotic systems may have extremely slow convergence of the time average.

Generalized Virial Theorems

Several extensions handle situations the basic theorem can't:

  • Tensor virial theorem: Replaces the scalar relation with a tensor equation, useful for anisotropic systems like rotating stars or triaxial galaxies.
  • Time-dependent virial theorem: Keeps the d2Idt2\frac{d^2I}{dt^2} term, applicable to collapsing clouds or oscillating systems.
  • Relativistic virial theorem: Incorporates special-relativistic corrections for high-energy systems.
  • Magnetic virial theorem: Adds magnetic field contributions, important for magnetized plasmas and neutron stars.

Experimental Verification

Laboratory Measurements

  • Gas PVT measurements: Precise compressibility data confirm virial coefficient predictions. The temperature dependence of B2(T)B_2(T) has been measured for many gases and matches statistical-mechanical calculations from known pair potentials.
  • Plasma confinement: Magnetic confinement experiments in fusion research use virial-theorem-based diagnostics to assess energy balance.
  • Atomic spectroscopy: Measured energy levels of hydrogen-like atoms are consistent with the Coulomb virial relation T=E\langle T \rangle = -E.

Astronomical Observations

  • Galaxy cluster masses: X-ray observations of hot intracluster gas, combined with virial estimates, give mass values consistent with gravitational lensing measurements.
  • Galaxy rotation curves: Virial mass estimates from velocity dispersions consistently exceed visible mass, supporting the dark matter hypothesis.
  • Stellar models: Predicted central temperatures from virial arguments agree with values inferred from nuclear reaction rates and neutrino observations.

Virial Theorem vs. Equipartition Theorem

These two theorems are complementary tools in statistical mechanics. Understanding when to use each one matters.

FeatureVirial TheoremEquipartition Theorem
RelatesKinetic energy to potential energyEnergy to degrees of freedom
Key result2T=nV2\langle T \rangle = n\langle V \rangle for power-law potentialsEi=12kBT\langle E_i \rangle = \frac{1}{2}k_BT per quadratic DOF
RequiresBound system, time-averaged stabilityThermal equilibrium, classical regime
Quantum validityYes (with expectation values)Fails when kBTωk_BT \ll \hbar\omega
Best forStructure and stability questionsCounting energy contributions

They work together naturally. For an ideal gas, equipartition gives T=32NkBT\langle T \rangle = \frac{3}{2}Nk_BT, and the virial theorem converts that into PV=NkBTPV = Nk_BT. In astrophysics, equipartition tells you the thermal energy per particle, while the virial theorem tells you whether the system is gravitationally bound.

Computational Methods

Numerical Simulations

The virial theorem is built into many computational techniques:

  • Molecular dynamics (MD): The virial expression is the standard way to compute pressure in MD simulations of liquids and solids.
  • N-body simulations: Astrophysical simulations track the virial ratio 2T/V2T/|V| to monitor whether a system has reached equilibrium. A virialized system has this ratio near 1.
  • Monte Carlo methods: Virial-based estimators are used to compute pressures and equations of state.
  • Density functional theory (DFT): The quantum virial theorem serves as a consistency check on computed electronic energies.

Virial Calculations in Molecular Dynamics

In an MD simulation, the pressure is computed from the virial expression:

P=1V(23K+13i<jrijFij)P = \frac{1}{V}\left(\frac{2}{3}\langle K \rangle + \frac{1}{3}\left\langle \sum_{i<j} \mathbf{r}_{ij} \cdot \mathbf{F}_{ij} \right\rangle\right)

where rij\mathbf{r}_{ij} is the separation vector and Fij\mathbf{F}_{ij} is the force between particles ii and jj. The first term is the ideal (kinetic) contribution; the second is the virial correction from interactions.

For non-isotropic systems, this generalizes to a pressure tensor, which is essential for computing stress in solids or at interfaces. Fluctuations in the virial also give access to thermodynamic response functions like the isothermal compressibility and heat capacity.