Solution (source code)

= Solution

A non-ideal gas departs from $p=nk_BT$ because interactions and finite particle size affect its <pressure>. At sufficiently low <number density> $n=N/V$, the <virial expansion> separates these corrections:
$$
\boxed{\frac{p}{nk_BT}=1+B_2(T)n+B_3(T)n^2+\cdots}.
$$
The <second virial coefficient> has dimensions of <volume> per particle, while $B_3$ has dimensions of <volume> squared. These are density-series coefficients, not the coefficients of a pressure-series expansion with the same names.

For classical particles interacting through a <pair potential> $u(r)$,
$$
B_2(T)=2\pi\int_0^\infty[1-e^{-u(r)/(k_BT)}]r^2\,dr.
$$
Repulsion contributes positively and attraction negatively. A hard core of diameter $d$ gives $B_2=2\pi d^3/3$, four times the geometric <volume> of one sphere. The factor reflects the <volume> excluded to the centre of a second particle together with pair counting; it is not simply the occupied geometric <volume>.

Expanding the <Van der Waals equation> at $nb\ll1$ gives
$$
\frac p{nk_BT}=\frac1{1-nb}-\frac{an}{k_BT}
=1+\left(b-\frac a{k_BT}\right)n+b^2n^2+\cdots.
$$
The <virial coefficients of the van der Waals gas> are therefore $B_2=b-a/(k_BT)$ and $B_3=b^2$. The <Boyle temperature>, $T_B=a/(k_Bb)$, makes the leading correction vanish, but does not remove the higher coefficients or turn the gas exactly ideal. More realistic potentials give temperature-dependent higher coefficients that need not equal the van der Waals values.

A useful measurement is a sequence of dilute isothermal <pressure>–<volume> observations. Plotting $[p/(nk_BT)-1]/n$ against $n$ exposes $B_2$ as the zero-density intercept and $B_3$ as its initial slope. Control <temperature> and density calibration, check equilibration and <adsorption> on the container walls, and vary the fitted density interval to test truncation error. One measured virial coefficient cannot uniquely reconstruct the <pair potential>. Near coexistence or a <critical point> a short density series may fail, and at quantum-degenerate densities exchange statistics add corrections even without interactions.