---
title: The Photon Gas and Planck's Radiation Law
module: Bosonic Systems
moduleNumber: 8
lessonNumber: 2
order: 802
summary: >
  Electromagnetic radiation in equilibrium with cavity walls is a gas of
  non-conserved bosons, and non-conservation forces the chemical potential to
  zero. Counting standing-wave modes with two polarizations and weighting each by
  the Bose occupation gives the Planck spectral energy density. Its low-frequency
  tail reproduces the classical Rayleigh-Jeans law and the ultraviolet
  catastrophe; the Bose factor cuts the divergence off at high frequency and the
  peak obeys Wien's displacement law.
topics: [Bosonic Systems]
sources:
  - book: Schroeder
    ref: "Ch. 7 — Quantum Statistics; §7.4 Blackbody Radiation"
  - book: Reif
    ref: "Ch. 9 — Quantum Statistics of Ideal Gases; §9.13–9.15"
  - book: Pathria & Beale
    ref: "Ch. 7 — Ideal Bose Systems; §7.2–7.3"
  - book: Kardar (Statistical Physics of Particles)
    ref: "Ch. 7 — Quantum Statistical Mechanics; §7.5"
draft: false
---

Thermal radiation in a cavity held at temperature $T$ is a gas of photons. The
walls emit and absorb photons continuously, so their number is not fixed by any
conservation law but set by the condition of thermal equilibrium. The general
[framework for ideal quantum gases](/statistical-mechanics/quantum-statistics/ideal-quantum-gases-general-framework)
converts a sum over occupied single-particle modes into an integral weighted by
the Bose-Einstein occupation; for photons that framework specializes cleanly
because two features fix the inputs at once — the dispersion is linear,
$\varepsilon = \hbar\omega = c\hbar k$, and the chemical potential is zero. The
output is the Planck law, the first quantitative success of the quantum
hypothesis and the spectrum of every blackbody from a furnace to the cosmic
microwave background.

## Non-conservation and the vanishing chemical potential

Photons are spin-$1$ massless bosons. A cavity wall at temperature $T$ absorbs a
photon into an excited atomic state and re-emits one, and nothing constrains the
total count $N$: the equilibrium value of $N$ is whatever minimizes the free
energy. For a system in contact with a heat bath at fixed $T$ and $V$, the
equilibrium state minimizes the Helmholtz free energy $F(T,V,N)$ over every
variable free to adjust. If $N$ is free, the minimum condition is

$$
\left(\frac{\partial F}{\partial N}\right)_{T,V} = 0.
$$

The left-hand side is the definition of the chemical potential, $\mu = (\partial
F/\partial N)_{T,V}$, so equilibrium of a non-conserved species forces

$$
\mu = 0.
$$

Every occupation number then reduces to the Bose-Einstein form evaluated at
$\mu = 0$,

$$
\langle n(\varepsilon)\rangle = \frac{1}{e^{\beta\varepsilon} - 1},
\qquad \beta = \frac{1}{k_B T},
$$

with no fugacity to determine.[^photon-mu] The same argument applies to any gas
of non-conserved quasiparticles, and the next lesson applies it verbatim to
[phonons](/statistical-mechanics/bose-systems/phonons-and-the-debye-model).

> **Definition (Photon gas).** The equilibrium electromagnetic field in a cavity
> of volume $V$ at temperature $T$, treated as an ideal gas of photons: bosons of
> energy $\varepsilon = \hbar\omega$, momentum $\vec p = \hbar\vec k$ with
> $\omega = c\lvert\vec k\rvert$, two transverse polarizations, and chemical
> potential $\mu = 0$ because photon number is not conserved.

## Counting the cavity modes

The allowed field configurations in a cubical cavity of side $L$ are standing
waves that vanish on the walls. Each Cartesian component of the wavevector is
quantized,

$$
k_i = \frac{\pi n_i}{L}, \qquad n_i = 1, 2, 3, \dots,
$$

so the allowed modes are the points of a cubic lattice in the positive octant of
$\vec k$-space, spaced $\pi/L$ apart. A single standing wave carries a definite
number of half-wavelengths along each axis.

