PHYS-261 · Lesson 4 of 12 · 23 min

Ideal gases and kinetic theory

The ideal gas law \(PV = nRT\) summarizes the experiments of Boyle, Charles, Gay-Lussac and Avogadro. Kinetic theory explains it. If a gas is a swarm of tiny molecules flying about and bouncing off the walls of their container, then pressure is the average force of those impacts per unit area, and temperature turns out to measure the average kinetic energy of the molecules. This lesson derives the pressure of an ideal gas from molecular motion, interprets temperature microscopically, introduces the Maxwell distribution of molecular speeds, and simulates a gas of random collisions that relaxes to that distribution on its own. It ends with a look at mean free paths and at the ways real gases depart from ideal behaviour.

The ideal gas law

For a fixed amount of gas at low pressure, the experimental laws combine into

\[PV = nRT = NkT,\]

where \(n\) is the amount in moles, \(N = nN_A\) is the number of molecules, \(R = 8.314462618\) J/(mol K) is the gas constant and \(k = R/N_A\) is the Boltzmann constant. Amedeo Avogadro proposed in 1811 that equal volumes of different gases at the same temperature and pressure contain equal numbers of molecules, which is exactly what this law says. One mole of any ideal gas at 0 °C and 101.325 kPa occupies 22.41 L. Real gases follow the law to better than 1% at room temperature and atmospheric pressure; the deviations grow at high pressure and near condensation, where the volume of the molecules and the forces between them begin to matter.

Pressure from molecular impacts

Consider \(N\) molecules, each of mass \(m\), in a cubical box of side \(L\). Assume the molecules are point particles that do not interact except during brief collisions, and that collisions with the walls are elastic. Follow one molecule with velocity component \(v_x\) perpendicular to the wall at \(x = L\). Each time it hits that wall its momentum changes by \(-2mv_x\), so it delivers momentum \(2mv_x\) to the wall. It returns to the same wall after travelling \(2L\) in the \(x\) direction, a time \(2L/v_x\). The average force it exerts on the wall is therefore

\[F_1 = \frac{2mv_x}{2L/v_x} = \frac{mv_x^2}{L}.\]

Collisions between molecules shuffle velocities but, being elastic, do not change the total momentum flux, so we may simply add the contributions of all molecules. The pressure is the total force divided by the area \(L^2\):

\[P = \frac{N m \langle v_x^2 \rangle}{L^3} = \frac{N m \langle v_x^2 \rangle}{V}.\]

No direction is special, so \(\langle v_x^2 \rangle = \langle v_y^2 \rangle = \langle v_z^2 \rangle = \frac13 \langle v^2 \rangle\), and

\[PV = \tfrac{1}{3} N m \langle v^2 \rangle = \tfrac{2}{3} N \langle E_{\text{kin}} \rangle,\]

where \(\langle E_{\text{kin}} \rangle = \frac12 m\langle v^2\rangle\) is the mean translational kinetic energy of a molecule. The shape of the box does not matter, and a more careful version of the argument, integrating over molecules that strike a small patch of wall at all angles, gives the same result. Daniel Bernoulli published an argument of this kind in 1738, a century before it was generally accepted.

The meaning of temperature

Comparing \(PV = \frac23 N\langle E_{\text{kin}}\rangle\) with \(PV = NkT\) gives one of the central results of kinetic theory:

\[\langle E_{\text{kin}} \rangle = \tfrac{3}{2} kT.\]

The absolute temperature of an ideal gas is proportional to the mean translational kinetic energy of its molecules, and the proportionality constant is the same for every gas. At 300 K that energy is \(6.2 \times 10^{-21}\) J. Since \(\frac12 m\langle v^2\rangle = \frac32 kT\), the root-mean-square speed is \(v_{\text{rms}} = \sqrt{3kT/m}\), about 517 m/s for nitrogen and 1930 m/s for hydrogen at 300 K. In a mixture of gases at a common temperature, the light molecules move faster but every species has the same mean kinetic energy. This is the first instance of the equipartition theorem, which lesson 11 proves in general: each quadratic degree of freedom carries an average energy of \(\frac12 kT\), and translation in three dimensions provides three of them.

The internal energy of a monatomic ideal gas, whose molecules have no rotational or vibrational motion to speak of, is therefore \(U = \frac32 NkT = \frac32 nRT\), which gives \(C_V = \frac32 R\) per mole, in excellent agreement with measurements on helium, neon and argon.

The Maxwell distribution of speeds

