# How to interpret Liouville's equation?

In various texts, I see Liouville's theorem stated both verbally and as an equation. But it seems to me that these two formulations don't agree.

For example, in Wikipedia:

The distribution function is constant along any trajectory in phase space.

And:

Consider a Hamiltonian dynamical system with canonical coordinates $$q_i$$ and conjugate momenta $$p_i$$, where $$i=1,\dots,n$$. Then the phase space distribution $$\rho(p,q)$$ determines the probability $$\rho(p,q)\; > \mathrm{d}^nq\,\mathrm{d}^n p$$ that the system will be found in the infinitesimal phase space volume $$\mathrm{d} ^nq\,\mathrm{d}^n p$$. The Liouville equation governs the evolution of $$\rho(p,q;t)$$ in time $$t$$:

$$\frac{d\rho}{dt}=\frac{\partial\rho}{\partial t}+\sum_{i=1}^n\left(\frac{\partial\rho}{\partial q_i}\dot{q}_i+\frac{\partial\rho}{\partial p_i}\dot{p}_i\right)=0.$$

I think that the equation is not right, whereas the verbal description is correct.

To see this, first please confirm that you agree with the following statement, because this might be the source of my confusion:

Liouville's theorem applies to any distribution function $$\rho (p,q)$$. No assumptions are made on $$\rho (p,q)$$, as long it is a well behaved function that can represent a distribution. For example, it can be any probability density function (even though I'm not sure it is necessary that it is normalized). In particular, $$\rho (p,q)$$ doesn't need to be a canonical ensemble, micro-canonical ensemble, etc.. It doesn't need to correspond to thermodynamic equilibrium, or to have well-defined macroscopic values such as volume. $$\rho$$ is also allowed to have (explicit) time dependence but we ignore this here for simplicity, so $$\frac{\partial\rho}{\partial t}=0$$.

If you agree with the last paragraph, then it's easy to see that Liouville's equation is wrong:

Let's look at a system with a single point particle with mass $$m$$ in one dimension, without any forces. So, a phase space point is given by two numbers $$(q,p)$$. And, given that at time $$t_0$$ the system is in state $$(q_0,p_0)$$, the state at any other time $$t$$ is given by: $$\left(q_0+\frac{p_0}{m}(t-t_0),p_0\right)$$. Now, let's take $$\rho (p,q)$$ to be a 2d Gaussian distribution: $$\rho (p,q)=Ce^{-(q^2+p^2)}$$, ($$C$$ is a normalization constant).

Let's look at a trajectory with $$q_0=0,p_0=1,t_0=0$$, and let's take $$m=1$$. For this trajectory, we have:

$$\rho(p(t), q(t))=Ce^{-((q_0+p_0 t)^2+p_0^2)}$$

Obviously, the derivative of $$Ce^{-((q_0+p_0 t)^2+p_0^2)}$$ with respect to $$t$$ does not vanish, in contradiction with Liouville's equation.

Perhaps, my mistake is that I simply plug-in the trajectories $$q(t),p(t)$$ into $$\rho(q,p)$$? I understand that this plugging-in does not represent what the theorem is trying to say, because this misses the flow of the distribution itself, i.e., it doesn't take into account the dynamics of the swarm of representative points that make up the distribution. But, taking this into account would require a different notation for the equation, right? What would that notation be? Or is the notation used in the Wikipedia page correct and I'm just not interpreting it properly?

This is the usual notational confusion between a free variable $$q$$ and a path $$q(t)$$: Physics texts often do not clearly distinguish between these two notions and this is what's happening in the equation you quote.

There are (at least) two different ways in which $$\rho$$ can be a function of time: We can think about $$\rho_0(q,p)$$ just as any function in phase space and then $$\rho_\text{tot}(q,p;t)$$ as its time-evolution, and then we write $$\rho_\text{traj}(t) = \rho_\text{tot}(q(t),p(t);t)$$ for a function along a single trajectory $$q(t),p(t)$$. Crucially, the time-dependence in $$\rho_\text{tot}(q,p;t)$$ is not "explicit" time-dependence as you have assumed, it is the time-dependence acquired through the equation of motion from the initial condition $$\rho_0(q,p)$$!

Liouville theorem is the statement that this equation of motion is exactly given by $$\dot{\rho}_\text{traj} = \partial_t\rho_\text{tot} + (\partial_q\rho_\text{tot})\dot{q} + (\partial_p \rho_\text{tot})\dot{p} = 0$$ and by Hamilton's equations of motion ($$\dot{q} = \partial_p H, \dot{p} = -\partial_q H$$) this is just $$\partial_t \rho_\text{tot} = \{H,\rho_\text{tot}\}$$ in terms of the Poisson bracket.

The meaning of $$\dot{\rho}_\text{traj} = 0$$ ("The distribution function is constant along trajectories") is that we want the "external" time-dependence of $$\rho_\text{tot}$$ to be exactly such that the value $$\rho_\text{tot}(q,p;t)$$ assigns to a point $$(q_0,p_0)$$ at time $$t_0$$ is the same as the value it assigns to the point $$q(t),p(t)$$ at time $$t$$, where $$q(t),p(t)$$ is the solution to Hamilton's equations with $$q_0,p_0$$ as initial condition. We're saying that $$\rho_\text{tot}$$ evolves along the Hamiltonian flow.

Whether this is, in fact, the definition of how $$\rho_\text{tot}$$ depends on time or an actual "theorem" depends on how exactly you define the notion of the phase space density.

You have to interpret the $$\frac{d}{dt}$$ in the LHS as a convective derivative along the flow generated by the Hamiltonian. Your Liouville equation is therefore analogous to a transport equation in fluid mechanics.

In your example, I'll write $$\rho_0(p,q)=e^{-(p^2+q^2)}$$ your initial distribution and $$H=\frac{p^2}{2}$$ the Hamiltonian governing the flow (I'll just set $$m=1$$ for clarity). You made a mistake by forgetting to rewind the flow. You should rather define the distribution: $$\rho(p,q,t)=\rho_0(p_0,q_0) \\ p=p_0 \\ q=q_0+p_0t$$ or more explicitly: $$\rho(p,q,t)=e^{-(p^2+(q-pt)^2)}$$ You see that $$\rho$$ depends on time implicitly by the $$p_0,q_0$$ dependence. You can check that $$\rho$$ satisfies the Liouville equation, explicitly: $$\partial_t\rho+p\partial_q\rho=0$$ You thus recover that $$\rho$$ is $$\rho_0$$ transported along by the flow. More abstractly, if $$\phi_t(p,q)$$ is the flow from $$0$$ to $$t$$, you want: $$\rho(\phi_t(p_0,q_0),t)=\rho_0(p_0,q_0)$$ for any initial condition $$p_0,q_0$$. You can check this by the method of characteristics.

Btw, it is often convenient to write it using Poisson brackets: $$\partial_t\rho+\{\rho,H\}=0$$ so in particular, if you want $$\partial_t \rho=0$$, then it must be a function of the integrals of motion. In particular, this is the case when $$\rho$$ is a function of $$H$$, like for the canonical ensemble where $$\rho\propto e^{-\beta H}$$. It also explains why in your example there still is a temporal dependence since $$q^2$$ is not conserved. Had you chosen $$\rho_0= e^{-p^2}$$ or used the harmonic oscillator instead $$H=\frac{p^2+q^2}{2}$$, you would have killed the temporal dependence.

Hope this helps.