---
title: Phase Space, Trajectories, and Liouville's Theorem
module: Microstates, Phase Space, and Statistical Entropy
moduleNumber: 2
lessonNumber: 2
order: 202
summary: >
  A classical system of N particles is one point in a 6N-dimensional phase
  space, and its evolution is a single trajectory driven by Hamilton's
  equations. This lesson builds that geometric picture, introduces the
  phase-space density of an ensemble, and proves Liouville's theorem: the
  density is carried by the flow as an incompressible fluid, so phase-space
  volume is conserved. The stationary densities of equilibrium follow as
  functions of the conserved quantities alone.
topics: ["Microstates, Phase Space, and Statistical Entropy"]
sources:
  - book: Reif
    ref: "Ch. 2 Statistical Description of Systems of Particles; §2.1–2.4"
  - book: Kardar
    ref: "Statistical Physics of Particles, Ch. 3 Kinetic Theory of Gases; §3.1–3.3 (phase space, Liouville's theorem)"
  - book: Pathria & Beale
    ref: "Statistical Mechanics, Ch. 2 Elements of Ensemble Theory; §2.1–2.2"
draft: false
---

The previous lesson took the Boltzmann distribution as given and read the
properties of matter off it. The rest of the course derives that distribution,
and every derivation rests on one geometric object: the space of all mechanical
states of the system. A microstate is a complete specification of the
positions and momenta of every particle, and the collection of all such
specifications is **phase space**. The dynamics is a flow on this space, and the
central fact about the flow — that it preserves volume — is Liouville's theorem.
It is the foundation on which the postulate of equal a priori probabilities, and
therefore all of equilibrium statistical mechanics, is built.[^reif-intro]

## The microstate as a point in phase space

A system of $N$ point particles in three dimensions is described classically by
$3N$ generalized coordinates $q = (q_1, \dots, q_{3N})$ and their $3N$ conjugate
momenta $p = (p_1, \dots, p_{3N})$. A single point

$$
X = (q_1, \dots, q_{3N},\, p_1, \dots, p_{3N})
$$

in the $6N$-dimensional space fixes the instantaneous mechanical state of the
entire system.

> **Definition (Phase space).** The **phase space** $\Gamma$ of a system with
> $3N$ degrees of freedom is the $6N$-dimensional space whose coordinates are the
> generalized positions and momenta $(q, p)$. A single point $X \in \Gamma$ is a
> **microstate**: it specifies every position and momentum at one instant, and
> therefore, through the equations of motion, the entire past and future of the
> system.[^reif-gamma]

The distinction between two spaces is worth fixing at the outset, because both
appear throughout the subject.

- **$\Gamma$-space** (the full phase space) has $6N$ dimensions. One point is
  the state of the whole $N$-particle system.
- **$\mu$-space** (the single-particle phase space) has six dimensions, the
  position and momentum of one particle. The state of the whole system is then a
  cloud of $N$ points in $\mu$-space, one per particle.

The $\mu$-space picture is the natural home of the Maxwell-Boltzmann
distribution of the last lesson — each molecule is a point, and the distribution
is the density of the cloud. The $\Gamma$-space picture is the natural home of
ensemble theory, developed in the next two lessons, where a whole system is one
point and the ensemble is a cloud of systems. Liouville's theorem is a statement
in $\Gamma$-space.

## Hamiltonian flow

The evolution of the microstate is fixed by Hamilton's equations. For a
Hamiltonian $H(q, p, t)$ giving the total energy as a function of the coordinates
and momenta,

$$
\dot q_i = \frac{\partial H}{\partial p_i}, \qquad
\dot p_i = -\frac{\partial H}{\partial q_i}, \qquad i = 1, \dots, 3N.
$$

These $6N$ first-order equations define a velocity field on $\Gamma$: at each
point $X$ they give the phase-space velocity

$$
\dot X = (\dot q, \dot p)
= \left(\frac{\partial H}{\partial p},\, -\frac{\partial H}{\partial q}\right).
$$

The microstate moves along the integral curve of this field, tracing a
**phase-space trajectory**. Because the field is single-valued, exactly one
trajectory passes through each point, and trajectories never cross: a
deterministic system has a unique future and a unique past from any state.