Molecules do not all move at the same speed. In 1860 Maxwell found the distribution of speeds in a gas in equilibrium with a short and remarkable argument. He assumed that the three velocity components are statistically independent and that the distribution depends only on the speed, not on the direction. The only function that satisfies both conditions is a Gaussian in each component, \(f(v_x) \propto e^{-mv_x^2/2kT}\), with the width fixed by the requirement \(\langle v_x^2\rangle = kT/m\). The probability that the speed lies between \(v\) and \(v + dv\) is then found by counting the velocity vectors in a spherical shell of radius \(v\) and thickness \(dv\), whose volume is \(4\pi v^2\,dv\):

\[f(v)\,dv = 4\pi \Big(\frac{m}{2\pi kT}\Big)^{3/2} v^2\, e^{-mv^2/2kT}\,dv.\]

The factor \(v^2\) makes small speeds rare, because there are few ways to have a small velocity vector, while the exponential makes large speeds rare. The most probable speed, where \(f\) peaks, is \(v_p = \sqrt{2kT/m}\); the mean speed is \(\langle v \rangle = \sqrt{8kT/\pi m}\); and the root-mean-square speed is \(\sqrt{3kT/m}\). They stand in the ratios 1 : 1.128 : 1.225. For nitrogen at 300 K they are 422, 476 and 517 m/s. As the temperature rises the distribution broadens and shifts to higher speeds, and its long tail, where a few molecules move several times faster than average, controls processes that need a large energy, such as chemical reactions and the escape of gases from planetary atmospheres.

Three Maxwell speed distribution curves for nitrogen, at 100 K, 300 K and 1000 K. The 100 K curve is tall and narrow, peaking near 250 metres per second; the 300 K curve peaks near 420; the 1000 K curve is low and broad, peaking near 770 metres per second, with a long tail beyond 1500. Vertical markers on the 300 K curve show the most probable, mean and rms speeds.
Maxwell speed distributions for nitrogen at three temperatures, in probability per km/s, with the most probable, mean and rms speeds marked at 300 K

Maxwell's derivation was elegant but its assumptions were not obviously justified. Boltzmann showed in 1872 that molecular collisions drive any initial distribution towards Maxwell's, a result known as the H-theorem. Direct measurements came later: in 1920 Otto Stern measured molecular speeds in a beam of silver atoms, and in 1955 Robert Miller and Polykarp Kusch measured the speed distribution of potassium and thallium atoms with a rotating slotted cylinder, confirming Maxwell's formula to within about 1%.

Collisions make the distribution

We can watch the H-theorem at work in a simple simulation. Start 4000 nitrogen molecules all with the same speed, 500 m/s, in random directions. Then repeatedly choose two molecules at random and let them collide elastically. For equal masses, an elastic collision keeps the velocity of the centre of mass and the magnitude of the relative velocity, and only rotates the relative velocity to a new direction, which we choose at random. This is a simplified version of the direct simulation Monte Carlo method used to model rarefied gases in spacecraft engineering. Energy and momentum are conserved exactly in every collision. After an average of 40 collisions per molecule, the program compares the histogram of speeds with the Maxwell distribution at the temperature defined by the mean kinetic energy.

Random elastic collisions turn a single speed into the Maxwell distribution
import math, random
rnd = random.Random(261)
k = 1.380649e-23
m = 28.0 * 1.66053907e-27        # mass of a nitrogen molecule (kg)
N = 4000
v0 = 500.0                        # every molecule starts with speed 500 m/s

def random_direction():
    z = 2 * rnd.random() - 1; phi = 2 * math.pi * rnd.random(); s = math.sqrt(1 - z * z)
    return (s * math.cos(phi), s * math.sin(phi), z)

vel = [tuple(v0 * c for c in random_direction()) for _ in range(N)]

def collide(a, b):
    """Elastic collision of equal masses with an isotropic scattering direction."""
    cm = [(a[i] + b[i]) / 2 for i in range(3)]
    g = math.sqrt(sum((a[i] - b[i])**2 for i in range(3)))
    e = random_direction()
    return (tuple(cm[i] + 0.5 * g * e[i] for i in range(3)),
            tuple(cm[i] - 0.5 * g * e[i] for i in range(3)))

for _ in range(20 * N):
    i, j = rnd.randrange(N), rnd.randrange(N)
    if i != j:
        vel[i], vel[j] = collide(vel[i], vel[j])

speeds = [math.sqrt(sum(c * c for c in v)) for v in vel]
KE = sum(0.5 * m * s * s for s in speeds)
T = 2 * KE / (3 * N * k)
print(f"energy conserved: mean v^2 = {sum(s * s for s in speeds) / N:.1f} (start {v0**2:.1f})")
print(f"temperature from equipartition: T = {T:.1f} K")

def maxwell(v):
    a = m / (2 * k * T)
    return 4 * math.pi * (a / math.pi)**1.5 * v * v * math.exp(-a * v * v)

