Corrections to the Ideal Gas
The ideal-gas law is a beautiful lie. It says the pressure of a gas depends only on how many molecules you pack into a box and how hot they are — never on what the molecules are. Argon, nitrogen, and steam would all push on the walls identically at the same density and temperature. Real gases obey this only in the limit of vanishing density; the moment molecules are close enough to feel one another, two competing effects appear. Molecules take up room and cannot interpenetrate, a short-range repulsion that raises the pressure above ideal; and they attract one another across the intervening space, a longer-range pull that lowers it. This article is about the first honest correction to the fiction, and how much physics is already hiding in it. The organizing idea is that deviations from ideality are a power series in the number density — the virial expansion . Each coefficient measures how a cluster of molecules, feeling their mutual potential , changes the equation of state. The leading coefficient is a single, finite integral over the pair potential, and it alone reveals excluded volume, molecular attraction, and a special temperature — the Boyle temperature — where a real gas mimics an ideal one to first order in density. What makes this the gateway to the whole theory of interacting gases is that is both computable and measurable. Feed in a model potential like Lennard-Jones and you predict from first principles; measure it from pressure-volume data and you test the potential. And when you resum the leading repulsive and attractive pieces, out drops the van der Waals equation — the first equation of state ever written that knows about liquids. This article states the problem and interprets ; the cluster machinery that produces it lives in the sibling articles it points to.
- Real gases deviate from because molecules have finite size (repulsion, raises pressure) and attract one another (lowers pressure); both vanish only as .
- The deviations are organized as a power series in the number density : the virial expansion .
- The second virial coefficient (with the Mayer function ) is a single finite integral over the pair potential — positive when repulsion wins, negative when attraction wins.
- For a hard core plus attraction it splits as with excluded volume ; this reproduces the van der Waals equation.
- The Boyle temperature is where and the gas is "accidentally ideal"; for argon K.
- Key idea: every deviation from the ideal gas is governed by one small parameter — the density — and the leading coefficient is a finite, computable integral over the pair potential that already encodes excluded volume, attraction, and the Boyle temperature.
Deviations from ideal-gas behavior are governed by a single small parameter, the density , and the leading coefficient is a finite, computable integral over the pair potential that encodes excluded volume, molecular attraction, and the Boyle temperature all at once.
Where this lives today
The second virial coefficient is no longer merely a textbook correction — it underpins primary metrology. For helium, the pair (and even three-body) potentials can now be computed from first-principles quantum chemistry to extraordinary accuracy, and the resulting and are calculated with uncertainties smaller than any measurement. Acoustic and dielectric-constant gas thermometry exploits exactly these ab-initio virial coefficients to realize the kelvin and to help fix the value of the Boltzmann constant in the 2019 redefinition of the SI. A quantity introduced to fudge the ideal-gas law now helps define temperature itself. At the other end, the virial framework remains the backbone of engineering thermodynamics. Truncated virial series and their descendants — van der Waals, Redlich–Kwong, Peng–Robinson — are the working equations of state for gases and refrigerants, and the cluster expansion explains both why they succeed at moderate density and why they must fail near the critical point, where all virial coefficients contribute at once. The same density expansion, with the classical Mayer function replaced by its quantum analogue, gives the second virial coefficient of dilute Bose and Fermi gases and connects, through the scattering length, to the physics of ultracold atoms — the modern laboratory where the corrections to the ideal gas are measured one collision at a time.
The physical picture
Start with the ideal gas: point molecules, each roaming the full volume freely, oblivious to the others. Now give each molecule a small hard core so that no two centers can approach closer than a diameter . Every molecule now excludes a little volume around itself from all the others; the configuration space each one can explore shrinks, its entropy drops, and — since pressure is entropy's response to squeezing — the pressure climbs above the ideal value. This is the repulsive, positive contribution to , and it is purely geometric: it depends on the size of the molecules, not on temperature. Now switch on a weak attraction between molecules at moderate separations, the kind that eventually condenses a gas into a liquid. A molecule near a neighbor sits in a shallow potential well, lowers its energy, and lingers — the gas is slightly more compressible than ideal, and the pressure falls. This attractive piece does depend on temperature: at high the fast-moving molecules barely notice the shallow well and only the hard core matters, so ; at low they dwell in the well and attraction wins, so . The crossover, where the two exactly cancel to first order in density, is the Boyle temperature — the temperature at which a real gas fakes being ideal over a surprisingly wide density range.
The reason the density is the right expansion parameter — and not the strength of the interaction — is a matter of counting encounters. The relevant small number is , the number of other molecules inside one molecule's interaction sphere of volume . When this is small, a given molecule usually feels no one; occasionally it feels one partner (giving ); a simultaneous three-body encounter is rarer by another factor of (giving ), and so on. Each virial coefficient carries one more power of density because it describes one more molecule crowding into the interaction volume. Crucially, each coefficient is exact in the coupling: even a violently strong potential contributes a finite , because the object being integrated is not but the tame Mayer function.
The core equations
The reference against which every correction is measured is the ideal gas: at fixed density and temperature its pressure is set entirely by counting molecules, independent of their chemistry.
where: — pressure; — volume; — molecule number; — temperature; — Boltzmann constant. The whole subject is the study of how the left-hand side departs from as the density rises — a departure we call the compressibility factor . The systematic way to organize those departures is a power series in the number density. Because a molecule feels its neighbors more often the denser the gas, expanding in arranges the corrections by how many molecules interact simultaneously.
where: — number density, the expansion parameter; — the -th virial coefficient, a function of temperature only. Equivalently . The pair coefficient dominates at low density; each higher describes one more molecule joining the encounter and is suppressed by another power of . All the interaction physics enters through the configuration integral, the part of the partition function that knows about positions rather than momenta. For the ideal gas it is just ; interactions replace it by a Boltzmann-weighted integral over all arrangements.
where: — canonical partition function; — thermal de Broglie wavelength; — configuration integral, when ; — pair potential; . The full derivation of this factorization is owned by aq-sm-configuration-integral; here it is the input that isolates all non-ideality inside . The trick that makes the many-body integral tractable is to expand the Boltzmann weight not in the potential — which diverges in the hard core — but in the Mayer function, which is bounded and short-ranged.
where: — the Mayer function, where (the hard core), where (beyond the interaction range), and inside a low-temperature attractive well. Because has compact support, every cluster integral built from it is finite. Its properties are owned by aq-sm-mayer-f-function; this article uses to interpret . Carrying the cluster expansion to its lowest nontrivial order yields the leading correction as a single integral of — the second virial coefficient. This is the equation the whole article revolves around.
where: — the second virial coefficient, dimensions of volume; the factor comes from counting the interacting pairs. It is positive when repulsion dominates (hard core, makes the integral negative, so ) and negative when attraction dominates ( in the well). One integral over the pair potential controls the entire leading deviation from ideality. For a realistic potential — a hard core of diameter plus a weak attractive tail — the integral splits into a temperature-independent excluded-volume piece and a temperature-dependent attractive piece, giving the two van der Waals constants.
where: — the excluded-volume constant, equal to four times the volume of one molecule of diameter ; — the attraction constant (the tail has , so the integral of is positive). The high-temperature limit is pure excluded volume; the low-temperature limit is dominated by . These are exactly the phenomenological constants of the van der Waals equation, now derived rather than fitted.
The core equations, resummed
Truncating the virial series at and resumming the repulsive part geometrically recovers the equation of state that first described a liquid.
where: — the constants identified from ; — the volume actually available after excluded volume is removed; — the internal-pressure reduction from attraction. The full derivation and the coexistence (Maxwell) construction are forwarded to aq-sm-van-der-waals-equation and aq-sm-maxwell-construction; this article shows only that is their microscopic parent.
The goal is to see exactly where comes from, so that its sign and its factor of one-half are not mysterious. We start from the configuration integral of interacting molecules, keep only the lowest-order correction in density (a single interacting pair), compute the resulting free energy and pressure, and match to the virial series to read off the coefficient of . The one thing to watch is the pair counting: there are ways to pick the interacting pair, and it is that combinatorial factor that produces the . The machinery of higher clusters is not needed here and is owned by aq-sm-mayer-cluster-expansion.
Step 1. Factorize the Boltzmann weight over pairs and keep the leading term: . Why: at low density it is unlikely for more than one pair to be within range at once, so the single- term dominates and every higher product is suppressed by another power of .
Step 2. Insert into the configuration integral. Integrating one pair's over its center of mass gives a factor , and there are pairs, so . Why: translation invariance turns the six-dimensional pair integral into times the intensive radial integral , and counts the pairs.
Step 3. Take the free energy with : . Why: the correction is small at low density, so the logarithm linearizes; the ideal part is the usual and carries no interaction information.
Step 4. Differentiate to get the pressure: . Dividing by and writing gives . Why: only the volume-dependent correction survives differentiation; comparing with the virial expansion identifies the bracket as . *Verified: the sign and the factor of are checked symbolically in verify_corrections-to-ideal-gas.py, reproducing Pathria & Beale Ch. 9 and Kardar §5.2.*
Go deeper · Derivation B · 1 minThe van der Waals split and the Boyle temperature
Here the goal is to evaluate for a hard-core-plus-attraction potential, obtain the van der Waals constants and explicitly, and locate the Boyle temperature where vanishes. The route is to split the integral at the hard-core radius : inside the core the Mayer function is exactly , and outside it the attractive tail is weak enough to linearize the exponential. The subtle point is that the excluded-volume constant is four times the molecular volume, not one — a factor that trips up almost everyone the first time. The full resummation into the van der Waals equation is forwarded to aq-sm-van-der-waals-equation.
Step 1. Split the integral: . Why: inside the hard core so exactly; outside, is a weak attraction and we can treat the exponential to first order.
Step 2. Evaluate the core piece: . This is the excluded volume. Notice — four times the volume of one molecule. Why: two hard spheres of diameter cannot approach closer than center-to-center, so the volume excluded to a pair is a sphere of radius (eight molecular volumes), shared between two particles, giving four per molecule.
Step 3. Evaluate the tail piece with : , where because in the well. Why: the shallow attractive tail satisfies for the temperatures of interest, so linearizing is accurate, and the negative makes positive.
Step 4. Assemble and find the Boyle temperature: , which vanishes at . Above excluded volume wins (, ); below attraction wins (, ). Why: the two constants have opposite temperature dependence, so their difference must cross zero exactly once — that crossing is the temperature where the gas is ideal to first order in density. *Verified: the split , the excluded-volume factor , the reduction of the truncated virial series to the van der Waals form, and the Boyle temperature are all checked in verify_corrections-to-ideal-gas.py.*
Limiting cases
The behavior of the leading correction across physically transparent regimes:
| Case | Result | Meaning |
|---|---|---|
| Dilute / ideal () | Interaction volume per molecule negligible; recovered exactly. | |
| High temperature | The attractive tail is thermally washed out; only excluded volume survives, so . | |
| Low temperature | The attractive well dominates; the gas is more compressible than ideal, . | |
| Boyle temperature | Repulsion and attraction cancel to first order; the gas tracks the ideal isotherm over an extended density range. | |
| Hard spheres (no attraction) | , -independent | Pure excluded volume; at all temperatures, the classic factor-of-four result. |
Worked examples
1 · The excluded volume of a hard-sphere gas (confidence builder)
We compute for hard spheres of diameter directly and recover the famous factor of four.
Step 1. For hard spheres, for and for , so the Mayer function is for and for . The integral is .
Step 2. The second virial coefficient is . It is positive and temperature-independent, as expected for pure repulsion.
Step 3. Compare with molecular volume. One molecule modeled as a sphere of diameter (radius ) has volume . Therefore — the excluded-volume constant is four times the molecular volume.
Step 4. The factor of four is geometric, not a mistake. The volume excluded to the center of one sphere by another is a sphere of radius (diameter ), which is molecular volumes; shared between the two partners of the pair, this gives per molecule. This is exactly the van der Waals constant , derived here from a single cluster integral rather than fitted to data.
2 · The second virial coefficient and Boyle temperature of argon (exam level)
We compute for Lennard-Jones argon, compare with experiment, and locate the Boyle temperature.
Step 1. Model argon by the Lennard-Jones potential with K and nm. At K, numerically integrate . The integral gives per pair.
Step 2. Convert to molar units: . The measured second virial coefficient of argon at 300 K is about cm³/mol — excellent agreement. The negative sign says attraction wins at room temperature: argon is slightly more compressible than an ideal gas, so .
Step 3. Find the Boyle temperature by locating where . Repeating the integral at increasing temperature, rises through zero; numerically the crossing sits at for these Lennard-Jones parameters. This matches the reduced-Boyle-temperature rule , giving K.
Step 4. Interpret the crossing. Below the shallow attractive well dominates and the gas is easier to compress than ideal; above the molecules move too fast to be caught by the well, only their finite size matters, and the gas is stiffer than ideal. At K argon obeys to first order in density over a wide range — a single microscopic potential has predicted both the room-temperature compressibility and the temperature of accidental ideality.
Origins · 1 minPerturbation theory and how this was discovered
The corrections to the ideal gas are the physicist's archetype of perturbation theory: take a problem you can solve exactly — non-interacting point molecules — and expand systematically in a small parameter that measures the departure from it. Here the small parameter is the density, and the expansion is the virial series. The idea has deep roots. Rudolf Clausius and others recognized in the mid-nineteenth century that real gases deviate from the ideal law, but it was Johannes Diderik van der Waals, in his 1873 doctoral thesis, who first captured excluded volume and attraction in a single equation of state — the earliest mean-field theory in physics, and the reason a gas can condense into a liquid. Heike Kamerlingh Onnes, who would later liquefy helium and discover superconductivity, put the corrections into the systematic power-series form we still use, coining the name "virial expansion" in 1901. The microscopic justification — that each coefficient is a finite cluster integral over the pair potential — came with the cluster expansion of Ursell (1927) and Mayer (1937). What began as an engineer's correction factor became a rigorous, order-by-order theory connecting the shape of the intermolecular potential to every measurable deviation from ideality.
Going further
Texts. Pathria & Beale, Statistical Mechanics, 3rd ed., Ch. 9 (Statistical Mechanics of Interacting Systems: The Method of Cluster Expansions). Kardar, Statistical Physics of Particles, §5.1–5.3. Reif, Fundamentals of Statistical and Thermal Physics, Ch. 10. Landau & Lifshitz, Statistical Physics Part 1, §74–76. Hansen & McDonald, Theory of Simple Liquids (for the correlation-function route).
Provenance. Base article: AllQFT track `sm`, "Corrections to the Ideal Gas" (STAT.INTER.CORIG.1262); source Pathria & Beale, Statistical Mechanics, 3rd ed., Ch. 9. All numeric and symbolic claims re-verified here in verify_corrections-to-ideal-gas.py: the sign and factor of , the hard-sphere , the van der Waals split reducing to the vdW equation to , the Boyle temperature , and the numeric Lennard-Jones argon cm³/mol (matching experiment and the sibling article aq-sm-mayer-cluster-expansion) with K. No base physics error found; the base's formulas are all correct.
Prerequisites. Classical ideal gas · Canonical and grand canonical ensembles · Intermolecular potential .
Leads to. Configuration integral · The Mayer f-function · Virial expansion · Second virial coefficient · Van der Waals equation of state.
Why does B₂ change sign as temperature rises?
Because is a competition between two effects with opposite temperature dependence. The excluded-volume (hard-core) contribution is purely geometric and temperature-independent; it always pushes positive. The attractive contribution grows in magnitude as falls, because slower molecules dwell longer in the potential well. At low temperature the attractive term wins and ; at high temperature the molecules move too fast to feel the shallow well, only their size matters, and . The crossover — the Boyle temperature — is where the two exactly cancel. So the sign of is a thermometer for which part of the intermolecular potential the gas is currently sampling.
What is the difference between the compressibility factor Z and the second virial coefficient B₂?
The compressibility factor is the measurable ratio of the real pressure to the ideal pressure; is ideal. The second virial coefficient is the leading coefficient in the expansion of in density: . So is the full deviation and is its first slope. At low density , so a plot of extrapolated to is — this is precisely how is measured from pressure-volume data.
Why must the integral defining B₂ converge even though u(r) blows up in the hard core?
Because the integrand is the Mayer function , not itself. Where , the exponential , so — a perfectly finite value. Where at large separation, . So is bounded between and a modest positive value in the attractive well, and it has compact support (it vanishes beyond the interaction range). Integrating a bounded function over a finite effective volume gives a finite , even though the raw potential is infinite. This is the whole reason the cluster expansion works: replacing by tames the divergence.
Is B₂ = b − a/k_BT exact, or an approximation?
It is an approximation valid for a specific model and regime. The exact statement is for any pair potential. The split follows only if you model the potential as a hard core plus a weak attractive tail and linearize the tail's Boltzmann factor as , which requires . For a real potential like Lennard-Jones, is a smooth curve that the two-constant form only approximates near and above the Boyle temperature; at very low temperature the linearization fails and you must integrate numerically, as in the argon worked example.
How is B₂ connected to the van der Waals equation?
Truncate the virial series at the second coefficient with a hard-core-plus-attraction potential: . Now resum the repulsive part. The excluded-volume terms form a geometric series that sums to , the physical statement that the available volume is reduced from to . Keeping the attractive term as and rearranging gives exactly . So van der Waals is the virial series kept to first order in density and dressed up with an excluded-volume resummation — the microscopic justification for the equation you first met in chemistry lives in .
Does the same density expansion work for quantum gases?
Yes, with a twist. For a dilute Bose or Fermi gas there are two sources of the second virial coefficient: the interaction (via a quantum analogue of the Mayer function built from the two-body scattering) and the quantum statistics themselves. Remarkably, even a non-interacting quantum gas has a nonzero — the exchange contribution (attractive for bosons, repulsive for fermions), where is the thermal wavelength. So quantum statistics act like an effective potential. At low temperature and density the interaction part reduces to the s-wave scattering length, which is the language of ultracold-atom physics. The classical virial framework of this article is the limit of that richer story.
Why is the density the natural expansion parameter and not, say, the pressure?
Because the physics that causes deviations — molecules encountering one another — is controlled by how close together they are, which is set by the density , not directly by the pressure. Microscopically, the probability that a given molecule has a partner within interaction range is , and the cluster expansion is literally an expansion in the number of molecules simultaneously within range. The pressure is an output of the theory, not the natural control knob; expressing the equation of state as with a power series in keeps each term tied to a definite number of interacting molecules. You can invert to get afterward, but the clean bookkeeping is in density.