**1.2. Lagrangian and Hamiltonian formulations**

The equations of Newtonian cosmology may be derived from Lagrangian and Hamiltonian formulations. The latter is particularly useful for treatments of phase space.

In the Lagrangian approach, one considers the trajectories
** x**()
and the action

(1.8) |

where
= ** v** is
the peculiar velocity. We will show that
eq. (1.8) is the correct Lagrangian by showing that it
leads to the correct equations of motion.

Equations of motion for the trajectories follow from Hamilton's principle:
the action must be stationary under small variations of the trajectories
with fixed endpoints. Thus, we write
** x**()

where we have integrated by parts assuming
(*L* /
) ^{.}
** x** = 0 at
=

(1.9) |

The reader may verify that substituting *L* from eq. (1.8)
yields the correct equation of motion (1.7).

It is straightforward to extend this derivation to a system of self-gravitating particles filling the universe. The Lagrangian is

(1.10) |

where the total gravitational energy excludes the part arising from the mean density:

(1.11) |

where the factor 1/2 is introduced to avoid double-counting pairs of particles. For a continuous mass distribution we obtain

(1.12) |

In the Hamiltonian approach one considers the trajectories in the
single-particle (6-dimensional) phase space,
{** x**(),

The derivation of Hamilton's equations has several steps.
First we need the canonical momentum conjugate to ** x**:

(1.13) |

Note that ** p** is

The next step is to eliminate *d*** x** /

(1.14) |

Notice that we transform *L* to *H* and
to ** p** (the
latter through eq. 1.13). Why do we perform these
transformations? The answer is that now Hamilton's principle gives
the desired equations of motion for the phase-space trajectory
{

(1.15) |

provided that *p*^{.}
** x** = 0 at
the endpoints of .

In our case, *H* = *p*^{2} / (2*am*) +
*am*
(getting the *a*'s right requires
using the Legendre transformation), yielding

(1.16) |

These equations could be combined to yield eq. (1.7), but in the Hamiltonian approach we prefer to think of two coupled evolution equations. This is particularly useful when studying the evolution of a system in phase space, as we shall do in section 3 with hot dark matter.