The Hamiltonian Function

Classical mechanics owns exactly two master functions. The Lagrangian L(q,q˙,t)L(q,\dot q,t) you have already met: feed it a path, integrate, demand stationarity, and the equations of motion fall out. The second — the Hamiltonian H(q,p,t)H(q,p,t) — carries identical physical information, yet reorganizes it so radically that whole subjects become visible that the Lagrangian keeps hidden: phase-space geometry, Liouville's incompressible flow, canonical transformations, and eventually the operator H^\hat H that runs the Schrödinger equation. When physicists say "write down the Hamiltonian of the system," they are asking for the one function from which everything else — dynamics, conservation laws, statistical weights e−H/kBTe^{-H/k_BT}, quantum spectra — can be cranked out by differentiation. The construction itself you already own: H=∑ipiq˙i−LH=\sum_i p_i\dot q_i-L is precisely the Legendre transform of the previous article, applied in the velocities, with the generalized momenta pi=∂L/∂q˙ip_i=\partial L/\partial\dot q_i as the new variables. What this article adds is the meaning of the object that construction produces. HH lives on phase space, not configuration space; its level sets are the rails that conserved motion rides; its partial derivatives — one per phase-space direction — encode the complete dynamics; and its total time derivative collapses to its explicit time dependence, the cleanest conservation statement in mechanics. We build HH carefully, assemble the zoo of Hamiltonians you will actually use — oscillator, central force, charged particle — and stop exactly where the dynamics begins: the canonical equations themselves, and the flow they generate, are the story of the companion article Hamilton's Canonical Equations.

Key takeaways
  • The Hamiltonian H(q,p,t)H(q,p,t) is the Legendre transform of the Lagrangian with respect to the generalized velocities: H=∑ipiq˙i−LH=\sum_i p_i\dot q_i-L, with LL re-expressed using pi=∂L/∂q˙ip_i=\partial L/\partial\dot q_i.
  • It is a function on phase space — the space of coordinates qq and conjugate momenta pp — rather than on configuration-velocity space, the natural arena of the Lagrangian.
  • Its total time derivative along the motion equals its explicit time dependence, dH/dt=∂H/∂t=−∂L/∂t\mathrm{d}H/\mathrm{d}t=\partial H/\partial t=-\partial L/\partial t, so HH is conserved whenever LL has no explicit time dependence.
  • Differentiating HH generates the dynamics through Hamilton's canonical equations q˙i=∂H/∂pi\dot q_i=\partial H/\partial p_i, p˙i=−∂H/∂qi\dot p_i=-\partial H/\partial q_i — 2n2n first-order ODEs replacing nn second-order ones.
  • Under common conditions (scleronomic constraints, velocity-independent potential) HH equals the total mechanical energy T+VT+V, but conservation and energy-equality are logically distinct properties.
  • Key idea: The Hamiltonian is the Legendre transform of the Lagrangian in the velocities: H(q,p,t)=∑ipiq˙i−LH(q,p,t)=\sum_i p_i\dot q_i-L, evaluated after eliminating q˙\dot q in favour of pi=∂L/∂q˙ip_i=\partial L/\partial\dot q_i. Its first derivatives reproduce all the dynamics.
The core insight

The Hamiltonian is the Legendre transform of the Lagrangian in the velocities: H(q,p,t)=∑ipiq˙i−LH(q,p,t)=\sum_i p_i\dot q_i-L, evaluated after eliminating q˙\dot q in favour of pi=∂L/∂q˙ip_i=\partial L/\partial\dot q_i. Its first derivatives reproduce all the dynamics, q˙i=∂H/∂pi\dot q_i=\partial H/\partial p_i and p˙i=−∂H/∂qi\dot p_i=-\partial H/\partial q_i.

Where this lives today

Every quantum mechanics problem begins "the Hamiltonian of the system is…" — canonical quantization takes the classical H(q,p)H(q,p), promotes the conjugate pair to operators, and the Schrödinger equation iℏ ∂tψ=H^ψi\hbar\,\partial_t\psi=\hat H\psi does the rest. The electromagnetic Hamiltonian derived above becomes, verbatim, the minimal-coupling operator (−iℏ∇−qA)2/2m+qϕ(-i\hbar\nabla-q\mathbf A)^2/2m+q\phi that underlies atomic spectra in fields, Landau levels, and superconductivity. Statistical mechanics is even more direct: the canonical ensemble weights microstates by e−H(q,p)/kBTe^{-H(q,p)/k_BT}, so the partition function — hence all equilibrium thermodynamics — is an integral over the same phase-space landscape whose contours the classical flow rides. Computation completes the circle. Molecular-dynamics codes and solar-system integrators use symplectic algorithms that respect the Hamiltonian structure step by step, keeping energy errors bounded over billions of steps where naive integrators drift. And Hamiltonian Monte Carlo — the workhorse sampler of modern Bayesian statistics — invents a fictitious momentum and flows along level sets of an artificial HH precisely because contour-riding explores probability landscapes faster than any random walk.

