Real gases deviate from ideal behavior due to intermolecular forces and the finite size of molecules. These effects become significant at high pressures and low temperatures, where the ideal gas law breaks down. Statistical mechanics gives us a systematic way to account for these deviations by modifying the partition function, connecting microscopic interactions to macroscopic equations of state like the van der Waals equation.
Real Gas Deviations from Ideal Behavior
Intermolecular Interactions and Molecular Size Effects
Real gases deviate from ideal behavior for two main reasons: molecules attract (and repel) each other, and they take up actual space. The ideal gas law assumes neither of these things, which is why it works well only at low pressures and high temperatures where molecules are far apart and moving fast.
The types of intermolecular forces responsible for deviations include dispersion forces, dipole-dipole interactions, and hydrogen bonding. At short range, molecules also experience strong repulsion due to overlapping electron clouds. These effects grow more pronounced as you compress a gas (molecules closer together) or cool it (molecules moving slower, spending more time near each other).
The compressibility factor quantifies how far a real gas strays from ideal behavior:
- For an ideal gas, exactly.
- means attractive forces dominate, pulling molecules together and reducing the volume below what you'd expect.
- means repulsive forces and excluded volume dominate, making the gas harder to compress than an ideal gas would be.
At moderate pressures, most gases show (attractions win). At very high pressures, (finite molecular volume wins). The crossover depends on the gas and the temperature.
Quantifying Deviations Using Statistical Mechanics
Statistical mechanics handles real gas behavior by modifying the partition function to include intermolecular potential energy. The key idea: the real gas partition function can be written as the ideal gas partition function multiplied by a correction factor.
Here is the configurational partition function, which encodes all the information about how molecules interact with each other. For particles, it takes the form:
where is the total intermolecular potential energy. For an ideal gas, , and this integral just gives , so .
One systematic way to connect this to measurable quantities is through the virial equation of state, a power series expansion in molar density :
- is the second virial coefficient, which captures the effect of pairwise interactions between molecules.
- is the third virial coefficient, capturing three-body interactions, and so on.
The second virial coefficient has a direct statistical mechanical expression:
where is the pair interaction potential. This is powerful because it links a measurable thermodynamic quantity () directly to the microscopic potential between two molecules.

Intermolecular Interactions in Real Gases
Types of Intermolecular Interactions
Three main categories of attractive interactions matter for real gases:
- Dispersion forces (London forces): Arise from temporary fluctuations in electron distributions, creating instantaneous dipoles that induce dipoles in neighboring molecules. Present in all molecules, and they're the only attractive force between nonpolar species like or .
- Dipole-dipole interactions: Occur between molecules with permanent dipole moments, such as . The interaction energy depends on the relative orientation of the dipoles.
- Hydrogen bonding: A particularly strong type of dipole-dipole interaction where hydrogen is bonded to a highly electronegative atom (O, N, or F). Water is the classic example, and hydrogen bonding is why has an unusually high boiling point.
At very short distances, all molecules experience steep repulsive forces from the overlap of their electron clouds. The balance between long-range attraction and short-range repulsion is what determines the equilibrium behavior of real gases.

Modeling the Pair Potential
The most common model for the pair interaction is the Lennard-Jones potential:
- is the depth of the potential well (sets the strength of attraction).
- is the distance at which the potential crosses zero (roughly the molecular diameter).
- The term models short-range repulsion; the term models long-range attraction (dispersion).
This potential has a minimum at , where the attractive and repulsive contributions balance. The Lennard-Jones parameters and are tabulated for many gases and can be used to calculate virial coefficients and other thermodynamic properties from the statistical mechanical integrals above.
Statistical Mechanics for Real Gas Equations of State
Van der Waals Equation of State
The van der Waals equation is derived from the partition function using a mean-field approximation. The derivation involves two physical corrections to the ideal gas:
-
Excluded volume correction: Each molecule occupies a finite volume, so the effective volume available for molecular motion is less than the container volume. You replace with , where accounts for the volume excluded by molecular hard cores.
-
Attractive interaction correction: Each molecule experiences an average attractive pull from all surrounding molecules. This reduces the pressure the gas exerts on the walls. The pressure reduction is proportional to the square of the density, giving a correction term .
Combining these corrections yields the van der Waals equation:
- : measures the strength of attractive interactions between molecules (units: )
- : represents the excluded volume per mole (units: )
- Larger โ stronger attractions โ gas condenses more easily
- Larger โ bigger molecules โ harder to compress
From a statistical mechanics perspective, the mean-field approach assumes that each molecule sits in a uniform average potential created by all other molecules. This simplification makes the math tractable but ignores local correlations between molecular positions.
Limitations and Applications
The van der Waals equation is a significant improvement over the ideal gas law. It qualitatively predicts:
- The condensation of gases into liquids
- The existence of a critical point (), above which liquid and gas phases become indistinguishable
- The van der Waals parameters relate to critical constants: and
However, the equation has real limitations. Near the critical point, the mean-field approximation breaks down because density fluctuations become large and correlated over long distances. The equation also gives only a rough description of the liquid state.
More accurate equations of state have been developed to address these shortcomings:
- Redlich-Kwong equation: Improves the temperature dependence of the attractive term by replacing with .
- Peng-Robinson equation: Further refines the attractive term and gives better liquid density predictions. Widely used in chemical engineering for process design.
These more sophisticated equations still trace their conceptual roots back to the same statistical mechanical framework: modify the partition function to account for real intermolecular interactions, then derive macroscopic thermodynamic properties from the result. The virial expansion provides the rigorous foundation, while equations like van der Waals offer practical closed-form approximations.