$$
% caption: A standing electromagnetic mode of the cavity vanishes at both walls and fits a whole number of half-wavelengths across the width L; higher modes pack more nodes into the same box.
\begin{tikzpicture}[scale=1.0, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[black, thick] (0,0) -- (0,2.4);
\draw[black, thick] (6,0) -- (6,2.4);
\draw[black, dashed] (0,1.2) -- (6,1.2);
% n=1 half wave
\draw[acc, thick, smooth] plot[domain=0:6, samples=80] (\x,{1.2+0.85*sin(180*\x/6)});
% n=3 three half waves
\draw[black, thick, densely dashed, smooth] plot[domain=0:6, samples=120] (\x,{1.2+0.55*sin(3*180*\x/6)});
\node[text=acc, anchor=south] at (3,2.1) {lowest mode};
\node[text=black, anchor=north] at (1.0,0.5) {third mode};
\node[black, anchor=north] at (3,-0.05) {cavity width L};
\end{tikzpicture}
$$

The number of modes with wavevector magnitude up to $k$ is the volume of the
octant of a sphere of radius $n = kL/\pi$ in the integer lattice, one lattice
point per unit cell, multiplied by two for the polarizations:

$$
\mathcal{N}(k) = 2 \cdot \frac{1}{8} \cdot \frac{4}{3}\pi\left(\frac{kL}{\pi}\right)^3
= \frac{V k^3}{3\pi^2}.
$$

Differentiating gives the mode density in $k$, and converting through
$\omega = ck$ and $\omega = 2\pi f$ gives the density in frequency,

$$
\frac{\d\mathcal{N}}{\d k} = \frac{V k^2}{\pi^2},
\qquad
\frac{\d\mathcal{N}}{\d f} = \frac{8\pi V}{c^3}\, f^2.
$$

The factor $f^2$ is the geometric growth of the number of modes with frequency,
the same factor that drives the classical divergence below.

$$
% caption: Allowed wavevectors are lattice points in the positive octant of k-space; the modes up to magnitude k fill one-eighth of a sphere, and their count grows as k cubed.
\begin{tikzpicture}[scale=1.0, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (0,0) -- (3.4,0) node[right] {$n_x$};
\draw[->, black] (0,0) -- (0,3.4) node[above] {$n_y$};
\draw[->, black] (0,0) -- (-1.7,-1.3) node[left] {$n_z$};
% lattice points
\foreach \i in {0,1,2,3} \foreach \j in {0,1,2,3} \fill[acc] (\i*0.7,\j*0.7) circle (1.3pt);
% quarter arc (octant boundary in plane)
\draw[black, thick] (2.1,0) arc (0:90:2.1);
\draw[black, dashed] (0,0) -- (2.1,0);
\draw[black, dashed] (0,0) -- (0,2.1);
\node[text=black, anchor=south west] at (1.5,1.5) {radius n};
\node[text=acc, anchor=west] at (2.4,2.6) {allowed modes};
\end{tikzpicture}
$$

## The Planck spectral density

Each mode of frequency $f$ is an independent harmonic oscillator whose quantized
excitations are photons. The mean energy stored in a mode, measured from its
ground state, is the occupation times the quantum $hf$,

$$
\bar\varepsilon(f) = \langle n\rangle\, hf = \frac{hf}{e^{hf/k_B T} - 1}.
$$

The spectral energy density — energy per unit volume per unit frequency — is the
mode density per volume times the mean energy per mode:

$$
u(f) = \frac{1}{V}\,\frac{\d\mathcal{N}}{\d f}\,\bar\varepsilon(f)
= \frac{8\pi f^2}{c^3}\,\frac{hf}{e^{hf/k_B T} - 1}.
$$

> **Theorem (Planck radiation law).** The energy per unit volume of cavity
> radiation with frequency between $f$ and $f + \d f$ is
> $$
> u(f)\,\d f = \frac{8\pi h}{c^3}\,\frac{f^3\,\d f}{e^{hf/k_B T} - 1}.
> $$
> In terms of wavelength, using $u(f)\,\d f = -u(\lambda)\,\d\lambda$ and
> $f = c/\lambda$,
> $$
> u(\lambda)\,\d\lambda = \frac{8\pi hc}{\lambda^5}\,
> \frac{\d\lambda}{e^{hc/\lambda k_B T} - 1}.
> $$

The two forms describe the same radiation field but peak at different arguments,
because the Jacobian $\d f/\d\lambda = -c/\lambda^2$ reshapes the curve.[^planck]

## Classical limits and the ultraviolet catastrophe

The mean energy per mode carries the whole quantum content. Expanding it in the
two limits recovers the classical law and its failure.

- **Rayleigh-Jeans limit ($hf \ll k_B T$).** The denominator linearizes,
  $e^{hf/k_B T} - 1 \approx hf/k_B T$, so $\bar\varepsilon \to k_B T$ and
  $$
  u(f) \to \frac{8\pi f^2}{c^3}\,k_B T.
  $$
  This is exactly equipartition — $k_B T$ per electromagnetic mode — and it is
  the classical prediction. It grows without bound as $f^2$, so the total energy
  density $\int_0^\infty u(f)\,\d f$ diverges. That divergence is the
  **ultraviolet catastrophe**: classical physics assigns $k_B T$ to arbitrarily
  high-frequency modes, of which there are infinitely many.
- **Wien limit ($hf \gg k_B T$).** The $-1$ is negligible against the
  exponential, so
  $$
  u(f) \to \frac{8\pi h f^3}{c^3}\, e^{-hf/k_B T}.
  $$
  The exponential suppression reflects the cost of exciting even one photon in a
  mode whose quantum $hf$ exceeds the thermal energy: such modes are frozen out,
  their mean occupation exponentially small.

The quantization $\bar\varepsilon = hf/(e^{hf/k_B T}-1)$ interpolates between the
two. At low frequency it returns $k_B T$; past $hf \approx k_B T$ it collapses
toward zero and tames the $f^2$ growth of the mode count. The finite peak is the
balance of a rising mode density against a falling occupation.

$$
% caption: The mean energy per mode is the flat classical value kT at low frequency and falls off exponentially once the photon energy exceeds the thermal energy, cutting the mode-counting divergence.
\begin{tikzpicture}[scale=1.0, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (0,0) -- (6.4,0) node[right] {frequency};
\draw[->, black] (0,0) -- (0,3.2) node[above] {energy per mode};
\draw[black, dashed] (0,2.6) -- (6.0,2.6);
\node[black, anchor=east] at (-0.05,2.6) {$k_B T$};
% classical flat
\draw[black, thick, dashed] (0,2.6) -- (6.0,2.6);
\node[text=black, anchor=south] at (4.6,2.65) {classical};
% quantum: kT then decays
\draw[acc, thick, smooth] plot coordinates
  {(0,2.55)(0.7,2.5)(1.4,2.38)(2.1,2.12)(2.7,1.72)(3.3,1.25)(3.9,0.82)(4.6,0.45)(5.3,0.22)(6.0,0.1)};
\node[text=acc, anchor=west] at (2.9,1.55) {quantum};
\end{tikzpicture}
$$

$$
% caption: The Planck energy density with its two classical asymptotes: the Rayleigh-Jeans law rising as frequency squared and diverging, and the Wien exponential tail. The true spectrum tracks each in its regime and peaks between them.
\begin{tikzpicture}[scale=1.0, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (0,0) -- (6.8,0) node[right] {frequency};
\draw[->, black] (0,0) -- (0,3.6) node[above] {u(f)};
% Rayleigh-Jeans f^2
\draw[black, thick, dashed, smooth] plot coordinates {(0,0)(0.8,0.16)(1.6,0.64)(2.4,1.44)(3.0,2.25)(3.5,3.06)(3.75,3.5)};
\node[text=black, anchor=south west] at (2.9,3.0) {Rayleigh-Jeans};
% Wien tail
\draw[black, thick, dash dot, smooth] plot coordinates {(2.3,3.4)(2.9,2.4)(3.6,1.5)(4.3,0.95)(5.0,0.58)(5.7,0.34)(6.4,0.2)};
\node[text=black, anchor=west] at (4.7,1.15) {Wien};
% Planck
\draw[acc, very thick, smooth] plot coordinates {(0,0)(0.6,0.5)(1.2,1.3)(1.8,2.05)(2.35,2.5)(2.9,2.4)(3.6,1.5)(4.3,0.95)(5.0,0.58)(5.7,0.34)(6.4,0.2)};
\node[text=acc, anchor=south] at (1.9,2.15) {Planck};
\end{tikzpicture}
$$

## Wien's displacement law

The spectrum peaks at a frequency proportional to temperature. Writing
$x = hf/k_B T$, the frequency density is $u \propto x^3/(e^x - 1)$, and setting
its derivative to zero gives the transcendental condition

$$
3\left(1 - e^{-x}\right) = x,
$$

with root $x_{\max} \approx 2.821$. The peak frequency is therefore

$$
f_{\max} = 2.821\,\frac{k_B T}{h} \propto T.
$$

Repeating the calculation for the wavelength density $u(\lambda) \propto
\lambda^{-5}/(e^{hc/\lambda k_B T} - 1)$ gives the condition $5(1 - e^{-y}) = y$
with $y = hc/\lambda k_B T$ and root $y_{\max} \approx 4.965$, so

$$
\lambda_{\max}\, T = \frac{hc}{4.965\,k_B} = 2.898\times 10^{-3}\ \mathrm{m\,K}.
$$

The two peaks disagree, $x_{\max} \neq y_{\max}$, precisely because of the
Jacobian between $f$ and $\lambda$; the peak of the frequency curve and the peak
of the wavelength curve are different physical features of the same field.[^wien]

> **Theorem (Wien displacement law).** The wavelength at which the blackbody
> spectrum is brightest is inversely proportional to temperature,
> $\lambda_{\max} = b/T$ with $b = 2.898\ \mathrm{mm\,K}$. Hotter bodies radiate
> at shorter wavelength: a stove element glows red, the Sun's photosphere at
> $5800\ \mathrm{K}$ peaks in the visible, and the $2.725\ \mathrm{K}$ cosmic
> background peaks in the microwave.

$$
% caption: Blackbody spectra at three temperatures. Raising the temperature lifts the whole curve and slides its peak to higher frequency in fixed proportion to T, the displacement law.
\begin{tikzpicture}[scale=1.0, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (0,0) -- (7.0,0) node[right] {frequency};
\draw[->, black] (0,0) -- (0,3.8) node[above] {u(f)};
% cool
\draw[black, thick, densely dotted, smooth] plot coordinates {(0,0)(0.5,0.28)(1.0,0.62)(1.4,0.78)(1.9,0.62)(2.5,0.38)(3.2,0.2)(4.0,0.09)(4.8,0.04)};
\node[text=black, anchor=west] at (2.4,0.42) {cooler};
% mid
\draw[acc, thick, smooth] plot coordinates {(0,0)(0.7,0.5)(1.4,1.2)(2.1,1.62)(2.6,1.48)(3.3,1.0)(4.1,0.58)(4.9,0.32)(5.6,0.17)};
\node[text=acc, anchor=south] at (2.2,1.68) {warmer};
% hot
\draw[black, thick, dashed, smooth] plot coordinates {(0,0)(0.9,0.7)(1.8,1.9)(2.9,2.85)(3.5,2.72)(4.3,2.0)(5.1,1.25)(5.9,0.72)(6.6,0.4)};
\node[text=black, anchor=south] at (3.2,2.9) {hottest};
% peak locus
\draw[black, dashed] (1.4,0.78) -- (2.6,1.48) -- (3.5,2.72);
\node[black, anchor=west] at (3.55,2.5) {peak locus};
\end{tikzpicture}
$$

> **Worked example.** The Sun's photosphere radiates as a blackbody near
> $T = 5800\ \mathrm{K}$. The brightest wavelength is
> $$
> \lambda_{\max} = \frac{2.898\times 10^{-3}\ \mathrm{m\,K}}{5800\ \mathrm{K}}
> \approx 5.0\times 10^{-7}\ \mathrm{m} = 500\ \mathrm{nm},
> $$
> in the middle of the visible band, so the Sun peaks in green-yellow. A stove
> element at $800\ \mathrm{K}$ peaks at $\lambda_{\max} \approx 3.6\ \mu\mathrm{m}$
> in the infrared, with only the short-wavelength tail of its spectrum reaching
> the red end of the visible, which is why it glows dull red rather than white.

## Summary

- Photon number is not conserved; equilibrium at fixed $T,V$ minimizes $F$ over
  $N$, giving $\mu = (\partial F/\partial N)_{T,V} = 0$ and Bose occupation
  $\langle n\rangle = 1/(e^{hf/k_B T} - 1)$.
- Standing-wave modes in a cavity number $\d\mathcal{N}/\d f = 8\pi V f^2/c^3$
  after counting two polarizations; the $f^2$ growth is the geometric origin of
  the classical divergence.
- The Planck density $u(f) = (8\pi h f^3/c^3)/(e^{hf/k_B T} - 1)$ returns the
  Rayleigh-Jeans law $8\pi f^2 k_B T/c^3$ for $hf \ll k_B T$ and the Wien tail
  for $hf \gg k_B T$; the Bose factor cuts off the ultraviolet catastrophe.
- The peak obeys Wien's displacement law: $f_{\max} \propto T$, and
  $\lambda_{\max} T = 2.898\ \mathrm{mm\,K}$, the frequency and wavelength peaks
  differing by the Jacobian between them.

[^photon-mu]: Schroeder, §7.4, derives $\mu = 0$ for photons from the equilibrium
condition on $F$; Pathria & Beale, §7.3, obtain the same result by noting the
photon gas has no fugacity in its grand partition function.
[^planck]: Reif, §9.13–9.14, and Pathria & Beale, §7.3, give both the frequency
and wavelength forms and the mode count with two polarizations.
[^wien]: Schroeder, §7.4, works the peak conditions; the CODATA value of the
Wien displacement constant is $b = 2.897\,771\times 10^{-3}\ \mathrm{m\,K}$. See
NIST, <https://physics.nist.gov/cuu/Constants/>.
