Skip to main content

Classical Ideal Gas and Maxwell Distribution

The classical ideal gas is the simplest nontrivial laboratory for statistical mechanics. It has no interactions except confinement by the walls, so the partition function factorizes into a position part and a momentum part. From that factorization come the ideal-gas law, the Maxwell-Boltzmann velocity distribution, equipartition, and the density-of-states formulas used repeatedly in more complicated systems.

Schwabl treats the ideal gas in both microcanonical and canonical language. The agreement between them is a concrete example of ensemble equivalence: the microcanonical shell count and the canonical Gaussian momentum integrals produce the same macroscopic thermodynamics when NN is large.

Definitions

For NN identical classical particles of mass mm in volume VV,

H=i=1Npi22m.H=\sum_{i=1}^{N}{p_i^2\over 2m}.

The canonical partition function is

ZN=1N!h3Nd3Nqd3Npeβipi2/(2m).Z_N={1\over N!h^{3N}}\int d^{3N}q\,d^{3N}p\, e^{-\beta\sum_i p_i^2/(2m)}.

The thermal de Broglie wavelength is

λT=h2πmkBT.\lambda_T={h\over \sqrt{2\pi m k_BT}}.

The ideal-gas partition function is

ZN=1N!(VλT3)N.Z_N={1\over N!}\left({V\over \lambda_T^3}\right)^N.

For a single particle, the velocity probability density is

f(v)=(m2πkBT)3/2exp(mv22kBT).f(\mathbf v)= \left({m\over 2\pi k_BT}\right)^{3/2} \exp\left(-{m v^2\over 2k_BT}\right).

The speed distribution, including the spherical velocity-space measure, is

P(v)=4πv2(m2πkBT)3/2exp(mv22kBT),v0.P(v)=4\pi v^2 \left({m\over 2\pi k_BT}\right)^{3/2} \exp\left(-{m v^2\over 2k_BT}\right), \qquad v\ge 0.

Key results

The free energy follows from F=kBTlnZNF=-k_BT\ln Z_N. Using Stirling's approximation,

lnN!NlnNN,\ln N!\approx N\ln N-N,

one obtains

F=NkBT[ln(VNλT3)+1].F=-Nk_BT\left[ \ln\left({V\over N\lambda_T^3}\right)+1 \right].

Pressure and entropy are then

p=(FV)T,N=NkBTV,p=-\left({\partial F\over \partial V}\right)_{T,N} ={Nk_BT\over V},

and

S=(FT)V,N=NkB[ln(VNλT3)+52].S=-\left({\partial F\over \partial T}\right)_{V,N} =Nk_B\left[ \ln\left({V\over N\lambda_T^3}\right)+{5\over 2} \right].

The internal energy is

E=βlnZN=32NkBT,E=-{\partial\over \partial\beta}\ln Z_N ={3\over 2}Nk_BT,

and the heat capacity at constant volume is

CV=32NkB.C_V={3\over 2}Nk_B.

Equipartition explains this result: every quadratic term in the Hamiltonian contributes (1/2)kBT(1/2)k_BT to the mean energy. Each particle has three quadratic momentum components, hence (3/2)kBT(3/2)k_BT per particle.

The Maxwell distribution has several characteristic speeds:

vmp=2kBTm,v=8kBTπm,vrms=3kBTm.v_{\mathrm{mp}}=\sqrt{2k_BT\over m}, \qquad \langle v\rangle=\sqrt{8k_BT\over \pi m}, \qquad v_{\mathrm{rms}}=\sqrt{3k_BT\over m}.

In a gravitational field, canonical weighting gives the barometric formula

n(z)=n(0)emgz/(kBT).n(z)=n(0)e^{-mgz/(k_BT)}.

This is the same Boltzmann factor applied to potential energy rather than kinetic energy.

The density of states viewpoint gives the same physics from a different angle. For fixed NN, the number of momentum states with total kinetic energy below EE is proportional to the volume of a 3N3N-dimensional sphere of radius 2mE\sqrt{2mE}:

Γ(E)VNE3N/2.\Gamma(E)\propto V^N E^{3N/2}.

Taking a logarithm and differentiating gives

1T=SEkB3N2E,{1\over T}={\partial S\over \partial E} \approx k_B{3N\over 2E},

so E=(3/2)NkBTE=(3/2)Nk_BT. This microcanonical derivation makes clear that the ideal-gas temperature is a measure of kinetic energy per quadratic degree of freedom, not a separate microscopic force.

The Maxwell distribution is also a useful warning about measures. The vector velocity density is largest at v=0\mathbf v=0, but the speed distribution is zero at v=0v=0 because there is very little velocity-space volume near exactly zero speed. The most probable speed comes from maximizing v2emv2/(2kBT)v^2e^{-mv^2/(2k_BT)}, not from maximizing the Gaussian factor alone.

Classical validity requires more than weak interactions. The gas must also be nondegenerate:

nλT31.n\lambda_T^3\ll 1.

When this fails, the N!N! correction is not enough; Bose or Fermi occupation restrictions change the thermodynamics. Conversely, a very dilute gas with complicated molecules can still be nonideal in heat capacity because internal rotational and vibrational modes contribute to zintz_{\mathrm{int}}.

The barometric formula illustrates local equilibrium. Each height slice is assumed to have a Maxwellian velocity distribution at the same temperature, while density changes with potential energy. This separation between fast velocity equilibration and slow spatial variation reappears in the Boltzmann equation through the local Maxwell distribution.

The ideal gas also sets a baseline for interacting systems. Virial coefficients, transport coefficients, and phase-transition models are often stated as deviations from ideal behavior. When an equation of state is written as pV=NkBTpV=Nk_BT times a correction factor, the correction has meaning only because the ideal gas has already fixed the natural scale of pressure. Similarly, heat capacities of molecular gases are interpreted by asking which degrees of freedom have been added to the translational ideal-gas value.

Finally, the ideal gas is one of the best examples of ensemble equivalence. Microcanonical counting, canonical Gaussian integration, and grand-canonical Poisson statistics all produce the same thermodynamic equation of state in the macroscopic limit. Their fluctuations differ because their constraints differ, but the leading thermodynamic functions agree.

It is also a model of what interactions do not affect. In an ideal gas, the internal energy is independent of volume because there is no potential energy. Therefore a free expansion at fixed internal energy leaves the temperature unchanged for a classical monatomic ideal gas. Real gases do not obey this exactly because intermolecular attractions and repulsions make internal energy depend on density. The contrast is a useful diagnostic when studying Joule expansion and virial corrections.

The Maxwell distribution should be interpreted component by component and speed by speed. Each Cartesian component is Gaussian with variance kBT/mk_BT/m, while the speed has a skewed distribution because many velocity vectors share the same magnitude.

Visual

ResultFormulaComment
Partition functionZN=(V/λT3)N/N!Z_N=(V/\lambda_T^3)^N/N!classical, noninteracting, identical
Equation of statepV=NkBTpV=Nk_BTpressure from FF
Internal energyE=3NkBT/2E=3Nk_BT/2kinetic energy only
Heat capacityCV=3NkB/2C_V=3Nk_B/2temperature independent
Most probable speed2kBT/m\sqrt{2k_BT/m}maximum of P(v)P(v)
RMS speed3kBT/m\sqrt{3k_BT/m}from v2\langle v^2\rangle
P(v)
^
| .
| . .
| . .
| . .
| . .
+----------------------> v
v_mp <v> v_rms

Worked example 1: Deriving the one-particle momentum integral

Problem: Evaluate the one-particle canonical momentum integral

Ip=R3d3peβp2/(2m).I_p=\int_{\mathbb R^3} d^3p\,e^{-\beta p^2/(2m)}.

Method:

  1. Factor the integral into Cartesian components:
Ip=(dpxeβpx2/(2m))3.I_p= \left(\int_{-\infty}^{\infty} dp_x\,e^{-\beta p_x^2/(2m)}\right)^3.
  1. Use the Gaussian integral
eax2dx=πa.\int_{-\infty}^{\infty} e^{-a x^2}\,dx=\sqrt{\pi\over a}.

Here a=β/(2m)a=\beta/(2m), so

dpxeβpx2/(2m)=2πmβ.\int dp_x\,e^{-\beta p_x^2/(2m)} =\sqrt{2\pi m\over \beta}.
  1. Cube the result:
Ip=(2πmβ)3/2=(2πmkBT)3/2.I_p=\left({2\pi m\over \beta}\right)^{3/2} =(2\pi m k_BT)^{3/2}.
  1. Divide by h3h^3 and multiply by VV:
Z1=Vh3(2πmkBT)3/2=VλT3.Z_1={V\over h^3}(2\pi m k_BT)^{3/2} ={V\over \lambda_T^3}.

Checked answer: this is the single-particle factor whose NNth power gives the ideal-gas partition function.

Worked example 2: Characteristic speeds of nitrogen at room temperature

Problem: Estimate vmpv_{\mathrm{mp}}, v\langle v\rangle, and vrmsv_{\mathrm{rms}} for nitrogen molecules at T=300KT=300\,\mathrm K. Take m=4.65×1026kgm=4.65\times 10^{-26}\,\mathrm{kg}.

Method:

  1. Compute kBTk_BT:
kBT=(1.380649×1023)(300)=4.141947×1021J.k_BT=(1.380649\times 10^{-23})(300) =4.141947\times 10^{-21}\,\mathrm J.
  1. Most probable speed:
vmp=2kBTm=8.283894×10214.65×1026422m/s.v_{\mathrm{mp}} =\sqrt{2k_BT\over m} =\sqrt{8.283894\times 10^{-21}\over 4.65\times 10^{-26}} \approx 422\,\mathrm{m/s}.
  1. Mean speed:
v=8kBTπm=3.313558×10201.4608×1025476m/s.\langle v\rangle =\sqrt{8k_BT\over \pi m} =\sqrt{3.313558\times 10^{-20}\over 1.4608\times 10^{-25}} \approx 476\,\mathrm{m/s}.
  1. RMS speed:
vrms=3kBTm=1.242584×10204.65×1026517m/s.v_{\mathrm{rms}} =\sqrt{3k_BT\over m} =\sqrt{1.242584\times 10^{-20}\over 4.65\times 10^{-26}} \approx 517\,\mathrm{m/s}.

Checked answer: the ordering vmp<v<vrmsv_{\mathrm{mp}}\lt \langle v\rangle\lt v_{\mathrm{rms}} is required by the right-skewed speed distribution.

Code

import numpy as np

kB = 1.380649e-23
T = 300.0
m = 4.65e-26

v = np.linspace(0.0, 1500.0, 5000)
P = 4 * np.pi * v**2 * (m / (2 * np.pi * kB * T))**1.5 * np.exp(-m * v**2 / (2 * kB * T))
dv = v[1] - v[0]

print("normalization", np.trapz(P, v))
print("mean speed", np.trapz(v * P, v))
print("rms speed", np.sqrt(np.trapz(v**2 * P, v)))
print("most probable grid speed", v[np.argmax(P)])

Common pitfalls

  • Forgetting the 4πv24\pi v^2 factor when moving from velocity density to speed density.
  • Treating the Maxwell distribution as valid for dense or strongly interacting gases without corrections.
  • Dropping N!N! in ZNZ_N and producing nonextensive entropy.
  • Applying classical equipartition to frozen rotational, vibrational, or electronic modes at low temperature.
  • Confusing λT\lambda_T with a literal molecular size. It is a quantum length scale controlling the validity of the classical approximation.

Connections