Kinetic theory: molecules and temperature
Kinetic theory models an ideal gas as N identical, point-like, perfectly elastic particles whose only interactions are instantaneous collisions with statistically uncorrelated outcomes (the "molecular chaos" assumption). From nothing more than Newton's laws applied to this picture, the equipartition theorem links absolute temperature directly to average kinetic energy:
⟨½m·v_x²⟩ = ½·k_B·T // one translational degree of freedom ⟨E_k⟩ = ½m⟨v²⟩ = 3/2 · k_B·T // three degrees of freedom (x,y,z) k_B = 1.380649 × 10⁻²³ J/K // Boltzmann's constant
Temperature, in other words, is nothing but a macroscopic bookkeeping device for microscopic kinetic energy. The relative probability of a molecule occupying a state of energy E follows the Boltzmann factor P ∝ e^(−E/k_BT) — the exponential suppression of high-energy states underlying chemical kinetics and the Arrhenius equation, and the seed of the full speed distribution below.
From Gaussian components to the speed distribution
In thermal equilibrium with no preferred direction, each Cartesian velocity component is independent and Gaussian-distributed with variance σ² = k_BT/m:
f(v_x) = √(m/2πk_BT) · exp(−m·v_x²/2k_BT)
The speed v = |v| is a different quantity — a scalar magnitude, v ≥ 0 — obtained by integrating the 3D Gaussian over all directions, treating velocity space as a set of thin spherical shells of surface area 4πv²:
f(v) = 4π · (m/2πk_BT)^(3/2) · v² · exp(−m·v²/2k_BT) 4πv² — spherical shell volume: more directions at higher v (m/2πk_BT)^(3/2) — normalisation constant exp(−mv²/2k_BT) — Boltzmann suppression of high speeds
The v² term growing and the exponential falling compete against each other, producing the characteristic right-skewed bell shape peaking at a finite speed rather than at zero.
Three different characteristic speeds
Because the distribution is asymmetric, its mode, mean and root-mean-square are three genuinely different numbers:
v_p = √(2k_BT/m) // most probable — peak of f(v), solve df/dv = 0 ⟨v⟩ = √(8k_BT/πm) // mean speed v_rms = √(3k_BT/m) // root-mean-square — the speed relevant to pressure, KE ordering: v_p < ⟨v⟩ < v_rms (ratio v_p : ⟨v⟩ : v_rms ≈ 1 : 1.128 : 1.225)
Sampling the distribution: Box-Muller
A molecular-dynamics simulation needs to draw random velocities that already follow the Maxwell-Boltzmann distribution. Since each Cartesian component is an independent Gaussian, the Box-Muller transform — which turns two uniform random numbers into two independent standard normal variates — gives exactly what is needed, scaled by σ = √(k_BT/m):
function boxMuller() {
const u1 = Math.random(), u2 = Math.random();
const r = Math.sqrt(-2 * Math.log(u1));
return [ r*Math.cos(2*Math.PI*u2), r*Math.sin(2*Math.PI*u2) ]; // two N(0,1) samples
}
function sampleVelocity(m, T, kB = 1.380649e-23) {
const sigma = Math.sqrt(kB * T / m);
const [gx, gy] = boxMuller(), [gz] = boxMuller();
return [sigma*gx, sigma*gy, sigma*gz]; // vx, vy, vz — each ~ N(0, sigma^2)
}
Temperature dependence and where it matters
Raising T widens and flattens f(v) — more molecules reach higher speeds, and v_p, ⟨v⟩ and v_rms all grow as √T. This single curve underlies effusion rates (Graham's law), the fraction of molecules energetic enough to cross a reaction's activation barrier (chemical kinetics), and atmospheric escape: a planet retains a gas only if its escape velocity comfortably exceeds the high-speed tail of that gas's Maxwell-Boltzmann distribution at the relevant temperature — which is precisely why Earth kept its nitrogen and oxygen but lost most of its primordial hydrogen and helium.
Frequently asked questions
Why is temperature just kinetic energy in disguise?
The equipartition theorem gives ⟨½mv²⟩ = 3/2·k_BT for the three translational degrees of freedom of a gas molecule, so absolute temperature is literally a macroscopic bookkeeping device for the average microscopic kinetic energy of the particles — there is no separate physical quantity called temperature beyond that statistical average.
Why does the speed distribution f(v) peak at a nonzero speed instead of at v=0?
Because f(v) is the product of a v² term — the growing surface area of a spherical shell in velocity space, meaning there are simply more directions a molecule can have a given speed in as that speed increases — and a Boltzmann factor exp(−mv²/2k_BT) that suppresses high speeds. The competition between the two produces a peak at a finite speed rather than at zero.
Why are v_p, ⟨v⟩ and v_rms all different numbers for the same gas?
Because the speed distribution is asymmetric (right-skewed), not a symmetric bell curve, so its mode (most probable speed v_p), mean (⟨v⟩) and root-mean-square (v_rms, the speed relevant to kinetic energy and pressure) are three genuinely different statistics of the same underlying curve, always satisfying v_p < ⟨v⟩ < v_rms.
Try it live
Change the temperature and watch the speed histogram of hundreds of simulated molecules reshape itself in real time in Molecular Dynamics.
▶ Open Molecular Dynamics simulation