The physical picture

Think of the Lagrangian as living on the space of positions and velocities — mathematicians call it the tangent bundle — and the Hamiltonian as living on the space of positions and momenta, the cotangent bundle: phase space. The Legendre transform is the dictionary between the two. Velocities answer "where is the system heading?"; momenta answer "how hard is it heading there?" — the conjugate quantity that conservation laws actually speak about, as the previous article's momentum zoo made concrete. What does the function HH look like on its space? For one degree of freedom you can draw it: a landscape over the (q,p)(q,p) plane. And here is the picture that organizes everything downstream — when HH has no explicit time dependence, the motion runs along the contour lines of that landscape. The phase-space velocity vector (q˙,p˙)(\dot q,\dot p) is the gradient of HH rotated by ninety degrees: steepest-ascent information, redeployed as flow along level sets, never across them. Energy conservation is not an extra fact to prove; it is the geometry of the flow:

Figure
The Hamiltonian as a landscape over phase space — motion follows the contour lines
q p H = E₁ H = E₂ H = E₃ flow (q̇, ṗ) ∇H (uphill) the velocity in phase space is the gradient of H rotated 90°: trajectories ride the level sets, so H = const along every orbit automatically equilibrium: ∇H = 0

The second thing to hold on to is why the combination ∑pq˙−L\sum p\dot q-L rather than anything else. The Legendre transform article proved it: that specific combination is the unique one whose differential contains no dq˙\mathrm{d}\dot q — the velocity genuinely drops out, so HH is a bona fide function of (q,p,t)(q,p,t), and its two families of partial derivatives are exactly enough to steer the full flow. One function, 2n2n slopes, complete dynamics. That economy is what "the Hamiltonian generates time evolution" means — a phrase that survives verbatim into quantum mechanics, where H^\hat H generates the evolution of states through the Schrödinger equation.

Building the function

Assemble the construction in three deliberate moves — each inherited from a previous article, now snapped together. Starting from a Lagrangian L(q,q˙,t)L(q,\dot q,t) with an invertible velocity Hessian, define the conjugate momenta, then trade:

H(q,p,t)=∑i=1npi q˙i−L(q,q˙,t) ∣q˙=q˙(q,p,t),pi=∂L∂q˙i(1)H(q,p,t)=\sum_{i=1}^{n} p_i\,\dot q_i - L(q,\dot q,t)\,\Big|_{\dot q=\dot q(q,p,t)},\qquad p_i=\frac{\partial L}{\partial\dot q_i} \qquad (1)

where: HH — the Hamiltonian, a function on the 2n2n-dimensional phase space plus time; the bar insists every velocity has been eliminated via the inverted momentum map. The three moves: differentiate LL to get the momenta (Generalized Momenta), check the Hessian so the map inverts (Legendre Transformation), then substitute until no q˙\dot q survives. Skip the third and you have nothing: a mixed-variable expression with no phase-space meaning. What makes definition (1) worth the ceremony is its differential. As established in the Legendre article, the dq˙\mathrm{d}\dot q contributions cancel identically, leaving

dH=∑i(q˙i dpi−p˙i dqi)−∂L∂t dt(2)\mathrm{d}H=\sum_i\Big(\dot q_i\,\mathrm{d}p_i-\dot p_i\,\mathrm{d}q_i\Big)-\frac{\partial L}{\partial t}\,\mathrm{d}t \qquad (2)

where: the p˙i\dot p_i entered through the Euler–Lagrange equation p˙i=∂L/∂qi\dot p_i=\partial L/\partial q_i — this is the differential on solutions. Read the coefficients and the entire dynamics appears:

q˙i=∂H∂pi,p˙i=−∂H∂qi,∂H∂t=−∂L∂t(3)\dot q_i=\frac{\partial H}{\partial p_i},\qquad \dot p_i=-\frac{\partial H}{\partial q_i},\qquad \frac{\partial H}{\partial t}=-\frac{\partial L}{\partial t} \qquad (3)

where: the first pair are Hamilton's canonical equations — 2n2n first-order equations replacing the nn second-order Euler–Lagrange equations. Note the antisymmetry: coordinate rates come from momentum-slopes with a plus, momentum rates from coordinate-slopes with a minus. That single sign is the ninety-degree rotation of the hero figure, and the germ of the entire symplectic structure. We use equations (3) here only to certify that HH contains the dynamics; their consequences — flow, phase portraits, Poisson brackets, Liouville — are the dedicated business of Hamilton's Canonical Equations.

