Virial Equation of State
Every real gas obeys only in the limit of vanishing density. Squeeze it even slightly and molecules begin to feel one another — and the pressure departs from the ideal law in a way that is not chaotic but exquisitely organized. The virial equation of state writes the compressibility factor as a power series in the number density : . The leading is the ideal gas; the first correction captures everything that happens when two molecules meet, when three cluster, and so on. It is the systematic, controlled bridge from the ideal gas to the fully interacting fluid. The second virial coefficient is the star of the theory because it is both computable and measurable. Computable: it is a single integral over the pair potential, , the thermally weighted "excluded-or-attracted" volume of one molecular pair. Measurable: it is read directly off low-pressure data. Its temperature dependence is a fingerprint of the forces between molecules — positive and roughly constant at high temperature where the hard repulsive core dominates, negative at low temperature where the attractive tail wins, and passing through zero at a special temperature. That zero is the Boyle temperature , where a real gas mimics an ideal one to first order in density over an extended pressure range. Above it repulsion dominates and (harder to compress than ideal); below it attraction dominates and . The van der Waals equation is nothing but the leading virial correction resummed — the microscopic integral is what connects the phenomenological constants and to the actual shape of the intermolecular potential. This article owns that integral, its hard-sphere and square-well evaluations, and the sign story behind .
- The virial equation of state expands the pressure in powers of number density: , reducing to as .
- The second virial coefficient is — a single integral over the pair potential, the workhorse of the whole theory.
- Its sign encodes the physics: hard-core repulsion makes (gas harder to compress); attraction makes . They cancel at the Boyle temperature , where .
- For hard spheres of diameter , — exactly four times the molecular volume, the classic excluded-volume result.
- The van der Waals equation is the leading virial correction resummed: with the excluded volume and the attraction, giving .
- The series is asymptotic and breaks down at condensation — a phase transition cannot be reached by any finite-order density expansion.
- Key idea: the second virial coefficient turns the microscopic pair potential directly into the first correction to the ideal gas, and the sign of — repulsion versus attraction — governs whether a gas is harder or easier to compress than ideal.
The second virial coefficient is the thermally averaged excluded-or-attracted volume of one molecular pair. It converts the microscopic pair potential straight into the leading correction to the ideal gas law, and its sign — positive for repulsion, negative for attraction — decides whether the gas is harder or easier to compress than ideal, vanishing at the Boyle temperature.
Where this lives today
The virial equation of state remains the cleanest quantitative bridge between intermolecular forces and thermodynamics. In precision metrology, the second virial coefficient of helium is now computed from first-principles quantum chemistry to parts per million and used to realize the thermodynamic temperature scale by acoustic and dielectric gas thermometry — the equation of state of a dilute noble gas is a primary standard. In chemical engineering, truncated virial equations (through ) model moderately dense gases and gas mixtures more accurately than cubic equations, with combining rules for the cross coefficient of unlike molecules. In the theory of simple liquids, the Mayer cluster expansion that generates the virial coefficients is the starting point for integral-equation and perturbation theories of dense fluids. And the low-temperature quantum correction — a second virial coefficient arising from statistics alone, with no forces — is measured directly in the equation of state of He and He, a textbook demonstration of quantum statistics entering thermodynamics through the thermal de Broglie wavelength.
The physical picture
Picture a gas dilute enough that any given molecule spends almost all its time alone, feeling no forces, moving in a straight line. The pressure is then the ideal . The first correction comes from the rare, brief encounters when two molecules drift close enough to interact. The second virial coefficient is precisely the average effect of one such encounter: how much a pair, weighted by its Boltzmann factor, either excludes volume from each other (repulsion, raising the pressure) or draws together (attraction, lowering it). The natural variable is the Mayer function , which is nonzero only where the potential acts. Deep inside a repulsive core the potential is enormous, so and — a full "hole" where the molecules cannot overlap. In an attractive well , so and . Far apart, and . The whole virial machinery is bookkeeping for these localized bumps and dips.
The second figure is the punchline: how itself behaves as temperature changes. At high temperature, thermal energy overwhelms the shallow attractive well; molecules bounce off the hard core and is positive, approaching the excluded-volume constant . At low temperature the attractive tail dominates — molecules linger near each other — and swings negative. In between there is exactly one crossing point, the Boyle temperature , where the repulsion and attraction cancel to first order and the gas looks ideal.
The core equations
The organizing statement is the density expansion of the pressure. It is the definition of the virial coefficients and the reason the theory is called an "equation of state" — it gives as a function of and order by order.
where: — pressure; — number density; — temperature; — the -th virial coefficient (per-particle convention), a pure function of ; — the compressibility factor, equal to for an ideal gas. Reading it: each successive term corrects for larger clusters of interacting molecules; truncating after captures all two-body physics. The content of is a single integral over the pair potential, built from the Mayer function.
where: — the pair potential at separation ; ; — the relative-coordinate volume element (angular integration gives the and the factor of ). Reading it: the integrand is in a hard core (a hole of excluded volume, positive contribution to ) and positive in an attractive well (negative contribution). The sign of is the competition between these. For a hard sphere of diameter the integral collapses to a pure geometric result.
where: — the hard-core diameter; — the volume of one molecule (a sphere of radius ). Reading it: the excluded volume per pair is four times the volume of a single molecule — the classic result, because two spheres of diameter cannot approach closer than center-to-center, carving out a forbidden sphere of radius (volume ) shared between the pair, hence each. Adding a shallow attractive tail and expanding for weak attraction gives the van der Waals form and the Boyle temperature.
where: — the excluded-volume constant (temperature-independent, repulsive); — the attraction constant (from the well); — the Boyle temperature. Reading it: at high the term is negligible and ; at low it dominates and ; they cancel at .
The goal is to derive from first principles — to show that the leading correction to the ideal gas pressure is exactly the integrated Mayer function of a single pair. The strategy is to write the canonical configuration integral with the Boltzmann factor of each pair as , keep only single-bond terms at low density, and read off the coefficient of the pressure. This is the first step of the full Mayer cluster expansion; higher coefficients follow the same diagrammatic bookkeeping.
Step 1. Write the -particle configuration integral , where is the Mayer function and the is the correct Boltzmann counting for indistinguishable particles.
Step 2. Expand the product . At low density the leading correction is the single-bond term; there are identical pair terms by translational invariance.
Step 3. The free-energy (or ) contribution of the single-bond term is , so the pressure picks up once the logarithm and the density conversion are taken. Why the minus sign and the factor of a half. The half comes from double-counting each pair once (); the minus sign appears when the fugacity/density inversion converts the connected pair integral in into the density coefficient — the sign flip is what makes a repulsive core (where ) give a positive .
Step 4. Match to and perform the angular integration (): , equation (2). Verified: the hard-sphere evaluation (with inside the core) and its identity with are confirmed symbolically in verify_aq-sm-virial-equation-of-state.py.
Go deeper · Derivation B · 1 minHard sphere, square well, and the van der Waals equation
The goal is to evaluate in closed form for the two canonical model potentials — the hard sphere and the square well — and to show that the square-well result, expanded for weak attraction, is exactly the van der Waals , delivering the Boyle temperature. The strategy is to split the Mayer integral into the repulsive core (where ) and the attractive well (where ), integrate each region, and expand.
Step 1. Hard sphere: for (so ) and for (so ). Then . This is positive and temperature-independent: pure excluded volume.
Step 2. Identify the excluded volume. One molecule has volume , so . The factor of four is geometric: two spheres of diameter exclude a sphere of radius (volume ), shared as per molecule.
Step 3. Square well: add an attractive shell for (so ) and beyond. The well contributes , giving .
Step 4. Weak attraction, : expand , so with and . Setting gives the Boyle temperature . Why resumming gives van der Waals. Promoting the excluded-volume term (the correct hard-core resummation) and isolating the attraction turns into , the van der Waals equation of state. Verified: the square-well closed form, the weak-attraction reduction to , and the Boyle temperature are all confirmed symbolically in the verify script.
Limiting cases
The virial series interpolates between known regimes; each row is a limit or a special potential.
| Case | Result | Meaning |
|---|---|---|
| Ideal gas, | , | No interactions; recovered. |
| Hard spheres, diameter | Positive, -independent excluded volume. | |
| Boyle temperature | Repulsion and attraction cancel; gas ideal to first order in . | |
| High (repulsion wins) | Gas harder to compress than ideal, . | |
| Low (attraction wins) | Gas easier to compress than ideal, . | |
| Ideal quantum gas | Statistics alone give : bosons (attractive), fermions (repulsive). |
Worked examples
Example 1 — The second virial coefficient of nitrogen from its van der Waals constants (enumerate, apply, boundary number). Nitrogen has van der Waals constants and . Find its molar second virial coefficient at and the fractional deviation of the pressure from ideal at .
Step 1. Enumerate the two contributions. Repulsion (excluded volume): . Attraction: .
Step 2. Apply . It is negative: at the attractive tail of nitrogen still outweighs the excluded-volume repulsion, so nitrogen is slightly easier to compress than an ideal gas.
Step 3. Boundary number. At and the molar density is , so the deviation is , about — nitrogen at room conditions is ideal to better than one part in a thousand. (The van der Waals estimate overestimates the attraction; the measured value is about , but both are negative and tiny at .)
Example 2 — Excluded volume and Boyle temperature of a hard-core molecule. Model a small molecule as a hard sphere of diameter , then estimate its Boyle temperature using nitrogen's attraction.
Step 1. The molecular volume is .
Step 2. The excluded-volume (repulsive) second virial coefficient is per molecule, or per mole — the same order as nitrogen's , confirming the model.
Step 3. Boundary number. Using nitrogen's , the Boyle temperature is . Above nitrogen is harder to compress than ideal (); below it, easier (). The measured Boyle temperature of nitrogen is about — the van der Waals model gets the right scale and sign, overestimating by the same crude-attraction factor seen in Example 1.
Origins · 1 minvirial expansion and how this was discovered
The virial equation of state grew from two threads. Johannes Diderik van der Waals, in his 1873 doctoral thesis, wrote the first equation of state including molecular size (the constant ) and attraction (the constant ), for which he received the 1910 Nobel Prize. Heike Kamerlingh Onnes, the low-temperature pioneer who first liquefied helium, introduced the systematic power-series form and coined the term "virial coefficients" in 1901, organizing the deviations from ideality order by order in density. The microscopic foundation — expressing each coefficient as a cluster integral over the intermolecular potential — was completed by Joseph Mayer and Maria Goeppert Mayer in the 1930s. The name "virial" traces to Clausius's virial of mechanics, since the pressure correction is literally the configurational virial of the intermolecular forces.
Going further
References. Pathria & Beale, Statistical Mechanics, 3rd ed., Ch. 10 (cluster expansion and virial coefficients) · Kardar, Statistical Physics of Particles, Ch. 5 (interacting particles, cluster expansion) · Reif, Fundamentals of Statistical and Thermal Physics, Ch. 10 · Landau & Lifshitz, Statistical Physics Part 1, §74–76 · Hansen & McDonald, Theory of Simple Liquids, Ch. 3.
Provenance. The density expansion , the Mayer form , and the model evaluations are standard (Pathria Ch. 10, Kardar Ch. 5). A verifier should confirm: (i) hard-sphere from inside the core; (ii) the identity with ; (iii) the square-well closed form and its weak-attraction reduction to ; (iv) the Boyle temperature ; (v) the sign limits as and as ; (vi) numerics — hard-sphere , nitrogen vdW (measured ), . All checks are in verify_aq-sm-virial-equation-of-state.py. Constants: , , .
Builds on: Classical Ideal Gas · Virial Theorem in Statistical Mechanics · Correct Boltzmann Counting · Thermal de Broglie Wavelength Leads to: van der Waals Equation · Mayer Cluster Expansion · Classical Limit of Quantum Statistics
Why does the second virial coefficient depend only on the pair potential?
Because at order in the density expansion, only diagrams with exactly two molecules joined by a single Mayer bond contribute. Three-body correlations first appear at order in , which contains the triple product . So to leading order beyond ideal, the only encounters that matter are isolated pairs — one molecule meeting one other — and is a pure pair quantity, computable from the two-body potential alone without knowing anything about many-body structure.
Where does the factor of 4 in the hard-sphere excluded volume come from?
Two hard spheres of diameter cannot have their centers closer than . So around any one molecule there is a forbidden sphere of radius (not ) that another center cannot enter — its volume is , where is one molecule's actual volume. Because this excluded region is shared between the two molecules of a pair, each is charged with half of it: . The counterintuitive factor of four is a purely geometric consequence of "closest approach is , not ."
Is the gas truly ideal at the Boyle temperature?
No — only to first order in density. At the second virial coefficient vanishes, , so the leading correction to the pressure disappears and the gas obeys over an extended low-to-moderate pressure range. But the higher coefficients are generally nonzero, so at high enough density deviations reappear at order . The Boyle temperature is therefore a very useful single-number characterization of a gas — the temperature where it best mimics ideality — but not a claim that intermolecular forces have somehow switched off.
How is B₂ measured experimentally?
From low-pressure data. You measure the compressibility factor at several densities and fit ; the initial slope of versus (as ) is exactly . Repeating at several temperatures maps out , whose zero crossing gives the Boyle temperature and whose shape is fitted to model potentials (Lennard-Jones, square well) to extract the well depth and range . Because is the initial density slope, it is one of the most direct experimental windows onto intermolecular forces.
Why can a quantum ideal gas have a nonzero B₂ with no forces at all?
Because quantum statistics act like an effective interaction. Even with , the requirement that the many-body wavefunction be symmetric (bosons) or antisymmetric (fermions) under exchange correlates the positions of identical particles: bosons are effectively drawn together (an attractive "statistical potential") and fermions kept apart (repulsive). Carrying this through the partition function gives a second virial coefficient , with the thermal de Broglie wavelength setting the scale — negative for bosons, positive for fermions. It is measured directly in the equation of state of He and He and is a clean demonstration that statistics alone produce thermodynamic consequences.
Does the virial series converge, and what happens at condensation?
The virial series is asymptotic, not convergent across a phase transition. As density rises toward the gas-liquid transition, the cluster sum that generates the coefficients develops a singularity, and the successive partial sums stop improving — the radius of convergence shrinks to the condensation density. This is a deep point: a phase transition, being non-analytic, cannot be reached by any finite-order expansion in density. The breakdown of the virial series is itself the signal of condensation, connecting the expansion to the Mayer and Yang-Lee theories of the gas-liquid transition. In practice the series is trustworthy for dilute-to-moderate gases and is truncated at or .
How does the virial equation relate to the virial theorem of mechanics?
The name and the physics both come from Clausius's virial. The virial theorem gives the pressure as , where the second term is the configurational virial of the intermolecular forces. Expanding that force average in powers of density reproduces exactly the virial equation of state, with arising as the two-body configurational virial. So the "virial coefficients" are literally the density expansion of the mechanical virial of the forces — the equation of state is the virial theorem, organized order by order in .