print("\n speed bin (m/s)   simulated   Maxwell")
width = 100
for lo in range(0, 1200, width):
    frac = sum(lo <= s < lo + width for s in speeds) / N
    mid = lo + width / 2
    print(f"   {lo:4d}-{lo + width:4d}      {frac:7.4f}    {maxwell(mid) * width:7.4f}")

# Pressure from momentum transfer to a wall, N molecules in a 1 L box
V = 1.0e-3
vx2 = sum(v[0]**2 for v in vel) / N
P_kinetic = N * m * vx2 / V
print(f"\nkinetic pressure N m <vx^2>/V = {P_kinetic:.4e} Pa;  N k T / V = {N * k * T / V:.4e} Pa")
Output
energy conserved: mean v^2 = 250000.0 (start 250000.0)
temperature from equipartition: T = 280.6 K

 speed bin (m/s)   simulated   Maxwell
      0- 100       0.0112     0.0082
    100- 200       0.0688     0.0652
    200- 300       0.1440     0.1425
    300- 400       0.1910     0.1948
    400- 500       0.1925     0.1993
    500- 600       0.1610     0.1634
    600- 700       0.1128     0.1111
    700- 800       0.0648     0.0638
    800- 900       0.0318     0.0314
    900-1000       0.0155     0.0133
   1000-1100       0.0043     0.0049
   1100-1200       0.0022     0.0016

kinetic pressure N m <vx^2>/V = 1.5434e-14 Pa;  N k T / V = 1.5498e-14 Pa

The total kinetic energy is unchanged to every digit, so the temperature defined by \(\frac32 kT = \langle E_{\text{kin}}\rangle\) is 280.6 K, the temperature at which the rms speed of nitrogen is 500 m/s. The initial spike at 500 m/s has spread into a broad distribution that matches the Maxwell form bin by bin to within the statistical noise of 4000 samples, a few thousandths. Nothing in the collision rule mentions temperature or Gaussians; the Maxwell distribution emerges because it is the overwhelmingly most probable way to share a fixed energy among many molecules, a statement lesson 11 makes exact. The pressure computed from the momentum flux, \(Nm\langle v_x^2\rangle/V\), agrees with \(NkT/V\) to within 0.4%, the residual being a statistical fluctuation in how the energy happens to be shared among the three directions.

Mean free path and transport

Molecules travel only a short distance between collisions. Treat each molecule as a sphere of diameter \(d\). It collides with any other whose centre comes within \(d\) of its path, so in travelling a distance \(\ell\) it sweeps out a cylinder of volume \(\pi d^2 \ell\). Setting the expected number of molecules in that cylinder to one gives the mean free path. Taking account of the motion of the other molecules introduces a factor \(\sqrt2\):

\[\ell = \frac{1}{\sqrt{2}\,\pi d^2\,(N/V)} = \frac{kT}{\sqrt{2}\,\pi d^2 P}.\]

For air at room temperature and atmospheric pressure, with \(d \approx 0.37\) nm, \(N/V = 2.5 \times 10^{25}\ \text{m}^{-3}\), and \(\ell \approx 66\) nm, about 200 molecular diameters. A molecule moving at 470 m/s collides about seven billion times a second. This explains why a smell takes minutes, not milliseconds, to cross a room: molecules diffuse by a random walk of tiny steps rather than flying in straight lines. Kinetic theory relates the transport coefficients, viscosity, thermal conductivity and diffusion constant, to the mean free path and mean speed. Maxwell's most surprising prediction from it, in 1860, was that the viscosity of a gas does not depend on its pressure, because a denser gas has more molecules carrying momentum but shorter free paths. He confirmed it himself with experiments on oscillating discs in 1866.

Real gases

The ideal gas law neglects the volume of the molecules and the attractions between them. At high pressure the molecules fill a significant fraction of the container, so the gas is harder to compress than an ideal gas; at moderate pressure the attractions pull molecules together and reduce the pressure on the walls. Johannes Diderik van der Waals captured both effects in 1873 with the equation

\[\Big(P + \frac{an^2}{V^2}\Big)(V - nb) = nRT,\]

in which \(b\) is roughly the volume of a mole of molecules and \(a\) measures the strength of the attraction. It is only qualitatively right, but it predicts condensation and a critical point, and lesson 9 uses it to illustrate the thermodynamic potentials. A more systematic description is the virial expansion, \(PV/nRT = 1 + B(T)\,n/V + C(T)\,(n/V)^2 + \cdots\), whose coefficients can be measured or calculated from intermolecular forces.

Worked problem

Speeds in a mixture

Air in a room at 20 °C contains nitrogen (28 u), oxygen (32 u) and a little helium (4 u). Find the rms speed of each, and the ratio of their mean kinetic energies.