Figure
One scalar function, all the dynamics — what each slope of H delivers
H(q,p,t) one scalar on phase space q̇ = ∂H/∂p where the state goes ṗ = −∂H/∂q how momentum drains dH/dt = ∂H/∂t conservation verdict H = E level sets the orbits themselves differentiate once per phase-space direction: 2n slopes of one function steer the entire flow
Derivation AFrom the Lagrangian to the canonical form of the dynamics

The goal is to certify, in one self-contained pass, that the function defined in (1) steers the complete motion: both halves of (3), with their asymmetric signs, from nothing but the definition and the Euler–Lagrange equations. The strategy is the Legendre differential with the dynamics fed in at the single point where physics is needed. Keep the two inputs distinct as you read — one identity is structural (true off-shell, from the transform), one is dynamical (true on solutions only); conflating them is the standard source of sign errors in this derivation.

Step 1. Differentiate the definition H=∑ipiq˙i−LH=\sum_i p_i\dot q_i-L treating all of q,q˙,p,tq,\dot q,p,t as independent for now:

dH=∑i(q˙i dpi+pi dq˙i)−∑i(∂L∂qi dqi+∂L∂q˙i dq˙i)−∂L∂t dt\mathrm{d}H=\sum_i\big(\dot q_i\,\mathrm{d}p_i+p_i\,\mathrm{d}\dot q_i\big)-\sum_i\Big(\frac{\partial L}{\partial q_i}\,\mathrm{d}q_i+\frac{\partial L}{\partial\dot q_i}\,\mathrm{d}\dot q_i\Big)-\frac{\partial L}{\partial t}\,\mathrm{d}t

Step 2. Apply the structural input: the momentum definition pi=∂L/∂q˙ip_i=\partial L/\partial\dot q_i kills both dq˙i\mathrm{d}\dot q_i packets exactly. What survives shows HH depends on (q,p,t)(q,p,t) alone — the transform has done its job before any equation of motion was mentioned. Why this half is called structural: it holds for any curve in phase space, physical or not. It already yields ∂H/∂pi=q˙i\partial H/\partial p_i=\dot q_i: the momentum-slope of H recovers the velocity that momentum replaced.

Step 3. Apply the dynamical input: on actual solutions the Euler–Lagrange equation gives ∂L/∂qi=p˙i\partial L/\partial q_i=\dot p_i (the momentum form derived in Generalized Momenta). Substituting,

dH=∑i(q˙i dpi−p˙i dqi)−∂L∂t dt\mathrm{d}H=\sum_i\big(\dot q_i\,\mathrm{d}p_i-\dot p_i\,\mathrm{d}q_i\big)-\frac{\partial L}{\partial t}\,\mathrm{d}t

Why the minus sign lands on the coordinate side: the Lagrangian's coordinate-slope is a force, and force drains or feeds momentum; the transform hands that role to H with its sign flipped, because L enters the definition of H negatively.

Step 4. Read off the coefficients of the independent differentials dpi\mathrm{d}p_i, dqi\mathrm{d}q_i, dt\mathrm{d}t — equations (3) in full. Two remarks close the loop. First, the count: one scalar function on phase space determines all 2n2n rates; no further input exists or is needed. Second, the boundary of this article: what these equations do — conserve volume, generate flows, organize into brackets — begins in Hamilton's Canonical Equations. Verified: matches Goldstein §8.1 and Landau–Lifshitz §40; for H=p2/2m+V(x)H=p^2/2m+V(x) the pair (3) reads x˙=p/m\dot x=p/m, p˙=−V′(x)\dot p=-V'(x), which recombine to Newton's mx¨=−V′(x)m\ddot x=-V'(x).

The evolution of H itself

Chain-rule HH along a trajectory and feed in (3): the phase-space terms cancel in pairs, leaving the identity that governs conservation:

dHdt=∂H∂t=−∂L∂t(4)\frac{\mathrm{d}H}{\mathrm{d}t}=\frac{\partial H}{\partial t}=-\frac{\partial L}{\partial t} \qquad (4)

where: dH/dt\mathrm{d}H/\mathrm{d}t — the rate of change along the motion; ∂H/∂t\partial H/\partial t — the explicit time dependence at a frozen phase-space point. The theorem: they coincide. So a Hamiltonian with no explicit clock is a constant of the motion, whatever it is made of — and whether that conserved number is the mechanical energy T+VT+V is a logically separate question, answered condition by condition in Hamiltonian as Total Energy. Keep the two properties (conserved; equal to energy) in separate mental boxes: systems exist with either one and not the other.

