---
title: "The Hamiltonian, Phase Space and the Canonical Equations"
description: "Trading velocities for momenta turns one second-order equation per coordinate into two first-order ones, and makes phase space the natural arena. The Hamiltonian equals the conserved energy whenever i"
canonical: https://lightmysky.com/learn/science/the-hamiltonian-phase-space-and-the-canonical-equations-mt_9bMDXQiq_n
source: https://lightmysky.com/learn/science/the-hamiltonian-phase-space-and-the-canonical-equations-mt_9bMDXQiq_n.md
retrieved: 2026-09-12
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# The Hamiltonian, Phase Space and the Canonical Equations

Trading velocities for momenta turns one second-order equation per coordinate into two first-order ones, and makes phase space the natural arena. The Hamiltonian equals the conserved energy whenever it carries no explicit time dependence.

Subject: Science · Area: Forces & Motion · Ages 22 to 23
Page: https://lightmysky.com/learn/science/the-hamiltonian-phase-space-and-the-canonical-equations-mt_9bMDXQiq_n

## Ready when they can

- Constructs a Hamiltonian from a Lagrangian and identifies the conjugate momenta
- Writes and solves the canonical equations for a simple system
- Sketches a phase-space trajectory and reads the motion off it

## Lesson: Trading velocity for momentum

You start from a Lagrangian L that depends on position x and velocity v. You define the conjugate momentum as p equals dL/dv, the partial derivative of L with respect to v. That one trade turns a single second order equation into two first order ones. The two rules that carry you forward are x prime equals dH/dp and p prime equals minus dH/dx.

**Example.** Take a cart on a spring, where m times x double prime equals minus k times x. Its Lagrangian is one half m v squared minus one half k x squared, so the momentum is p equals m v. The replacement pair is x prime equals p over m and p prime equals minus k times x. You step x and p forward together, side by side.

You draw the motion in phase space, with x on the horizontal axis and p on the vertical axis. For the spring cart the Hamiltonian is p squared over 2m plus one half k x squared, and it holds one fixed value E. That fixed value pins the path to an ellipse, and a bigger loop means a larger energy. Where p is positive, x is growing, so the state point drifts rightward across the upper half.

**Tip.** Recall that p equals dL/dv, so for the spring Lagrangian you get p equals m v. Whenever H carries no explicit time dependence, its value stays constant along the motion, so H is the conserved energy. Build p first, then form H from x and p, and check that no stray t sits inside H. If H itself depends on t, the energy is free to drift.

**Recap.** Trade velocity for momentum, step two first order equations, and read the energy off the phase loop.

## Practice

14 questions on this page, each with its working shown.

## Needs first

- [Hamilton's Principle and the Action](https://lightmysky.com/learn/science/hamiltons-principle-and-the-action-mt_a273REeeGu)
- [Phase Portraits, Equilibria and Stability](https://lightmysky.com/learn/mathematics/phase-portraits-equilibria-and-stability-mt_ULuZk4lmGr)

## Opens up

- [Poisson Brackets and Constants of the Motion](https://lightmysky.com/learn/science/poisson-brackets-and-constants-of-the-motion-mt_UFzJyZRdOI)