For a time-independent Hamiltonian the energy is conserved, $\dot H = 0$ along
the motion, so a trajectory is confined to the constant-energy surface
$H(q, p) = E$, a $(6N-1)$-dimensional hypersurface in $\Gamma$. Additional
conserved quantities — total momentum, total angular momentum for an isolated
system — confine it further. The trajectory winds on the intersection of these
surfaces, and for a generic (non-integrable) system it explores that
intersection densely, a property taken up in the next lesson as ergodicity.

$$
% caption: A phase-space trajectory is confined to the constant-energy surface
% H = E and winds over it; the energy surface is one level set of the
% Hamiltonian in the 6N-dimensional phase space.
\begin{tikzpicture}[scale=1.0, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
% energy surface as a distorted closed blob
\draw[acc, thick] plot [smooth cycle, tension=0.8] coordinates
  {(0,0) (2.4,0.5) (3.8,-0.2) (4.4,1.6) (3.2,3.0) (1.2,3.2) (-0.4,2.0) (-0.6,0.8)};
\node[text=acc, anchor=west] at (3.9,2.7) {surface $H = E$};
% winding trajectory inside
\draw[black, thick] plot [smooth, tension=0.9] coordinates
  {(0.6,1.0) (1.6,0.7) (2.8,1.3) (2.4,2.2) (1.2,2.4) (0.5,1.7) (1.1,1.2) (2.0,1.5) (2.6,2.0)};
\fill[black] (0.6,1.0) circle (1.6pt);
\node[text=black, anchor=north] at (0.6,0.9) {$X(t_0)$};
\node[text=black, anchor=west] at (2.7,2.0) {trajectory};
\end{tikzpicture}
$$

## The phase-space density of an ensemble

Statistical mechanics does not follow one trajectory; it considers a large
collection of identically prepared systems — an **ensemble** — occupying many
points of $\Gamma$ at once. When the number of systems is large the cloud is
described by a smooth density.

> **Definition (Phase-space density).** The **phase-space density**
> $\rho(q, p, t)$ is defined so that
> $$
> \rho(q, p, t)\, \d^{3N}q\, \d^{3N}p
> $$
> is the number of ensemble members (or, when normalized, the probability) whose
> microstate lies in the volume element $\d^{3N}q\, \d^{3N}p$ about $(q, p)$ at
> time $t$. Normalized to unit total probability,
> $$
> \int_\Gamma \rho(q, p, t)\, \d^{3N}q\, \d^{3N}p = 1.
> $$

The ensemble average of any observable $A(q, p)$ is its mean over the density,

$$
\langle A \rangle(t) = \int_\Gamma A(q, p)\, \rho(q, p, t)\, \d^{3N}q\, \d^{3N}p.
$$

Equilibrium statistical mechanics is the search for the stationary density
$\rho_\text{eq}$, the one for which $\langle A \rangle$ does not change in time.
Finding it requires knowing how $\rho$ evolves, which is what Liouville's theorem
supplies.

## Liouville's theorem

The ensemble members are neither created nor destroyed as they move: each system
follows its own trajectory. The density therefore obeys a continuity equation in
$\Gamma$, exactly as a conserved fluid does in ordinary space. Writing the
$6N$-dimensional phase-space velocity as $\dot X = (\dot q, \dot p)$, conservation
of ensemble members reads

$$
\frac{\partial \rho}{\partial t}
+ \nabla_X \cdot (\rho\, \dot X) = 0,
$$

where $\nabla_X \cdot$ is the divergence over all $6N$ phase-space coordinates.
Expanding the divergence,

$$
\nabla_X \cdot (\rho\, \dot X)
= \sum_{i=1}^{3N}
\left[ \frac{\partial (\rho\, \dot q_i)}{\partial q_i}
     + \frac{\partial (\rho\, \dot p_i)}{\partial p_i} \right]
= \sum_i \left( \dot q_i \frac{\partial \rho}{\partial q_i}
             + \dot p_i \frac{\partial \rho}{\partial p_i} \right)
+ \rho \sum_i \left( \frac{\partial \dot q_i}{\partial q_i}
                   + \frac{\partial \dot p_i}{\partial p_i} \right).
$$

The final sum vanishes identically. Substituting Hamilton's equations,

$$
\sum_i \left( \frac{\partial \dot q_i}{\partial q_i}
            + \frac{\partial \dot p_i}{\partial p_i} \right)
= \sum_i \left( \frac{\partial}{\partial q_i}\frac{\partial H}{\partial p_i}
             - \frac{\partial}{\partial p_i}\frac{\partial H}{\partial q_i} \right)
= 0,
$$

because mixed second partials of $H$ are equal. **The Hamiltonian flow is
divergence-free.** The continuity equation collapses to

$$
\frac{\partial \rho}{\partial t}
+ \sum_i \left( \dot q_i \frac{\partial \rho}{\partial q_i}
              + \dot p_i \frac{\partial \rho}{\partial p_i} \right) = 0.
$$

The left side is the total time derivative of $\rho$ along a trajectory — the
rate of change seen by an observer riding with the flow.

> **Theorem (Liouville).** The phase-space density is constant along every
> trajectory of the Hamiltonian flow:
> $$
> \frac{\d \rho}{\d t}
> = \frac{\partial \rho}{\partial t}
> + \sum_i \left( \dot q_i \frac{\partial \rho}{\partial q_i}
>               + \dot p_i \frac{\partial \rho}{\partial p_i} \right) = 0.
> $$
> The flow in phase space is that of an incompressible fluid; a comoving volume
> element retains its measure as it is transported and distorted.[^reif-liouville]

The two readings of the theorem must be kept apart. The **comoving**
(Lagrangian) derivative $\d\rho/\d t$ is zero: a bundle of systems keeps the same
density as it moves. The **local** (Eulerian) derivative $\partial\rho/\partial
t$ at a fixed point need not be zero, because the flow can carry a denser bundle
past that point. Only when the two agree — when $\partial\rho/\partial t = 0$
everywhere — is the ensemble stationary.

## Incompressibility and volume conservation

The divergence-free property has a direct geometric statement. Consider a small
region $R_0$ of phase space at time $t_0$, of volume

$$
\Omega(t_0) = \int_{R_0} \d^{3N}q\, \d^{3N}p.
$$

Let each point of $R_0$ flow forward under the dynamics to time $t$, carrying the
region to $R_t$. The map $X(t_0) \mapsto X(t)$ has a Jacobian, and the
divergence-free condition makes that Jacobian unity: the transported region has
the same volume,

$$
\Omega(t) = \int_{R_t} \d^{3N}q\, \d^{3N}p = \Omega(t_0).
$$

The shape of the region can distort without bound — a compact blob is stretched
into long thin filaments that thread through phase space — but its total volume
is fixed. The simple harmonic oscillator makes the mechanism concrete. Its phase
space is the $(x, p)$ plane, its trajectories are ellipses, and a cell of initial
conditions is rotated rigidly around the origin, conserving area exactly. A more
generic system shears the cell, as sketched below.

$$
% caption: A phase-space cell is carried by the flow and sheared out of shape,
% yet its area is unchanged (Liouville). Left: an initial square of initial
% conditions. Right: the same set of systems later, stretched but equal in area.
\begin{tikzpicture}[scale=1.0, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
% axes left
\draw[->, black] (-0.3,0) -- (3.3,0) node[right] {q};
\draw[->, black] (0,-0.3) -- (0,3.0) node[above] {p};
\fill[acc!16, draw=acc, thick] (0.7,0.7) rectangle (1.7,1.7);
\node[anchor=south] at (1.2,1.75) {initial cell};
\node[anchor=north, font=\scriptsize] at (1.5,-0.35) {time $t_0$};
% axes right
\begin{scope}[xshift=5.0cm]
\draw[->, black] (-0.3,0) -- (3.3,0) node[right] {q};
\draw[->, black] (0,-0.3) -- (0,3.0) node[above] {p};
\fill[acc!16, draw=acc, thick, dashed] (0.5,0.6) -- (2.6,1.1) -- (2.9,2.0) -- (0.8,1.5) -- cycle;
\node[anchor=south] at (1.9,1.9) {sheared, equal area};
\node[anchor=north, font=\scriptsize] at (1.5,-0.35) {time $t$};
\end{scope}
\draw[->, black, very thick] (3.6,1.3) -- (4.6,1.3);
\node[anchor=south, font=\scriptsize] at (4.1,1.35) {evolution};
\end{tikzpicture}
$$

Volume conservation is why phase-space volume is the right measure of the number
of states. If the dynamics could compress a region, an even distribution over
states would not stay even, and the counting on which entropy rests would be
frame-dependent. Liouville's theorem guarantees it is not.

## Stationary ensembles and equilibrium

A stationary ensemble is one whose local density does not change,
$\partial\rho/\partial t = 0$. Liouville's theorem then forces

$$
\sum_i \left( \dot q_i \frac{\partial \rho}{\partial q_i}
            + \dot p_i \frac{\partial \rho}{\partial p_i} \right)
= \{\rho, H\} = 0,
$$

where the **Poisson bracket** of two phase functions is

$$
\{A, B\} = \sum_i \left(
\frac{\partial A}{\partial q_i}\frac{\partial B}{\partial p_i}
- \frac{\partial A}{\partial p_i}\frac{\partial B}{\partial q_i} \right).
$$

The compact form of Liouville's theorem is therefore

$$
\frac{\partial \rho}{\partial t} = -\{\rho, H\} = \{H, \rho\}.
$$

A density is stationary when it Poisson-commutes with the Hamiltonian. The
cleanest way to guarantee that is to make $\rho$ a function of the coordinates and
momenta **only through conserved quantities**. If $\rho = \rho(H)$ depends on
$(q, p)$ solely through the energy, then $\{\rho, H\} = \rho'(H)\{H, H\} = 0$
automatically, and the ensemble is stationary.

> **Invariant.** Any density that depends on phase-space location only through
> constants of the motion is stationary. In particular $\rho = \rho(H)$ solves
> $\{\rho, H\} = 0$, so every equilibrium ensemble is a function of the energy
> (and any other conserved quantities such as $N$ and $V$) alone.[^kardar-stationary]

This single conclusion organizes the whole ensemble program. It does not yet say
which function of the energy to take. Two natural choices generate the ensembles
of the following modules:

- **$\rho$ constant on an energy surface, zero off it.** All accessible
  microstates of fixed energy are equally weighted. This is the microcanonical
  ensemble, and its justification is the postulate of equal a priori
  probabilities in the next lesson.
- **$\rho \propto e^{-\beta H}$.** An exponential of the energy, stationary
  because it is a function of $H$. This is the canonical ensemble, derived for a
  system in contact with a heat bath.

Liouville's theorem narrows the candidates for equilibrium to functions of the
conserved quantities; a physical postulate selects the one nature uses.

## The energy shell

An isolated system has a fixed energy, but no real system is prepared with the
energy known to infinite precision, and the constant-energy surface $H = E$ has
zero $6N$-dimensional volume. The construction that carries finite measure is a
thin **energy shell**: the set of microstates whose energy lies between $E$ and
$E + \delta E$, for a small tolerance $\delta E$.

$$
% caption: The energy shell is the thin region between the surfaces H = E and
% H = E plus delta-E; it carries the finite phase-space volume that the
% microcanonical ensemble spreads its probability over.
\begin{tikzpicture}[scale=1.0, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
% inner and outer surfaces as nested blobs
\draw[acc, thick] plot [smooth cycle, tension=0.8] coordinates
  {(0,0) (2.2,0.4) (3.4,-0.1) (3.9,1.5) (2.9,2.7) (1.1,2.9) (-0.3,1.8) (-0.5,0.7)};
\draw[acc, thick, dashed] plot [smooth cycle, tension=0.8] coordinates
  {(0.25,0.35) (2.1,0.7) (3.05,0.25) (3.45,1.5) (2.65,2.4) (1.2,2.55) (0.05,1.7) (-0.1,0.85)};
% shading hint between (a few radial ticks)
\foreach \a in {20,70,130,200,260,320}
  \draw[black] ({1.7+1.7*cos(\a)},{1.5+1.3*sin(\a)}) -- ({1.7+1.45*cos(\a)},{1.5+1.1*sin(\a)});
\node[text=acc, anchor=west] at (3.5,2.3) {$H = E$};
\node[text=acc, anchor=west] at (3.3,0.1) {outer boundary};
\node[anchor=center, font=\scriptsize] at (1.7,1.5) {shell};
\end{tikzpicture}
$$

The shell volume is the surface area of the energy surface times its thickness in
energy. Writing $\Gamma(E)$ for the phase-space volume enclosed by $H \le E$, the
shell of width $\delta E$ has volume

$$
\Omega(E)\, \delta E = \frac{\partial \Gamma}{\partial E}\, \delta E,
$$

so $\Omega(E) = \partial\Gamma/\partial E$ is the **density of states** in phase
space — the area of the energy surface measured with the right normal thickness.
For $N$ of order $10^{22}$ the enclosed volume $\Gamma(E)$ grows so violently
with $E$ that almost all of it sits within a hair of the surface: the shell and
the whole enclosed volume have logarithms that agree to relative order $1/N$. The
microcanonical entropy $S = k\ln\Omega$ is therefore insensitive to the arbitrary
choice of $\delta E$, a point the microcanonical module makes quantitative for
the ideal gas.

## Coarse-graining and the μ-space description

Liouville's theorem creates a tension with the second law. The fine-grained
density $\rho$ is carried rigidly by the flow, so any functional of it that the
flow preserves — in particular the Gibbs entropy $-k\int\rho\ln\rho$, built in the
next lessons — cannot increase. Yet observed entropy does increase. The
resolution is **coarse-graining**: partition $\Gamma$ into small but finite cells
and replace $\rho$ by its average $\bar\rho$ over each cell.

The filamentation guaranteed by Liouville's theorem stretches an initial blob
into ever-finer threads that wind through many cells. The fine-grained density
stays constant on those threads, but the cell average spreads out as the threads
distribute themselves, and the coarse-grained entropy rises. The exact volume is
conserved; the volume that a finite-resolution measurement can resolve grows.
This is the mechanical seed of irreversibility, developed when the Gibbs entropy
is introduced.

For a dilute gas of weakly interacting particles a second reduction is available.
When correlations between particles are negligible the $\Gamma$-space density
factorizes into single-particle densities, and the whole state is captured by the
occupation of the six-dimensional $\mu$-space. The number of particles in a
$\mu$-space cell is a histogram — the coarse-grained one-particle distribution —
and its evolution under collisions is the subject of kinetic theory. At
equilibrium this $\mu$-space density is the Maxwell speed distribution of the
previous lesson.

$$
% caption: The mu-space occupation histogram: each particle of the gas is one
% point in the six-dimensional single-particle phase space, and the coarse
% number in each cell is the one-particle distribution whose equilibrium form is
% Maxwell-Boltzmann.
\begin{tikzpicture}[scale=1.0, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (0,0) -- (7.0,0) node[right] {single-particle energy};
\draw[->, black] (0,0) -- (0,3.2) node[above] {cell count};
\foreach \x/\h in {0.3/1.15, 0.95/2.35, 1.6/2.8, 2.25/2.55, 2.9/2.05, 3.55/1.55, 4.2/1.15, 4.85/0.82, 5.5/0.56, 6.15/0.38} {
  \fill[acc!16, draw=acc] (\x,0) rectangle (\x+0.55,\h);
}
\draw[black, thick, smooth] plot coordinates
  {(0.15,0.7)(0.9,2.1)(1.6,2.75)(2.3,2.6)(3.0,2.05)(3.7,1.5)(4.4,1.05)(5.1,0.7)(5.8,0.45)(6.5,0.28)};
\node[black!70, anchor=west, font=\scriptsize] at (3.5,1.9) {Maxwell-Boltzmann envelope};
\end{tikzpicture}
$$

## From dynamics to probability

The mechanics of this lesson is exact and reversible: Hamilton's equations run
equally well backward, and Liouville's theorem holds in both directions of time.
Nothing here selects a preferred state or a direction of change. What it
provides is the stage. Phase-space volume is the invariant measure of the number
of microstates; the energy shell is the finite region an isolated system lives
on; stationarity restricts equilibrium densities to functions of the conserved
quantities. The physics — which stationary density is realized, and why entropy
grows — enters through a probabilistic postulate about accessible microstates,
taken up next.

[^reif-intro]: **Reif**, _Fundamentals of Statistical and Thermal Physics_, Ch. 2 — the statistical description of a many-particle system through its accessible microstates, and the role of phase space as the arena for that description.
[^reif-gamma]: **Reif**, _Fundamentals of Statistical and Thermal Physics_, §2.1–2.2 — specification of the microstate by generalized coordinates and momenta, and the subdivision of phase space into cells.
[^reif-liouville]: **Reif**, _Fundamentals of Statistical and Thermal Physics_, §2.3, and **Kardar**, _Statistical Physics of Particles_, §3.2 — the continuity equation for the ensemble density, the divergence-free Hamiltonian flow, and Liouville's theorem $\d\rho/\d t = 0$.
[^kardar-stationary]: **Kardar**, _Statistical Physics of Particles_, §3.3, and **Pathria & Beale**, _Statistical Mechanics_, §2.2 — the Poisson-bracket form $\partial\rho/\partial t = \{H, \rho\}$ and the conclusion that stationary densities depend on phase-space coordinates only through conserved quantities.