The zoo: Hamiltonians you will actually use

Fluency in Hamiltonian mechanics is mostly fluency in reading these five off without hesitation. Each follows from definition (1) applied to the corresponding Lagrangian; the middle column is the momentum map to invert.

systemmomentaHamiltonian
particle in a potentialp=mr˙\mathbf p=m\dot{\mathbf r}H=p22m+V(r)H=\dfrac{\mathbf p^2}{2m}+V(\mathbf r)
simple harmonic oscillatorp=mx˙p=m\dot xH=p22m+12mω2x2H=\dfrac{p^2}{2m}+\tfrac12 m\omega^2x^2
planar central forcepr=mr˙p_r=m\dot r, pθ=mr2θ˙p_\theta=mr^2\dot\thetaH=pr22m+pθ22mr2+V(r)H=\dfrac{p_r^2}{2m}+\dfrac{p_\theta^2}{2mr^2}+V(r)
charge in an EM fieldp=mr˙+qA\mathbf p=m\dot{\mathbf r}+q\mathbf AH=(p−qA)22m+qϕH=\dfrac{(\mathbf p-q\mathbf A)^2}{2m}+q\phi
relativistic free particlep=γmv\mathbf p=\gamma m\mathbf vH=p2c2+m2c4H=\sqrt{\mathbf p^2c^2+m^2c^4}

Two of these deserve their construction in full — the oscillator because it is the template for every quadratic problem in physics, and the electromagnetic charge because it is the template for every gauge structure in physics.

Go deeper · Derivation B · 1 minThe Hamiltonian of the simple harmonic oscillator, and its phase ellipse
Derivation BThe Hamiltonian of the simple harmonic oscillator, and its phase ellipse

We are constructing HH for the mass-spring system from scratch and extracting the geometry of its level sets — the ellipses that make the oscillator the standard portrait of phase space. The strategy is definition (1) executed literally, then a reading of H=EH=E as a conic. Nothing here is hard; the value is seeing the machine run once end to end on the system every other field of physics borrows.

Step 1. Lagrangian and momentum: L=12mx˙2−12mω2x2L=\tfrac12 m\dot x^2-\tfrac12 m\omega^2 x^2, so p=∂L/∂x˙=mx˙p=\partial L/\partial\dot x=m\dot x and the Hessian is m>0m>0 — invertible, x˙=p/m\dot x=p/m.

Step 2. Transform: H=px˙−L=p2m−p22m+12mω2x2H=p\dot x-L=\dfrac{p^2}{m}-\dfrac{p^2}{2m}+\dfrac12 m\omega^2x^2, giving

H(x,p)=p22m+12mω2x2H(x,p)=\frac{p^2}{2m}+\tfrac12 m\omega^2 x^2

Why this is also T plus V: the Lagrangian is quadratic-kinetic with a velocity-independent potential — exactly the conditions under which the transform returns the energy, per the companion energy article.

Step 3. Read the level sets. H=EH=E is x22E/mω2+p22mE=1\dfrac{x^2}{2E/m\omega^2}+\dfrac{p^2}{2mE}=1: an ellipse with semi-axes xmax⁡=2E/mω2x_{\max}=\sqrt{2E/m\omega^2} and pmax⁡=2mEp_{\max}=\sqrt{2mE}. No explicit tt appears, so by (4) each trajectory is confined to its ellipse forever — the contour-riding of the hero figure, now exact.

Step 4. Extract one more number for later chapters: the area enclosed is πxmax⁡pmax⁡=2πE/ω\pi x_{\max}p_{\max}=2\pi E/\omega — energy over frequency, the action variable of the action-angle formalism, and (times ℏ−1\hbar^{-1}) the semiclassical count of quantum states. The oscillator's phase ellipse is the seed of all of it. Verified: equations (3) give x˙=p/m\dot x=p/m, p˙=−mω2x\dot p=-m\omega^2x, hence x¨=−ω2x\ddot x=-\omega^2x — the correct oscillator dynamics; semi-axes and area recomputed in Worked Example 1; matches Goldstein §8.2.

Go deeper · Derivation C · 1 minThe Hamiltonian of a charged particle in an electromagnetic field
Derivation CThe Hamiltonian of a charged particle in an electromagnetic field

The goal is the Hamiltonian behind minimal coupling — the (p−qA)2(\mathbf p-q\mathbf A)^2 structure that classical mechanics bequeaths to the Schrödinger equation and to all of quantum field theory. The strategy: start from the velocity-dependent Lagrangian (built in Velocity-Dependent Potentials), use the canonical momentum computed in Generalized Momenta, and transform. Watch what the potentials do: A\mathbf A never adds energy — it shifts the momentum inside the square — while ϕ\phi adds energy directly. Confusing those two roles produces Hamiltonians that are dimensionally fine and physically wrong.

Step 1. Inputs: L=12mr˙2+q r˙⋅A−qϕL=\tfrac12 m\dot{\mathbf r}^2+q\,\dot{\mathbf r}\cdot\mathbf A-q\phi, with canonical momentum p=mr˙+qA\mathbf p=m\dot{\mathbf r}+q\mathbf A. Invert the (trivially invertible) map: r˙=(p−qA)/m\dot{\mathbf r}=(\mathbf p-q\mathbf A)/m.

Step 2. Assemble H=p⋅r˙−LH=\mathbf p\cdot\dot{\mathbf r}-L and substitute:

H=p⋅p−qAm−(p−qA)22m−q (p−qA)m⋅A+qϕH=\mathbf p\cdot\frac{\mathbf p-q\mathbf A}{m}-\frac{(\mathbf p-q\mathbf A)^2}{2m}-q\,\frac{(\mathbf p-q\mathbf A)}{m}\cdot\mathbf A+q\phi

Step 3. Collect: the first and third terms combine to (p−qA)2/m(\mathbf p-q\mathbf A)^2/m, and subtracting the half leaves

H(r,p,t)=(p−qA)22m+qϕH(\mathbf r,\mathbf p,t)=\frac{(\mathbf p-q\mathbf A)^2}{2m}+q\phi

Why the vector potential sits inside the square: (p−qA)(\mathbf p-q\mathbf A) is just mr˙m\dot{\mathbf r} — the kinetic momentum. The Hamiltonian is the plain kinetic energy plus electric potential energy; the magnetic field, which does no work, contributes no energy term and instead deforms the geometry of phase space through the momentum shift.

Step 4. Sanity-read the value: H=12mr˙2+qϕH=\tfrac12 m\dot{\mathbf r}^2+q\phi on solutions — numerically the energy, even though the function of (r,p)(\mathbf r,\mathbf p) looks nothing like a textbook T+VT+V. With static potentials nothing depends explicitly on tt, so this energy is conserved: the magnetic force, forever perpendicular to the velocity, never changes the speed. Verified: expanding equations (3) for this H reproduces the Lorentz force mr¨=q(E+r˙×B)m\ddot{\mathbf r}=q(\mathbf E+\dot{\mathbf r}\times\mathbf B) (Goldstein §8.1); setting A→0, ϕ→0\mathbf A\to0,\ \phi\to0 recovers the free Hamiltonian; the operator version (−iℏ∇−qA)2/2m+qϕ(-i\hbar\nabla-q\mathbf A)^2/2m+q\phi is the magnetic Schrödinger Hamiltonian.

Limiting cases

CaseResultMeaning
quadratic TT, velocity-independent VV, scleronomicH=T+VH=T+Vthe familiar energy reading — special case, not definition
∂L/∂t=0\partial L/\partial t=0dH/dt=0\mathrm{d}H/\mathrm{d}t=0conserved HH, whatever its relation to energy
A→0, ϕ→0\mathbf A\to0,\ \phi\to0H→p2/2mH\to \mathbf p^2/2melectromagnetic structure switches off smoothly
c→∞c\to\infty limit of p2c2+m2c4\sqrt{p^2c^2+m^2c^4}mc2+p2/2m+…mc^2+p^2/2m+\dotsrelativistic H contains the Newtonian one plus rest energy
one degree of freedom, conserved HHorbits = level curves of HHthe phase portrait is a contour map
degenerate Hessiantransform failsno HH by this route; constrained (Dirac) formalism

Worked examples

1 · Oscillator: from initial data to the phase ellipse (confidence builder)

A block of mass m=0.25 kgm=0.25\ \mathrm{kg} on a spring with k=100 N/mk=100\ \mathrm{N/m} is released at x0=0.050 mx_0=0.050\ \mathrm{m} with velocity x˙0=1.0 m/s\dot x_0=1.0\ \mathrm{m/s}. Find HH, and the semi-axes and area of its phase-space orbit.

Step 1. Parameters: ω=k/m=400=20 rad/s\omega=\sqrt{k/m}=\sqrt{400}=20\ \mathrm{rad/s}. Initial momentum: p0=mx˙0=0.25×1.0=0.25 kg m/sp_0=m\dot x_0=0.25\times1.0=0.25\ \mathrm{kg\,m/s}.

Step 2. Evaluate the Hamiltonian at the initial point: H=p022m+12kx02=0.06250.50+12×100×0.0025=0.125+0.125=0.25 JH=\dfrac{p_0^2}{2m}+\tfrac12 kx_0^2=\dfrac{0.0625}{0.50}+\tfrac12\times100\times0.0025=0.125+0.125=\boxed{0.25\ \mathrm{J}}. No explicit time dependence, so this number is locked in for the whole motion.

Step 3. Semi-axes of the level ellipse H=0.25 JH=0.25\ \mathrm{J}: xmax⁡=2E/k=0.005=0.071 mx_{\max}=\sqrt{2E/k}=\sqrt{0.005}=0.071\ \mathrm{m} and pmax⁡=2mE=0.125=0.354 kg m/sp_{\max}=\sqrt{2mE}=\sqrt{0.125}=0.354\ \mathrm{kg\,m/s}. Check the consistency: the block reaches xmax⁡x_{\max} exactly when p=0p=0 — all 0.25 J0.25\ \mathrm{J} potential — and crosses x=0x=0 with ∣p∣=pmax⁡|p|=p_{\max} — all kinetic.

Step 4. Enclosed area: πxmax⁡pmax⁡=π×0.071×0.354=0.079 J s\pi x_{\max}p_{\max}=\pi\times0.071\times0.354=0.079\ \mathrm{J\,s}. Cross-check against the formula from the derivation: 2πE/ω=2π×0.25/20=0.0785 J s2\pi E/\omega=2\pi\times0.25/20=0.0785\ \mathrm{J\,s} ✓. That area — an action — is the quantity adiabatic invariance preserves and quantum mechanics ultimately chops into units of 2πℏ2\pi\hbar.

2 · Satellite: a two-momentum Hamiltonian evaluated on orbit (exam level)

A 500 kg500\ \mathrm{kg} satellite circles Earth (GM=3.986×1014 m3/s2GM=3.986\times10^{14}\ \mathrm{m^3/s^2}) at r=7.0×106 mr=7.0\times10^{6}\ \mathrm{m}. Using the central-force Hamiltonian H=pr22m+pθ22mr2−GMmrH=\dfrac{p_r^2}{2m}+\dfrac{p_\theta^2}{2mr^2}-\dfrac{GMm}{r}, evaluate both momenta and HH, and interpret the sign.

Step 1. Circular-orbit speed from gravity as centripetal force: v=GM/r=3.986×1014/7.0×106=5.694×107=7.55×103 m/sv=\sqrt{GM/r}=\sqrt{3.986\times10^{14}/7.0\times10^{6}}=\sqrt{5.694\times10^{7}}=7.55\times10^{3}\ \mathrm{m/s}.

Step 2. The momenta. Radial: circular orbit means r˙=0\dot r=0, so pr=mr˙=0p_r=m\dot r=0. Angular: pθ=mr2θ˙=mvr=500×7.55×103×7.0×106=2.64×1013 kg m2/sp_\theta=mr^2\dot\theta=mvr=500\times7.55\times10^{3}\times7.0\times10^{6}=2.64\times10^{13}\ \mathrm{kg\,m^2/s} — conserved, since θ\theta is cyclic in HH.

Step 3. Kinetic piece from the momenta: pθ22mr2=(2.64×1013)22×500×(7.0×106)2=6.97×10264.90×1016=1.42×1010 J\dfrac{p_\theta^2}{2mr^2}=\dfrac{(2.64\times10^{13})^2}{2\times500\times(7.0\times10^{6})^2}=\dfrac{6.97\times10^{26}}{4.90\times10^{16}}=1.42\times10^{10}\ \mathrm{J} — which is indeed 12mv2=12×500×(7.55×103)2=1.42×1010 J\tfrac12 mv^2=\tfrac12\times500\times(7.55\times10^3)^2=1.42\times10^{10}\ \mathrm{J} ✓.

Step 4. Potential piece: −GMm/r=−3.986×1014×500/7.0×106=−2.85×1010 J-GMm/r=-3.986\times10^{14}\times500/7.0\times10^{6}=-2.85\times10^{10}\ \mathrm{J}. Total: H=1.42×1010−2.85×1010=−1.42×1010 JH=1.42\times10^{10}-2.85\times10^{10}=\boxed{-1.42\times10^{10}\ \mathrm{J}}. The value is negative — the signature of a bound orbit — and equals exactly −T-T, the virial theorem's fingerprint for inverse-square forces. One function, evaluated once, has told us the orbit is bound, how tightly, and which momentum is banked as a constant: that is the Hamiltonian working as an instrument rather than a formality.

Origins · 1 minWilliam Rowan Hamilton and how this was discovered
WR
William Rowan Hamilton
1805–1865 · Trinity College Dublin & Dunsink Observatory

Hamilton was appointed Andrews Professor of Astronomy and Royal Astronomer of Ireland at twenty-two, while still an undergraduate. His optics — a single "characteristic function" from which every ray property follows by differentiation — was reengineered in 1834–35 into dynamics: one function HH on phase space steering all motion through paired first-order equations. Jacobi sharpened the machinery within a decade, but the audacious idea — replace forces with the geometry of a generating function — is Hamilton's. He spent his later years on quaternions, carving i2=j2=k2=ijk=−1i^2=j^2=k^2=ijk=-1 into Broom Bridge in 1843; posterity kept both gifts, using his quaternions to spin spacecraft and his Hamiltonian, promoted to an operator, to run the entire quantum theory. He reportedly considered the optical–mechanical analogy his finest work — a judgment quantum mechanics vindicated a century on.

History
1788
— Lagrange's Mécanique analytique completes the velocity-based formulation the Hamiltonian will transform
1827
— Hamilton's Theory of Systems of Rays introduces the characteristic function in optics
1834
— On a General Method in Dynamics: the function H and the canonical equations appear
1838
— Liouville proves the phase-volume conservation theorem the Hamiltonian flow obeys
1843
— Jacobi's lectures systematize Hamiltonian mechanics and its transformation theory
1926
— Schrödinger promotes H to an operator: the Hamiltonian becomes the engine of quantum time evolution

Going further

References. Goldstein, Poole & Safko, Classical Mechanics, 3rd ed., Ch. 8 · Landau & Lifshitz, Mechanics, 3rd ed., §40 · Morin, Introduction to Classical Mechanics, Ch. 15 · Taylor, Classical Mechanics, Ch. 13 · Arnold, Mathematical Methods of Classical Mechanics, Ch. 3

Provenance. Definitions and derivations follow Goldstein §8.1–8.2, Landau & Lifshitz §40, Morin Ch. 15, and Taylor Ch. 13. A verifier should: (1) reconfirm the Legendre cancellation in the differential of HH; (2) recompute H=T2−T0+VH=T_2-T_0+V via Euler's theorem on homogeneous functions; (3) check the SHO Hamiltonian yields x¨=−ω2x\ddot x=-\omega^2 x and elliptical orbits; (4) verify the EM Hamiltonian H=(p−qA)2/2m+qϕH=(\mathbf p-q\mathbf A)^2/2m+q\phi equals the kinetic energy 12mv2+qϕ\tfrac12 mv^2+q\phi. Numerical statements (period 2π/ω2\pi/\omega, E=12mω2A2E=\tfrac12 m\omega^2A^2) are standard textbook results. Worked-example numbers on this page (oscillator H=0.25 JH=0.25\ \mathrm{J}, ellipse 0.071 m×0.354 kg m/s0.071\ \mathrm{m}\times0.354\ \mathrm{kg\,m/s}, area 0.079 J s0.079\ \mathrm{J\,s}; satellite v=7.55 km/sv=7.55\ \mathrm{km/s}, pθ=2.64×1013 kg m2/sp_\theta=2.64\times10^{13}\ \mathrm{kg\,m^2/s}, H=−1.42×1010 JH=-1.42\times10^{10}\ \mathrm{J}) are illustrative arithmetic recomputed from the boxed formulas.

Builds on: Legendre Transformation · Generalized Momenta Leads to: Hamilton's Canonical Equations · Hamiltonian as Total Energy · Phase Space · Equivalence of Lagrangian and Hamiltonian Formulations

If H and L contain the same information, why maintain both?

Because each exposes structure the other buries. The Lagrangian is built for covariance and symmetry arguments: it is a scalar under coordinate changes, makes Noether's theorem one line, and generalizes frictionlessly to field theory. The Hamiltonian is built for state-space structure: first-order flow, conserved phase volume, canonical transformations, action-angle variables, perturbation theory, and the direct bridges to statistical mechanics (through e−H/kBTe^{-H/k_BT}) and quantum mechanics (through H^\hat H). Working physicists translate constantly — derive LL from symmetry, transform to HH to compute or quantize. The dictionary being an involution (see Legendre Transformation) is what makes the double bookkeeping safe.

Why must H never be written as a function of velocities?

Because every downstream operation differentiates HH with respect to its declared variables. The canonical equations read slopes of HH at fixed qq or fixed pp; if a velocity hides inside, those partial derivatives silently pick up wrong contributions and the generated dynamics is wrong — not approximately, but structurally. The differential identity (2) that guarantees dH\mathrm{d}H has no dq˙\mathrm{d}\dot q component is earned by completing the elimination; an uneliminated HH has not paid for it. A practical audit: scan your final HH; if any symbol carries an overdot, the Legendre transform is unfinished.

Is the Hamiltonian unique for a given system?

No — and the freedom is useful. Upstream, the Lagrangian itself is defined only up to a total time derivative dF(q,t)/dt\mathrm{d}F(q,t)/\mathrm{d}t; different gauge choices for FF (or for A\mathbf A in electromagnetism) yield different canonical momenta and different-looking Hamiltonians for identical physics. Downstream, canonical transformations reshuffle (q,p)(q,p) wholesale, often to make HH trivial — that is the entire strategy of action-angle variables and Hamilton–Jacobi theory. What is invariant is not the formula for HH but the flow it generates and the values of gauge-invariant observables along it.

What does it mean, precisely, that H generates time translation?

Compare with an easier statement: momentum generates space translation, in the sense that pp's conjugate role produces shifts of qq. The canonical equations say the same about HH and time: the instantaneous change of any phase-space function ff along the motion is assembled entirely from HH's slopes — in bracket notation (developed in the canonical-equations article), df/dt={f,H}\mathrm{d}f/\mathrm{d}t=\{f,H\}. Evolving by dt\mathrm{d}t is applying an infinitesimal transformation whose generator is HH, exactly as rotating by dθ\mathrm{d}\theta applies one generated by angular momentum. Quantum mechanics preserves the statement word for word, swapping brackets for commutators: U^(t)=e−iH^t/ℏ\hat U(t)=e^{-i\hat Ht/\hbar}.

Can a dissipative system have a Hamiltonian?

Not a standard one on the physical variables. Friction breaks the two pillars simultaneously: energy drains (HH along trajectories would decrease) and phase-space volume contracts (trajectories spiral onto attractors), while any Hamiltonian flow conserves both its HH-level structure and volume. Workarounds exist and are instructive — time-dependent Hamiltonians like H=e−γtp2/2m+eγt12kx2H=e^{-\gamma t}p^2/2m+e^{\gamma t}\tfrac12 kx^2 (Caldirola–Kanai) reproduce damped-oscillator trajectories at the cost of an explicitly time-dependent, non-energy HH; embedding the system in a larger Hamiltonian bath (system plus environment) is the honest route and the starting point of open-quantum-systems theory. For genuinely dissipative classical modelling, the Lagrangian side offers the Rayleigh dissipation function instead.

What is the relation between H and the energy function h(q, q̇, t) from the Lagrangian chapter?

They are the same physical quantity wearing different variables. The energy function (Jacobi integral) h=∑iq˙i ∂L/∂q˙i−Lh=\sum_i\dot q_i\,\partial L/\partial\dot q_i-L lives on the Lagrangian side, as a function of (q,q˙,t)(q,\dot q,t); the Hamiltonian is hh pushed through the momentum dictionary to (q,p,t)(q,p,t). Values agree at corresponding points; conservation statements agree (dh/dt=−∂L/∂t\mathrm{d}h/\mathrm{d}t=-\partial L/\partial t mirrors equation (4)). What differs is power: only in the (q,p)(q,p) variables do the derivatives of the function generate the motion. The full Lagrangian-side story is The Energy Function and Jacobi Integral; the question of when either equals T+VT+V is Hamiltonian as Total Energy.

Why do the two canonical equations carry opposite signs?

The asymmetry is the geometry of the hero figure. If both equations carried plus signs the flow would be ∇H\nabla H itself — trajectories would climb the landscape, HH would grow monotonically, and nothing would be conserved. The minus sign rotates the gradient by ninety degrees instead: (q˙,p˙)=(∂pH,−∂qH)(\dot q,\dot p)=(\partial_pH,-\partial_qH) is perpendicular to (∂qH,∂pH)(\partial_qH,\partial_pH), so the flow hugs contours and HH is constant automatically. That rotation matrix (01−10)\begin{pmatrix}0&1\\-1&0\end{pmatrix} is the symplectic form in embryo; its consequences — area preservation, Liouville's theorem, the bracket algebra — are the substance of the canonical-equations article.

Does every Lagrangian system possess a Hamiltonian?

Every one whose velocity Hessian is invertible — which covers all standard mechanical systems, since positive-definite kinetic energy guarantees it. The exceptions are the degenerate Lagrangians flagged in the Legendre article: gauge theories, where some momenta come out as fixed functions of the coordinates (constraints) and velocities cannot be fully eliminated. There the naive transform stalls and the Dirac–Bergmann constrained-Hamiltonian formalism takes over, producing a Hamiltonian on the constraint surface plus generators of gauge transformations. So the honest statement: every regular Lagrangian has a unique Hamiltonian by (1); singular ones have a richer, still-Hamiltonian structure that costs more machinery.

Before this

Where this leads