Show solution
  1. \(v_{\text{rms}} = \sqrt{3kT/m}\) with \(T = 293.15\) K and \(1\ \text{u} = 1.6605 \times 10^{-27}\) kg.
  2. Nitrogen: \(\sqrt{3 \times 1.381 \times 10^{-23} \times 293.15 / (28 \times 1.6605 \times 10^{-27})} = 511\) m/s.
  3. Oxygen: \(511 \times \sqrt{28/32} = 478\) m/s. Helium: \(511 \times \sqrt{28/4} = 1352\) m/s.
  4. Every species has mean translational kinetic energy \(\frac32 kT = 6.07 \times 10^{-21}\) J, so the ratio is 1 : 1 : 1.

Answer: 511, 478 and 1352 m/s; the mean kinetic energies are equal.

Common mistakes

  • MistakeThinking that all molecules in a gas move at the same speed.

    InsteadSpeeds follow the Maxwell distribution, with a long tail of fast molecules.

  • MistakeUsing the molar mass in grams per mole in \(\sqrt{3kT/m}\).

    InsteadUse the molecular mass in kilograms, or equivalently \(\sqrt{3RT/M}\) with \(M\) in kg/mol.

  • MistakeBelieving that heavier molecules have more kinetic energy at the same temperature.

    InsteadAt equal temperature every species has the same mean translational kinetic energy; heavier ones simply move more slowly.

  • MistakeTreating the most probable, mean and rms speeds as the same.

    InsteadThey differ, in the ratio 1 : 1.128 : 1.225.

  • MistakeForgetting that collisions between molecules are essential even in an ideal gas.

    InsteadThey do not change the pressure, but without them the gas would never reach equilibrium.

Summary and key terms

  • Kinetic theory gives \(PV = \frac13 Nm\langle v^2\rangle = \frac23 N\langle E_{\text{kin}}\rangle\).
  • Comparing with \(PV = NkT\): \(\langle E_{\text{kin}}\rangle = \frac32 kT\), so temperature measures mean translational kinetic energy.
  • The Maxwell distribution is \(f(v) = 4\pi(m/2\pi kT)^{3/2} v^2 e^{-mv^2/2kT}\), with \(v_p : \langle v\rangle : v_{\text{rms}} = 1 : 1.128 : 1.225\).
  • Random elastic collisions drive any initial distribution towards Maxwell's, as Boltzmann's H-theorem asserts.
  • The mean free path is \(\ell = kT/(\sqrt2 \pi d^2 P)\), about 66 nm in air at room conditions.
  • Real gases deviate because molecules have size and attract one another, as the van der Waals equation models.
kinetic theory
The explanation of gas properties in terms of the motion of molecules.
rms speed
The square root of the mean of the squared speed, the square root of 3kT/m.
Maxwell distribution
The equilibrium distribution of molecular speeds in a gas.
H-theorem
Boltzmann's 1872 proof that collisions drive a gas towards the Maxwell distribution.
mean free path
The average distance a molecule travels between collisions.
van der Waals equation
An equation of state that corrects the ideal gas law for molecular size and attraction.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. What volume does 1 mol of an ideal gas occupy at 20 °C and 101.325 kPa?

    Show answer

    \(V = RT/P = 8.314 \times 293.15/101\,325 = 0.02405\) m³ \(= 24.05\) L.

  2. Find the rms speed of hydrogen molecules (2.016 u) at 300 K.

    Show answer

    \(\sqrt{3 \times 1.381 \times 10^{-23} \times 300/(2.016 \times 1.6605 \times 10^{-27})} = 1929\) m/s.

  3. At what temperature would the rms speed of nitrogen be twice its value at 300 K?

    Show answer

    \(v_{\text{rms}} \propto \sqrt T\), so \(T = 4 \times 300 = 1200\) K.

  4. Show that the most probable speed of the Maxwell distribution is \(\sqrt{2kT/m}\).

    Show answer

    Maximize \(v^2 e^{-mv^2/2kT}\): the derivative \(2v e^{-a v^2}(1 - a v^2)\) with \(a = m/2kT\) vanishes at \(v^2 = 1/a = 2kT/m\).

  5. Estimate the mean free path of air molecules at the 10 km altitude of a jet, where \(P = 26\) kPa and \(T = 223\) K.

    Show answer

    \(\ell = kT/(\sqrt2\pi d^2 P) = 1.381 \times 10^{-23} \times 223 / (1.414 \times 3.1416 \times (3.7 \times 10^{-10})^2 \times 26\,000) = 1.9 \times 10^{-7}\) m, about 0.19 μm.

  6. What is the total translational kinetic energy of the molecules in 1 L of air at 100 kPa?

    Show answer

    \(\frac32 PV = 1.5 \times 10^5 \times 10^{-3} = 150\) J.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz