---
title: "The Ideal Gas Partition Function and the Gibbs Paradox"
module: The Classical Ideal Gas
moduleNumber: 5
lessonNumber: 1
order: 501
summary: >
  The classical monatomic ideal gas built from the partition function. The
  single-particle sum is $z_1=V/\lambda^3$ with the thermal de Broglie
  wavelength $\lambda$; the $N$-particle partition function is $z_1^N/N!$, and
  the $N!$ is forced by indistinguishability. From $Z$ the ideal-gas law,
  $U=\tfrac32 Nk_BT$, and the Sackur–Tetrode entropy follow. The $N!$ makes the
  entropy extensive and resolves the Gibbs paradox: mixing identical gases
  produces no entropy change.
topics: [The Classical Ideal Gas]
sources:
  - book: Schroeder
    ref: "Ch. 6 — Boltzmann Statistics; §6.7 The Ideal Gas"
  - book: Reif
    ref: "Ch. 7 — Simple Applications of Statistical Mechanics; §7.2–7.4"
  - book: Kardar (Statistical Physics of Particles)
    ref: "Ch. 4 — Classical Statistical Mechanics; §4.8"
  - book: Pathria & Beale
    ref: "Ch. 1 — The Statistical Basis of Thermodynamics; §1.5–1.6, Ch. 3 §3.5"
draft: false
---

The monatomic ideal gas is the first system where the canonical machinery is
carried all the way to a closed thermodynamic potential. Its Hamiltonian is
purely kinetic, so the partition function factorizes into single-particle pieces
and the integrals are Gaussian. The result, the Sackur–Tetrode entropy, exposes
two features that the classical theory alone cannot supply: a length scale set by
$\hbar$ that fixes the additive constant of the entropy, and a factor $N!$ that
makes the entropy extensive. The missing $N!$ is the Gibbs paradox, and its
origin is the indistinguishability of identical particles.

## The single-particle partition function

A single structureless particle of mass $m$ confined to a box of volume $V$ has
the Hamiltonian $H = \vec p\,^2/2m$, with no potential energy inside the box. In
the classical phase-space form of the canonical ensemble, each quantum state
occupies a cell of volume $h^3$ in the six-dimensional single-particle phase
space, so the partition function is the phase-space integral divided by $h^3$,[^measure]

$$
z_1 = \frac{1}{h^3}\int_V \d^3 q \int_{-\infty}^{\infty} \d^3 p\; e^{-\beta \vec p\,^2/2m}.
$$

The configuration integral is trivial: the integrand is independent of position,
so $\int_V \d^3 q = V$. The momentum integral factorizes into three identical
Gaussians,

$$
\int_{-\infty}^{\infty} \d p_x\; e^{-\beta p_x^2/2m}
= \sqrt{\frac{2\pi m}{\beta}},
\qquad
\int \d^3 p\; e^{-\beta \vec p\,^2/2m} = \left(\frac{2\pi m}{\beta}\right)^{3/2}.
$$

Collecting the factors,

$$
z_1 = \frac{V}{h^3}\left(2\pi m k_B T\right)^{3/2} = \frac{V}{\lambda^3},
\qquad
\lambda \equiv \frac{h}{\sqrt{2\pi m k_B T}}.
$$

[^measure]: The $h^{-3N}$ measure and the $N!$ below are imposed here as the
classical limit of the quantum trace; both are derived from the quantum ideal gas
in the grand-canonical treatment. Kardar §4.8 and Pathria & Beale §3.5 present the
same limit. See MIT OCW 8.333, [ocw.mit.edu/courses/8-333](https://ocw.mit.edu/courses/8-333-statistical-mechanics-i-statistical-mechanics-of-particles-fall-2013/).

The quantity $\lambda$ is the **thermal de Broglie wavelength**. It is the de
Broglie wavelength of a particle whose kinetic energy is of order $k_B T$, and it
sets the scale on which quantum coherence between particles matters. With $\lambda$
in hand, $z_1 = V/\lambda^3$ has a direct reading: it counts how many thermal
cells of volume $\lambda^3$ fit inside the container.

$$
% caption: The single-particle partition function counts the box volume $V$ in units of the thermal cell $\lambda^3$, so $z_1=V/\lambda^3$. In the classical regime the cells vastly outnumber the particles, and almost every cell is empty.
\begin{tikzpicture}[>=Latex,font=\footnotesize,scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\draw[very thick] (0,0) rectangle (5,3.4);
\foreach \x in {0.5,1,...,4.5} \draw[black] (\x,0)--(\x,3.4);
\foreach \y in {0.5,1,...,3.0} \draw[black] (0,\y)--(5,\y);
\node[black] at (4.55,3.08) {$V$};
\draw[acc,very thick,fill=acc!30] (2.0,1.5) rectangle (2.5,2.0);
\node[black,align=left] at (7.0,1.75) {one thermal\\ cell};
\draw[->,black] (6.0,1.75)--(2.6,1.75);
\end{tikzpicture}
$$

Two limits fix the meaning. At high temperature or low density, $\lambda$ is small
compared with the mean interparticle spacing $n^{-1/3}$, where $n = N/V$; the
particles are far apart on the scale of their thermal wavelength and behave
classically. When $\lambda$ grows to the interparticle spacing, the wave packets
overlap and quantum statistics take over. The classical treatment of this lesson
requires the **nondegeneracy condition**

$$
n\lambda^3 \ll 1
\quad\Longleftrightarrow\quad
\lambda \ll n^{-1/3}.
$$

$$
% caption: Classical validity requires the thermal wavelength $\lambda$ to be small compared with the interparticle spacing $d=n^{-1/3}$. When $\lambda\ll d$ (left) the wave packets are disjoint and the gas is classical; when $\lambda\sim d$ (right) they overlap and quantum statistics govern.
\begin{tikzpicture}[>=Latex,font=\footnotesize,scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
% left: classical
\draw[black,<->] (0,-0.15)--(3.0,-0.15) node[midway,below,black]{spacing $d$};
\filldraw[acc] (0,0.6) circle (1.4pt);
\filldraw[acc] (3.0,0.6) circle (1.4pt);
\draw[acc,dashed] (0,0.6) circle (0.35);
\draw[acc,dashed] (3.0,0.6) circle (0.35);
\node[black] at (1.5,1.5) {classical: packets disjoint};
% right: quantum
\begin{scope}[xshift=5.2cm]
\draw[black,<->] (0,-0.15)--(1.6,-0.15) node[midway,below,black]{spacing $d$};
\filldraw[black] (0,0.6) circle (1.4pt);
\filldraw[black] (1.6,0.6) circle (1.4pt);
\draw[black,densely dotted] (0,0.6) circle (0.75);
\draw[black,densely dotted] (1.6,0.6) circle (0.75);
\node[black] at (0.8,1.75) {quantum: packets overlap};
\end{scope}
\end{tikzpicture}
$$

## The N-particle partition function and the factor N!

For $N$ noninteracting particles the Hamiltonian is a sum, $H = \sum_{i=1}^N \vec p_i\,^2/2m$,
so the Boltzmann factor factorizes and the phase-space integral separates into $N$
identical single-particle integrals. If the particles were labelled and
distinguishable, this would give $z_1^N$. They are not. Two configurations that
differ only by a permutation of identical particles are the same physical state,
and the labelled integral counts each physical state $N!$ times over. Correcting
the overcount divides by $N!$:

$$
Z_N = \frac{z_1^N}{N!} = \frac{1}{N!}\left(\frac{V}{\lambda^3}\right)^{N}.
$$

The division by $N!$ is **correct Boltzmann counting**. It is exact only in the
nondegenerate regime, where the probability that any single-particle state holds
more than one particle is negligible; then every occupied state is occupied once
and the permutations of the $N$ occupied states are all distinct, giving exactly
$N!$ relabellings per physical configuration. When occupancies are not small the
count of permutations that produce genuinely distinct arrangements is more subtle,
and the correct bookkeeping is Bose or Fermi statistics. For the classical gas,
$n\lambda^3\ll 1$ guarantees the simple $N!$.

$$
% caption: Three labelled particles placed in distinct cells give $3!=6$ orderings of the same physical state; dividing $z_1^N$ by $N!$ removes this overcount. The correction is exact when no cell holds more than one particle.
\begin{tikzpicture}[>=Latex,font=\footnotesize,scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\foreach \i/\lab in {0/1,1/2,2/3}{
  \draw[black] (\i*1.3,2.0) rectangle (\i*1.3+1.0,2.8);
}
\filldraw[acc] (0.5,2.4) circle (3pt) node[white,font=\scriptsize]{a};
\filldraw[black] (1.8,2.4) circle (3pt) node[white,font=\scriptsize]{b};
\filldraw[black!78] (3.1,2.4) circle (3pt) node[white,font=\scriptsize]{c};
\node[black] at (5.9,2.4) {same physical state};
\node[black,align=left] at (2.0,1.2) {$3!=6$ labelled orderings};
\node[black,align=left] at (2.0,0.55) {count the one state $6$ times};
\end{tikzpicture}
$$

## Thermodynamics from the free energy

The Helmholtz free energy follows from $F = -k_B T \ln Z_N$. Using Stirling's
approximation $\ln N! = N\ln N - N + O(\ln N)$,

$$
\ln Z_N = N\ln\frac{V}{\lambda^3} - \ln N!
= N\ln\frac{V}{\lambda^3} - N\ln N + N
= N\ln\!\left(\frac{V}{N\lambda^3}\right) + N,
$$

so

$$
F = -k_B T\ln Z_N = -N k_B T\left[\ln\!\left(\frac{V}{N\lambda^3}\right) + 1\right].
$$

Every equilibrium property comes from derivatives of $F$. The combination
$V/N\lambda^3 = 1/(n\lambda^3)$ appearing inside the logarithm is the reciprocal of
the degeneracy parameter, large in the classical regime.

**Pressure.** The mechanical equation of state is $P = -(\partial F/\partial V)_{T,N}$.
Only the $\ln V$ term carries volume dependence,

$$
P = -\left(\frac{\partial F}{\partial V}\right)_{T,N}
= \frac{N k_B T}{V}
\qquad\Longrightarrow\qquad
PV = N k_B T.
$$

The ideal-gas law is recovered, and it is independent of $\lambda$: the pressure
knows nothing about $\hbar$ or the mass, because those enter only the additive
constant of $F$.

**Internal energy.** With $\lambda\propto T^{-1/2}$, the temperature dependence of
$\ln Z_N$ sits in $\ln\lambda^{-3} = \tfrac32\ln T + \text{const}$, so
$\ln Z_N = \tfrac{3}{2}N\ln T + (T\text{-independent})$. Writing $\beta = 1/k_BT$,

$$
U = -\frac{\partial \ln Z_N}{\partial \beta}
= \frac{3}{2}\,\frac{N}{\beta}
= \frac{3}{2}N k_B T,
$$

which is $\tfrac12 k_B T$ per translational degree of freedom, three per particle.
The heat capacity is $C_V = (\partial U/\partial T)_V = \tfrac32 N k_B$, constant.

**Entropy.** The entropy is $S = -(\partial F/\partial T)_{V,N} = (U - F)/T$. Since
$\ln\lambda^{-3}=\tfrac32\ln T+\text{const}$ contributes $\tfrac32 N k_B$ from
$-\partial F/\partial T$ acting on the explicit $T$ prefactor and another
$\tfrac32 N k_B$ from the $\ln T$ inside the bracket, the two pieces combine with
the constant to give

$$
S = N k_B\left[\ln\!\left(\frac{V}{N\lambda^3}\right) + \frac{5}{2}\right].
$$

This is the **Sackur–Tetrode equation** for the monatomic ideal gas.[^st] Its
structure is worth reading term by term: the logarithm measures the number of
thermal cells per particle, and the additive $5/2$ collects the Gaussian
normalization and the Stirling remainder. The appearance of $\lambda$, and hence of
$h$, inside the logarithm means the classical entropy carries an absolute
zero-point set by quantum mechanics — a purely classical calculation would leave
the additive constant undetermined.

[^st]: Derived independently by Sackur and Tetrode in 1912. Schroeder §6.7 and
Reif §7.3 give the same result; the numerical agreement with measured vapor
entropies of monatomic gases was an early confirmation that $h$ sets the entropy
constant.

## Extensivity and the Gibbs paradox

Entropy is extensive: doubling a system at fixed intensive parameters must double
$S$. Scale $V\to\alpha V$ and $N\to\alpha N$ at fixed $T$. Then $\lambda$ is
unchanged, $V/N\lambda^3$ is unchanged, and

$$
S(\alpha N,\alpha V,T) = \alpha N k_B\left[\ln\!\left(\frac{V}{N\lambda^3}\right) + \frac52\right] = \alpha\, S(N,V,T).
$$

Extensivity holds precisely because the $N!$ turned $V$ inside the logarithm into
$V/N$. Drop the $N!$ and the entropy becomes

$$
S_{\text{no }N!} = N k_B\left[\ln\!\left(\frac{V}{\lambda^3}\right) + \frac{3}{2}\right],
$$

which fails the test: under $V\to\alpha V,\ N\to\alpha N$ it picks up a spurious
$\alpha N k_B\ln\alpha$. The non-extensive form assigns a larger entropy to a
combined system than to the sum of its parts, in violation of thermodynamics.

$$
% caption: Entropy at fixed density $n=N/V$ as the system size grows. With the $N!$ correction (indistinguishable) $S$ is linear in $N$, as extensivity demands; without it (distinguishable) $S$ grows faster than linearly, the excess being the spurious $Nk_B\ln N$.
\begin{tikzpicture}[>=Latex,font=\footnotesize,scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->,black] (0,0)--(5.4,0) node[right,black]{$N$};
\draw[->,black] (0,0)--(0,3.8) node[above,black]{$S$};
\draw[acc,very thick] (0,0)--(4.8,2.6);
\draw[black,very thick,dashed] plot[domain=0.15:4.8,samples=80] (\x,{0.542*\x + 0.30*\x*ln(\x+0.15)});
\node[acc,right] at (4.8,2.55) {indistinguishable};
\node[black,right] at (4.4,3.5) {distinguishable};
\end{tikzpicture}
$$

The physical face of this failure is the **Gibbs paradox**. Take two gas samples,
each of $N$ particles in volume $V$ at the same temperature and pressure,
separated by a partition, and remove the partition. Two cases must be distinguished.

**Distinct species.** If the two samples are different gases, say species $A$ on the
left and $B$ on the right, each expands into the full volume $2V$. Each contributes
an entropy increase $N k_B\ln 2$ from the volume doubling, so the total **entropy of
mixing** is

$$
\Delta S_{\text{mix}} = 2 N k_B\ln 2 > 0.
$$

This is real and measurable; interdiffusion of distinct gases is irreversible, and
unmixing them costs work.

**Identical species.** If the two samples are the same gas, removing the partition
changes nothing: the equilibrium state of $2N$ particles in $2V$ at the same $T,P$
is identical before and after, and reinserting the partition restores the original
state exactly. The entropy change must be zero. Sackur–Tetrode, with the $N!$,
delivers exactly this. Before,

$$
S_i = 2\, N k_B\left[\ln\!\left(\frac{V}{N\lambda^3}\right) + \frac52\right],
$$

and after, with $2N$ particles in $2V$,

$$
S_f = 2N k_B\left[\ln\!\left(\frac{2V}{2N\lambda^3}\right) + \frac52\right]
= 2N k_B\left[\ln\!\left(\frac{V}{N\lambda^3}\right) + \frac52\right] = S_i,
$$

so $\Delta S = 0$. The factors of two inside the logarithm cancel because both $V$
and $N$ doubled. Without the $N!$, the same calculation gives
$\Delta S = 2N k_B\ln 2$ even for identical gases — the paradox, an entropy of
mixing where nothing has mixed.

$$
% caption: Removing the partition between equal samples at the same $T,P$. Distinct species interdiffuse and the entropy rises by $2Nk_B\ln 2$; identical species leave the equilibrium state unchanged, so the entropy is the same before and after. Correct $N!$ counting reproduces both outcomes.
\begin{tikzpicture}[>=Latex,font=\footnotesize,scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
% ---- distinct column ----
\draw[black,very thick] (0,3.0) rectangle (3.0,4.2);
\draw[black,very thick] (1.5,3.0)--(1.5,4.2);
\foreach \p in {(0.4,3.35),(0.7,3.8),(1.05,3.5),(0.55,4.0),(1.2,3.9)}{\filldraw[acc] \p circle (1.6pt);}
\foreach \p in {(1.9,3.45),(2.4,3.7),(2.15,3.95),(2.7,3.4),(2.5,3.35)}{\filldraw[black!70] \p circle (1.6pt);}
\draw[->,black,very thick] (1.5,2.85)--(1.5,2.15);
\draw[black,very thick] (0,0.6) rectangle (3.0,1.8);
\foreach \p in {(0.4,0.95),(1.1,1.4),(2.2,1.0),(0.8,1.55),(2.6,1.5),(1.5,0.85)}{\filldraw[acc] \p circle (1.6pt);}
\foreach \p in {(0.7,1.15),(1.7,1.5),(2.4,1.25),(1.2,0.95),(2.0,1.55),(0.5,1.35)}{\filldraw[black!70] \p circle (1.6pt);}
\node[black,align=center] at (1.5,4.55) {distinct gases};
\node[black,align=center] at (1.5,0.1) {entropy rises};
% ---- identical column ----
\begin{scope}[xshift=5.0cm]
\draw[black,very thick] (0,3.0) rectangle (3.0,4.2);
\draw[black,very thick] (1.5,3.0)--(1.5,4.2);
\foreach \p in {(0.4,3.35),(0.7,3.8),(1.05,3.5),(0.55,4.0),(1.2,3.9),(1.9,3.45),(2.4,3.7),(2.15,3.95),(2.7,3.4),(2.5,3.35)}{\filldraw[acc] \p circle (1.6pt);}
\draw[->,black,very thick] (1.5,2.85)--(1.5,2.15);
\draw[black,very thick] (0,0.6) rectangle (3.0,1.8);
\foreach \p in {(0.4,0.95),(1.1,1.4),(2.2,1.0),(0.8,1.55),(2.6,1.5),(1.5,0.85),(0.7,1.15),(1.7,1.5),(2.4,1.25),(1.2,0.95),(2.0,1.55),(0.5,1.35)}{\filldraw[acc] \p circle (1.6pt);}
\node[black,align=center] at (1.5,4.55) {identical gas};
\node[black,align=center] at (1.5,0.1) {no change};
\end{scope}
\end{tikzpicture}
$$

The resolution is that the $N!$ is not an ad hoc fix for one paradox but the
statement that permuting identical particles does not produce a new microstate.
Once identical particles are indistinguishable, the mixing of identical gases is a
non-event and the entropy of mixing vanishes automatically, while genuinely
distinct species still mix irreversibly. The same indistinguishability, followed to
its quantum conclusion, becomes Bose and Fermi statistics; the classical $N!$ is
its leading, dilute-limit shadow.

## Chemical potential and the fugacity

The chemical potential follows from $\mu = (\partial F/\partial N)_{T,V}$, or more
cleanly from $F = -Nk_BT[\ln(V/N\lambda^3)+1]$ by differentiation,

$$
\mu = \left(\frac{\partial F}{\partial N}\right)_{T,V}
= -k_B T\ln\!\left(\frac{V}{N\lambda^3}\right)
= k_B T\ln\!\left(n\lambda^3\right).
$$

In the classical regime $n\lambda^3\ll 1$, so the logarithm is large and negative:
the chemical potential of a dilute classical gas is negative, and it grows toward
zero as the gas is compressed or cooled toward degeneracy. The **fugacity**
$z \equiv e^{\beta\mu} = n\lambda^3$ is then small, and it is the natural expansion
parameter for the corrections beyond the ideal gas. Consistency with the free
energy is immediate through the Euler relation $F = -PV + \mu N$: substituting
$P = nk_BT$ and $\mu = k_BT\ln(n\lambda^3)$ reproduces
$F = Nk_BT[\ln(n\lambda^3)-1] = -Nk_BT[\ln(V/N\lambda^3)+1]$.

## Summary

- The single-particle partition function is $z_1 = V/\lambda^3$ with the thermal
  wavelength $\lambda = h/\sqrt{2\pi m k_B T}$; it counts thermal cells of volume
  $\lambda^3$ in the box. Classical validity requires $n\lambda^3\ll 1$.
- Indistinguishability forces $Z_N = z_1^N/N!$ (correct Boltzmann counting), exact
  when no single-particle state is multiply occupied.
- From $F = -Nk_BT[\ln(V/N\lambda^3)+1]$ come $PV = Nk_BT$, $U = \tfrac32 Nk_BT$,
  $C_V = \tfrac32 Nk_B$, and the Sackur–Tetrode entropy
  $S = Nk_B[\ln(V/N\lambda^3)+\tfrac52]$.
- The $N!$ makes $S$ extensive and resolves the Gibbs paradox: identical gases
  mix with $\Delta S = 0$, while distinct species mix with $\Delta S = 2Nk_B\ln 2$.
- The chemical potential $\mu = k_BT\ln(n\lambda^3)$ is negative for a dilute gas;
  the fugacity $z = n\lambda^3$ is the small parameter of the classical limit.
