Hamiltonian Density and Canonical Field Momentum

When we pass from a discrete chain of masses to a continuous field, the Lagrangian becomes a spatial integral of a Lagrangian density L(ϕ,ϕ˙,ϕ′)\mathcal{L}(\phi,\dot\phi,\phi'). To build a Hamiltonian description we must replace each discrete generalized momentum pi=∂L/∂q˙ip_i=\partial L/\partial\dot q_i by a continuum object. The natural candidate is the momentum density π(x,t)=∂L/∂ϕ˙\pi(x,t)=\partial\mathcal{L}/\partial\dot\phi, conjugate to the field at each point of space. The Hamiltonian density follows from the same Legendre transform that defines the discrete Hamiltonian: H=πϕ˙−L\mathcal{H}=\pi\dot\phi-\mathcal{L}. Physically H\mathcal{H} is the local energy density of the field. Integrated over all space it gives the total energy H=∫H d3xH=\int\mathcal{H}\,\mathrm{d}^3x, conserved whenever L\mathcal{L} carries no explicit time dependence — the continuum echo of energy conservation in particle mechanics. For the vibrating string H=12μϕ˙2+12Tϕ′2\mathcal{H}=\tfrac12\mu\dot\phi^2+\tfrac12 T\phi'^2 is exactly the kinetic-plus-potential energy per unit length we would have written by elementary means, confirming that the formalism reproduces familiar physics while extending to arbitrary fields. The deeper structure is that energy density is one slot of the energy–momentum tensor TμνT^\mu{}_\nu, generated by Noether's theorem applied to spacetime translations. Time translation gives energy, with density H=T00\mathcal{H}=T^0{}_0; space translations give field momentum, with density T0i=−π ∂iϕT^0{}_i=-\pi\,\partial_i\phi. Their conservation laws ∂μTμν=0\partial_\mu T^\mu{}_\nu=0 package energy and momentum balance into a single covariant statement. Subtleties separate field theory from particle mechanics: the Legendre transform fails when L\mathcal{L} is independent of some ϕ˙\dot\phi (gauge systems), and the canonical TμνT^\mu{}_\nu need not be symmetric, motivating the Belinfante improvement and Dirac's constrained-Hamiltonian methods studied in field theory proper.

Key takeaways
  • For a field ϕ(x,t)\phi(x,t) with Lagrangian density L\mathcal{L}, the canonical momentum density conjugate to the field is π=∂L/∂ϕ˙\pi = \partial\mathcal{L}/\partial\dot\phi, the continuum analogue of pi=∂L/∂q˙ip_i=\partial L/\partial\dot q_i.
  • The Hamiltonian density is the Legendre transform H=πϕ˙−L\mathcal{H}=\pi\dot\phi-\mathcal{L}, and the total field energy is H=∫H dxH=\int\mathcal{H}\,\mathrm{d}x (or d3x\mathrm{d}^3x).
  • For the wave/elastic string, H=12μϕ˙2+12Tϕ′2\mathcal{H}=\tfrac12\mu\dot\phi^2+\tfrac12 T\phi'^2 — manifest kinetic + potential energy density, conserved when L\mathcal{L} has no explicit time dependence.
  • Energy and momentum unify in the energy–momentum (stress–energy) tensor TμνT^{\mu}{}_{\nu}, whose T00T^0{}_0 component is H\mathcal{H} and whose conservation ∂μTμν=0\partial_\mu T^\mu{}_\nu=0 follows from spacetime translation symmetry (Noether).
  • Hamilton's field equations ϕ˙=δH/δπ\dot\phi=\delta H/\delta\pi, π˙=−δH/δϕ\dot\pi=-\delta H/\delta\phi reproduce the wave equation, and the equal-time bracket {ϕ(x),π(y)}=δ3(x−y)\{\phi(x),\pi(y)\}=\delta^3(x-y) is the seed of canonical field quantization.
  • The Legendre transform is delicate for fields: π\pi may not invertibly determine ϕ˙\dot\phi (gauge fields), and H\mathcal{H} is the time–time component of a tensor, not a Lorentz scalar.
  • Key idea: Replace the discrete conjugate momentum pi=∂L/∂q˙ip_i=\partial L/\partial\dot q_i by the momentum density π=∂L/∂ϕ˙\pi=\partial\mathcal{L}/\partial\dot\phi, then Legendre transform: H=πϕ˙−L\mathcal{H}=\pi\dot\phi-\mathcal{L} is the local energy density, and TμνT^\mu{}_\nu unifies it with field momentum.

Where this lives today

The canonical pair (ϕ,π)(\phi,\pi) is having a hardware moment: Hamiltonian simulation of quantum field theories is one of the flagship applications of 2026-era quantum processors. To put a field on qubits you must first put it in Hamiltonian form — truncate space to a lattice of sites each carrying (ϕi,πi)(\phi_i,\pi_i), exactly the discrete limit in the table above, then encode the local Hilbert spaces and evolve under H^=∑iHi\hat H=\sum_i\mathcal{H}_i. Lattice-gauge-theory groups now benchmark small-scale scattering and string-breaking dynamics this way, and "Hamiltonian truncation" has become a standard classical tool for strongly coupled field theories where path-integral Monte Carlo struggles. The same structure underpins numerical relativity: the ADM formulation that gravitational-wave pipelines integrate is general relativity rewritten as Hamilton's equations for the spatial metric and its conjugate momentum density. And the stress–energy tensor assembled here is literally the right-hand side of Einstein's equations — the object that tells spacetime how to curve is the one this article taught you to build from L\mathcal{L}. The quantum payoff of the bracket {ϕ,π}=δ3(x−y)\{\phi,\pi\}=\delta^3(x-y) is the subject of the action-principle-to-QFT capstone.

The physical picture

Think of space as a dense grid of tiny oscillators. Each cell of width dx\mathrm{d}x carries a discrete coordinate ϕ(x)\phi(x) and a discrete momentum p≈μ ϕ˙ dxp\approx\mu\,\dot\phi\,\mathrm{d}x. Dividing by the cell size gives a density π=p/dx=μϕ˙\pi=p/\mathrm{d}x=\mu\dot\phi that survives the continuum limit — that is exactly ∂L/∂ϕ˙\partial\mathcal{L}/\partial\dot\phi. Phase space, which for the loaded string was a finite-dimensional (qi,pi)(q_i,p_i) arena, becomes an infinite-dimensional space of pairs of functions (ϕ(x),π(x))(\phi(x),\pi(x)): one canonical pair per point of space.

Figure
Every point of space carries its own canonical pair — the field value and its conjugate momentum density — and the Hamiltonian density reads the local energy off each cell
φ(x) π(x) = μ ∂φ/∂t π(x) π(x) 𝓗(x) = π²/2μ + T φ′²/2 — the local energy ledger, cell by cell one canonical pair (φ, π) per point: phase space becomes a space of functions

The Hamiltonian density is bookkeeping for energy per unit volume. Where ϕ˙\dot\phi is large the field has kinetic energy; where ϕ′\phi' is steep it has elastic potential energy. H\mathcal{H} adds them locally, and the field equations shuffle energy between neighbouring points without creating or destroying it — that shuffling is the energy flux. In a standing wave the shuffle is global and rhythmic: twice per period the entire energy budget migrates between the kinetic ledger and the potential ledger.

Figure
Energy sloshing in a standing wave — at maximum displacement all energy is stored as stretch, a quarter period later the string is flat and all energy is motion
t = 0 : maximum displacement all energy potential: ∫ T φ′²/2 dx string momentarily at rest, fully stretched t = T/4 : passing through flat all energy kinetic: ∫ π²/2μ dx string flat, moving at peak speed the two ledgers trade the SAME total twice per period — H = ∫𝓗 dx stays exactly constant

Energy and momentum are not separate ledgers but two faces of one tensor. Just as a particle's (E,p)(E,\mathbf p) form a four-vector, a field's energy density and momentum density form the time row of TμνT^\mu{}_\nu. A Lorentz boost mixes them: what looks like pure energy density in one frame carries momentum density in another.

The core equations

The gateway object is the continuum version of p=∂L/∂q˙p=\partial L/\partial\dot q. Its pedigree is honest: on the discrete chain with spacing aa, only the on-site term of L=∑ja LjL=\sum_j a\,\mathcal{L}_j contains q˙i\dot q_i (gradients couple neighbours through qq, not q˙\dot q), so pi=a ∂Li/∂q˙ip_i=a\,\partial\mathcal{L}_i/\partial\dot q_i, and momentum per unit length pi/ap_i/a stays finite as a→0a\to0.

π(x,t)=∂L∂ϕ˙(1)\pi(x,t)=\frac{\partial\mathcal{L}}{\partial\dot\phi} \qquad (1)

where: π\pi — canonical momentum density conjugate to ϕ\phi (momentum per unit length in 1D, per volume in 3D); L\mathcal{L} — Lagrangian density L(ϕ,ϕ˙,∇ϕ)\mathcal{L}(\phi,\dot\phi,\nabla\phi); ϕ˙\dot\phi — time derivative of the field at fixed xx. For the transverse string, π=μϕ˙\pi=\mu\dot\phi points ALONG the displacement (transverse), not along the propagation direction — see the FAQ for how it relates to the wave's momentum. With the momentum in hand, the passage to the Hamiltonian description is the same Legendre transform as at finite degrees of freedom — the legendre-transformation article's construction with densities in place of functions. Crucially, the transform trades ϕ˙\dot\phi for π\pi and NOTHING else.

H=πϕ˙−L(2)\mathcal{H}=\pi\dot\phi-\mathcal{L} \qquad (2)

where: H\mathcal{H} — Hamiltonian (energy) density of the field; πϕ˙\pi\dot\phi — the transform pairing. There is deliberately no ϕ′(…)\phi'(\ldots) term: the gradient is a configuration variable, not a velocity, and it rides through the transform untouched, reappearing as potential energy. Integrating the density over space recovers the single number that particle mechanics called HH — and with it, the familiar conservation statement, proved locally in Derivation A.

H=∫H d3x=∫(πϕ˙−L) d3x(3)H=\int\mathcal{H}\,\mathrm{d}^3x=\int\big(\pi\dot\phi-\mathcal{L}\big)\,\mathrm{d}^3x \qquad (3)

where: HH — total field energy, conserved if L\mathcal{L} has no explicit time dependence and boundary fluxes vanish. The string makes everything concrete. Starting from its density (inherited from the Lagrangian-density article), invert π=μϕ˙\pi=\mu\dot\phi for ϕ˙=π/μ\dot\phi=\pi/\mu and substitute into (2): H=π2/μ−(π2/2μ−12Tϕ′2)\mathcal{H}=\pi^2/\mu-(\pi^2/2\mu-\tfrac12 T\phi'^2), giving the positive-definite result below.

L=12μϕ˙2−12Tϕ′2⟹H=π22μ+12Tϕ′2,π=μϕ˙(4)\mathcal{L}=\tfrac12\mu\dot\phi^2-\tfrac12 T\phi'^2\quad\Longrightarrow\quad \mathcal{H}=\frac{\pi^2}{2\mu}+\tfrac12 T\phi'^2,\qquad \pi=\mu\dot\phi \qquad (4)

where: μ\mu — linear mass density; TT — tension; ϕ′\phi' — local slope ∂xϕ\partial_x\phi. Kinetic plus potential energy per unit length, exactly what an elementary force-and-work analysis of a string element yields — the formalism's sanity check. Dynamics in the Hamiltonian picture comes from the field version of Hamilton's canonical equations (the finite-DOF pair of the Hamilton's-canonical-equations article, upgraded with functional derivatives). Derivation C runs them on the string and recovers the wave equation.

ϕ˙=δHδπ=∂H∂π,π˙=−δHδϕ=−∂H∂ϕ+∂i∂H∂(∂iϕ)(5)\dot\phi=\frac{\delta H}{\delta\pi}=\frac{\partial\mathcal{H}}{\partial\pi},\qquad \dot\pi=-\frac{\delta H}{\delta\phi}=-\frac{\partial\mathcal{H}}{\partial\phi}+\partial_i\frac{\partial\mathcal{H}}{\partial(\partial_i\phi)} \qquad (5)

where: δ/δϕ\delta/\delta\phi — functional derivative: the change of HH per unit change of ϕ\phi at one point, which automatically packages the by-parts gradient term. When H\mathcal{H} contains no gradients of π\pi, the first equation reduces to an ordinary partial derivative. The canonical structure is completed by the equal-time Poisson bracket — the continuum limit of {qi,pj}=δij\{q_i,p_j\}=\delta_{ij}, with the Kronecker delta maturing into a Dirac delta.

{ϕ(x),π(y)}=δ3(x−y)(6)\{\phi(x),\pi(y)\}=\delta^3(x-y) \qquad (6)

where: δ3\delta^3 — Dirac delta function; its units (inverse volume) are exactly what make the bracket of two densities consistent. Promoted to a commutator, this line is the axiom on which quantum field theory is built. Finally, energy density is only the first entry of Noether's ledger. Applying the translation-symmetry argument in all four spacetime directions produces the canonical energy–momentum tensor — derived component-wise in Derivations A and B.

Tμν=∂L∂(∂μϕ) ∂νϕ−δμν L,∂tH+∂iSi=0,Si=−ϕ˙ ∂L∂(∂iϕ)(7)T^{\mu}{}_{\nu}=\frac{\partial\mathcal{L}}{\partial(\partial_\mu\phi)}\,\partial_\nu\phi-\delta^\mu{}_\nu\,\mathcal{L},\qquad \partial_t\mathcal{H}+\partial_i S^i=0,\quad S^i=-\dot\phi\,\frac{\partial\mathcal{L}}{\partial(\partial_i\phi)} \qquad (7)

where: T00=HT^0{}_0=\mathcal{H} — energy density; T0i=−π ∂iϕT^0{}_i=-\pi\,\partial_i\phi — field momentum density (sign convention metric-dependent); Si=Ti0S^i=T^i{}_0 — energy flux, equal to −Tϕ˙ϕ′-T\dot\phi\phi' for the string; ∂μTμν=0\partial_\mu T^\mu{}_\nu=0 — four local conservation laws for translation-invariant L\mathcal{L} on shell.

Which object when:

QuestionObjectWhy
How much energy is here right nowH=T00\mathcal{H}=T^0{}_0local, positive-definite for the string
How fast is energy flowing past this pointSi=Ti0S^i=T^i{}_0continuity partner of H\mathcal{H}
How much momentum does the field carryPi=−∫π ∂iϕ d3xP_i=-\int\pi\,\partial_i\phi\,\mathrm{d}^3xNoether charge of spatial translations
Time evolution without a LagrangianHamilton's equations (5)first-order in time; numerics and quantization
Derivation AEnergy conservation from time-translation symmetry

We show that when L\mathcal{L} has no explicit time dependence, the total field energy ∫H d3x\int\mathcal{H}\,\mathrm{d}^3x is conserved, and we identify H\mathcal{H} as the T00T^0{}_0 component of the Noether tensor. The strategy: compute the total time derivative of L\mathcal{L} along a solution, use the field Euler–Lagrange equation to eliminate the force term, and reorganize everything into a continuity equation. Watch the distinction between total and explicit time dependence — the theorem lives entirely in that gap.

Step 1. Differentiate L(ϕ,ϕ˙,∂iϕ)\mathcal{L}(\phi,\dot\phi,\partial_i\phi) totally with respect to time along a solution:

dLdt=∂L∂ϕϕ˙+∂L∂ϕ˙ϕ¨+∂L∂(∂iϕ)∂iϕ˙\frac{\mathrm{d}\mathcal{L}}{\mathrm{d}t}=\frac{\partial\mathcal{L}}{\partial\phi}\dot\phi+\frac{\partial\mathcal{L}}{\partial\dot\phi}\ddot\phi+\frac{\partial\mathcal{L}}{\partial(\partial_i\phi)}\partial_i\dot\phi

Why: the chain rule threads through every slot; the absent explicit-tt term is precisely the symmetry assumption.

Step 2. Eliminate ∂L/∂ϕ\partial\mathcal{L}/\partial\phi using the field Euler–Lagrange equation written in 3+1 form:

∂L∂ϕ=∂t(∂L∂ϕ˙)+∂i(∂L∂(∂iϕ))\frac{\partial\mathcal{L}}{\partial\phi}=\partial_t\Big(\frac{\partial\mathcal{L}}{\partial\dot\phi}\Big)+\partial_i\Big(\frac{\partial\mathcal{L}}{\partial(\partial_i\phi)}\Big)

Why: conservation laws hold on shell — the dynamics is the only input that turns symmetry into conservation.

Step 3. Substitute and recognize product-rule pairs: the first two terms of Step 1 combine with the substituted expression into ∂t(πϕ˙)\partial_t(\pi\dot\phi), and the gradient terms into a spatial divergence:

dLdt=∂t(πϕ˙)+∂i(∂L∂(∂iϕ) ϕ˙)\frac{\mathrm{d}\mathcal{L}}{\mathrm{d}t}=\partial_t\big(\pi\dot\phi\big)+\partial_i\Big(\frac{\partial\mathcal{L}}{\partial(\partial_i\phi)}\,\dot\phi\Big)

Why: this is the same regrouping as the particle-mechanics proof that H=pq˙−LH=p\dot q-L is conserved, with one extra spatial-divergence column in the ledger.

Step 4. Move dL/dt\mathrm{d}\mathcal{L}/\mathrm{d}t to the right and read off the continuity equation:

∂t(πϕ˙−L)⏟H+∂iSi=0,Si=∂L∂(∂iϕ) ϕ˙\partial_t\underbrace{\big(\pi\dot\phi-\mathcal{L}\big)}_{\mathcal{H}}+\partial_i S^i=0,\qquad S^i=\frac{\partial\mathcal{L}}{\partial(\partial_i\phi)}\,\dot\phi

Why: the object under ∂t\partial_t is exactly the Legendre transform — the Hamiltonian density has DERIVED itself as the conserved density of time translations.

Step 5. Integrate over space; the divergence term becomes a boundary flux ∮SidAi\oint S^i\mathrm{d}A_i that vanishes for decaying or periodic fields, so dH/dt=0\mathrm{d}H/\mathrm{d}t=0. Verified: for the string this gives S=−Tϕ˙ϕ′S=-T\dot\phi\phi' and H=12μϕ˙2+12Tϕ′2\mathcal{H}=\tfrac12\mu\dot\phi^2+\tfrac12 T\phi'^2, matching the direct computation in the Lagrangian-density article; matches Goldstein §13.3 and the T00T^0{}_0 slot of equation (7).

Go deeper · Derivation B · 1 minField momentum from spatial translation symmetry
Derivation BField momentum from spatial translation symmetry

We derive the field momentum density −π ∂iϕ-\pi\,\partial_i\phi as the Noether charge density of spatial translations. The strategy parallels Derivation A with time replaced by space: shift the field configuration rigidly, identify the current whose conservation the Euler–Lagrange equation guarantees, and read off the charge. The subtle point is the sign and the variation: shifting the FIELD (not the coordinates) by ϵ\epsilon changes its value at a fixed point by minus the gradient.

Step 1. Under a rigid shift xj→xj+ϵjx^j\to x^j+\epsilon^j the translated configuration is ϕϵ(x)=ϕ(x−ϵ)\phi_\epsilon(x)=\phi(x-\epsilon), so at fixed xx:

δϕ=−ϵj ∂jϕ\delta\phi=-\epsilon^j\,\partial_j\phi

Why: the field profile is carried along; the point xx now sees the value that used to live a distance ϵ\epsilon upstream.

Step 2. Because the density has no explicit xx-dependence (homogeneous medium), this variation changes L\mathcal{L} only by a total derivative, δL=−ϵj∂jL\delta\mathcal{L}=-\epsilon^j\partial_j\mathcal{L}, so translations are a symmetry of the action. Noether's construction then yields the current

jμj=∂L∂(∂μϕ) ∂jϕ−δμj L  =  Tμjj^\mu{}_j=\frac{\partial\mathcal{L}}{\partial(\partial_\mu\phi)}\,\partial_j\phi-\delta^\mu{}_j\,\mathcal{L}\;=\;T^\mu{}_j

Why: the general Noether current pairs the momentum-slot partial with the field variation and subtracts the compensating total-derivative piece — that subtraction is the −δμjL-\delta^\mu{}_j\mathcal{L} term, and it is why the stress–energy tensor and not some other object appears.

Step 3. The time component is the conserved charge density:

T0j=∂L∂ϕ˙ ∂jϕ=π ∂jϕT^0{}_j=\frac{\partial\mathcal{L}}{\partial\dot\phi}\,\partial_j\phi=\pi\,\partial_j\phi

Why: charge densities are always the μ=0\mu=0 slots of Noether currents; with metric (+,−,−,−)(+,-,-,-) the physical momentum density carries a minus sign, gj=−π∂jϕg_j=-\pi\partial_j\phi — conventions shuffle the sign, the physics does not.

Step 4. Conservation and the charge:

∂μTμj=0⟹Pj=−∫π ∂jϕ d3x,dPjdt=0\partial_\mu T^\mu{}_j=0\quad\Longrightarrow\quad P_j=-\int\pi\,\partial_j\phi\,\mathrm{d}^3x,\qquad \frac{\mathrm{d}P_j}{\mathrm{d}t}=0

Why: the same Euler–Lagrange elimination as Derivation A, run with a spatial index; an inhomogeneous medium (explicit xx in L\mathcal{L}) would break exactly this law, and only this law. *Verified: for a travelling string wave ϕ=Acos⁡(kx−ωt)\phi=A\cos(kx-\omega t), g=−μϕ˙ϕ′=μA2ωksin⁡2(kx−ωt)≥0g=-\mu\dot\phi\phi'=\mu A^2\omega k\sin^2(kx-\omega t)\geq0 — momentum flows in the propagation direction, averaging ⟨g⟩=12μA2ωk=⟨H⟩/c\langle g\rangle=\tfrac12\mu A^2\omega k=\langle\mathcal{H}\rangle/c, the field analogue of E=pcE=pc. Consistent with Landau–Lifshitz Classical Theory of Fields §32.*

Go deeper · Derivation C · 1 minHamilton's field equations reproduce the wave equation
Derivation CHamilton's field equations reproduce the wave equation

We verify the canonical formalism end to end by recovering ϕ¨=c2ϕ′′\ddot\phi=c^2\phi'' from the string Hamiltonian density. The strategy: apply the two Hamilton equations (5) to H=π2/2μ+12Tϕ′2\mathcal{H}=\pi^2/2\mu+\tfrac12 T\phi'^2, being careful that the functional derivative with respect to ϕ\phi picks up the gradient term through integration by parts. This closes the loop: Lagrangian and Hamiltonian routes must agree, and do.

Step 1. First Hamilton equation — velocity from momentum:

ϕ˙=∂H∂π=πμ\dot\phi=\frac{\partial\mathcal{H}}{\partial\pi}=\frac{\pi}{\mu}

Why: H\mathcal{H} contains no gradients of π\pi, so the functional derivative collapses to an ordinary partial; this simply inverts the definition π=μϕ˙\pi=\mu\dot\phi.

Step 2. Second Hamilton equation — force from the functional derivative:

π˙=−δHδϕ=−(∂H∂ϕ−∂x∂H∂ϕ′)\dot\pi=-\frac{\delta H}{\delta\phi}=-\Big(\frac{\partial\mathcal{H}}{\partial\phi}-\partial_x\frac{\partial\mathcal{H}}{\partial\phi'}\Big)

Why: varying H=∫H dxH=\int\mathcal{H}\,\mathrm{d}x with respect to ϕ(x)\phi(x) must account for H\mathcal{H}'s dependence on the slope; the by-parts move deposits a −∂x-\partial_x on the slope-partial exactly as in the Euler–Lagrange derivation.

Step 3. Evaluate for the string: H\mathcal{H} has no bare ϕ\phi dependence and ∂H/∂ϕ′=Tϕ′\partial\mathcal{H}/\partial\phi'=T\phi':

π˙=∂x(Tϕ′)=Tϕ′′\dot\pi=\partial_x\big(T\phi'\big)=T\phi''

Why: the restoring force density on a string element is the divergence of the transverse tension component — Newton recovered from the canonical crank.

Step 4. Eliminate π\pi by differentiating Step 1 in time and inserting Step 3:

μϕ¨=π˙=Tϕ′′⟹ϕ¨=Tμ ϕ′′=c2ϕ′′\mu\ddot\phi=\dot\pi=T\phi''\quad\Longrightarrow\quad \ddot\phi=\frac{T}{\mu}\,\phi''=c^2\phi''

Why: two first-order canonical equations have fused into the familiar second-order wave equation, with c=T/μc=\sqrt{T/\mu}. *Verified: identical to the Euler–Lagrange result in the field-EL article — the two formalisms agree, as the Lagrangian–Hamiltonian equivalence article guarantees at finite DOF. The first-order pair is also exactly the form used by numerical PDE integrators (leapfrog updates ϕ\phi and π\pi alternately).*

Limiting cases

The Hamiltonian-density machinery specializes cleanly in several regimes:

CaseResultMeaning
Free scalar / wave fieldH=12π2/μ+12Tϕ′2\mathcal{H}=\tfrac12\pi^2/\mu+\tfrac12 T\phi'^2Positive-definite kinetic + gradient energy; conserved, manifestly the string energy density.
Static field (ϕ˙=0\dot\phi=0)H=−L=12Tϕ′2+V(ϕ)\mathcal{H}=-\mathcal{L}=\tfrac12 T\phi'^2+V(\phi)All energy is potential; π=0\pi=0. Equilibria extremize ∫H dx\int\mathcal{H}\,\mathrm{d}x — the principle of minimum elastic energy.
Discrete limit (lattice)H=∑i(pi22m+12k(qi+1−qi)2)H=\sum_i\Big(\frac{p_i^2}{2m}+\tfrac12 k(q_{i+1}-q_i)^2\Big)Replacing ∫H dx→∑i\int\mathcal{H}\,\mathrm{d}x\to\sum_i and π dx→pi\pi\,\mathrm{d}x\to p_i recovers the loaded-string Hamiltonian.
Travelling wavekinetic density == potential density pointwiseEquality holds at every point for a single travelling wave; standing waves instead slosh globally between the two ledgers.
Relativistic fieldT00=HT^0{}_0=\mathcal{H}, ∂μTμν=0\partial_\mu T^\mu{}_\nu=0Four conservation laws — energy and three momenta — from spacetime translation invariance.

Worked examples

Example 1 — energy sloshing in a standing wave (confidence builder). A string with μ=5.0×10−3 kg/m\mu=5.0\times10^{-3}\ \mathrm{kg/m} and T=80 NT=80\ \mathrm{N} is clamped at x=0x=0 and x=L=1.0 mx=L=1.0\ \mathrm{m} and oscillates in its fundamental, ϕ(x,t)=Asin⁡(kx)cos⁡(ωt)\phi(x,t)=A\sin(kx)\cos(\omega t) with A=2.0 mmA=2.0\ \mathrm{mm}. Verify explicitly that the energy is all potential at t=0t=0, all kinetic a quarter period later, and equal in total.

Step 1. Mode parameters: k=π/L=3.1416 rad/mk=\pi/L=3.1416\ \mathrm{rad/m}; c=T/μ=80/0.005=126.5 m/sc=\sqrt{T/\mu}=\sqrt{80/0.005}=126.5\ \mathrm{m/s}; ω=ck=397.4 rad/s\omega=ck=397.4\ \mathrm{rad/s} (f=63.2 Hzf=63.2\ \mathrm{Hz}).

Step 2. At t=0t=0: cos⁡ωt=1\cos\omega t=1, so ϕ˙=−Aωsin⁡(kx)sin⁡(ωt)=0\dot\phi=-A\omega\sin(kx)\sin(\omega t)=0 everywhere — the kinetic ledger is empty. The potential ledger holds, using ∫0Lcos⁡2(kx) dx=L/2\int_0^L\cos^2(kx)\,\mathrm{d}x=L/2:

Epot=∫0L12TA2k2cos⁡2(kx) dx=14TA2k2L=14(80)(2.0×10−3)2(π)2(1.0)E_{\text{pot}}=\int_0^L\tfrac12 T A^2k^2\cos^2(kx)\,\mathrm{d}x=\tfrac14 TA^2k^2L=\tfrac14(80)(2.0\times10^{-3})^2(\pi)^2(1.0)

Compute: (2.0×10−3)2=4.0×10−6(2.0\times10^{-3})^2=4.0\times10^{-6}; ×80=3.2×10−4\times80=3.2\times10^{-4}; ×π2=3.16×10−3\times\pi^2=3.16\times10^{-3}; ÷4\div4: Epot=7.9×10−4 JE_{\text{pot}}=7.9\times10^{-4}\ \mathrm{J}.

Step 3. At t=T/4t=T/4: cos⁡ωt=0\cos\omega t=0, so ϕ=0\phi=0 — the string is momentarily FLAT and the potential ledger is empty. But ϕ˙=−Aωsin⁡(kx)\dot\phi=-A\omega\sin(kx) at full amplitude:

Ekin=∫0L12μA2ω2sin⁡2(kx) dx=14μA2ω2L=14(0.005)(397.4)2(4.0×10−6)(1.0)E_{\text{kin}}=\int_0^L\tfrac12\mu A^2\omega^2\sin^2(kx)\,\mathrm{d}x=\tfrac14\mu A^2\omega^2 L=\tfrac14(0.005)(397.4)^2(4.0\times10^{-6})(1.0)

Compute: (397.4)2=1.579×105(397.4)^2=1.579\times10^{5}; ×0.005=789.7\times0.005=789.7; ×4.0×10−6=3.16×10−3\times4.0\times10^{-6}=3.16\times10^{-3}; ÷4\div4: Ekin=7.9×10−4 JE_{\text{kin}}=7.9\times10^{-4}\ \mathrm{J}.

Check: the two are equal because μω2=μc2k2=Tk2\mu\omega^2=\mu c^2k^2=Tk^2 — the dispersion relation is exactly the exchange rate between the ledgers. Total energy E=0.79 mJE=0.79\ \mathrm{mJ}, constant, sloshing wholly between kinetic and potential twice per period.

Example 2 — power and momentum carried by a travelling wave (exam level). On the same string (μ=5.0×10−3 kg/m\mu=5.0\times10^{-3}\ \mathrm{kg/m}, T=80 NT=80\ \mathrm{N}, c=126.5 m/sc=126.5\ \mathrm{m/s}), a travelling wave ϕ=Acos⁡(kx−ωt)\phi=A\cos(kx-\omega t) has amplitude A=1.0 mmA=1.0\ \mathrm{mm} and frequency f=200 Hzf=200\ \mathrm{Hz}. Find the time-averaged energy density, the average power transmitted, and the average field momentum density, and verify the E=pcE=pc relation.

Step 1. ω=2πf=1256.6 rad/s\omega=2\pi f=1256.6\ \mathrm{rad/s}, k=ω/c=9.934 rad/mk=\omega/c=9.934\ \mathrm{rad/m}.

Step 2. Both energy ledgers are equal pointwise for a travelling wave (each 12μA2ω2sin⁡2\tfrac12\mu A^2\omega^2\sin^2), so the average energy density is

⟨H⟩=12μA2ω2=12(0.005)(1256.6)2(1.0×10−6)=3.95×10−3 J/m\langle\mathcal{H}\rangle=\tfrac12\mu A^2\omega^2=\tfrac12(0.005)(1256.6)^2(1.0\times10^{-6})=3.95\times10^{-3}\ \mathrm{J/m}

Step 3. Average power through any point: ⟨S⟩=⟨−Tϕ˙ϕ′⟩=12TA2ωk=12(80)(10−6)(1256.6)(9.934)=0.499 W\langle S\rangle=\langle-T\dot\phi\phi'\rangle=\tfrac12 TA^2\omega k=\tfrac12(80)(10^{-6})(1256.6)(9.934)=0.499\ \mathrm{W}. Cross-check: ⟨S⟩=⟨H⟩c=(3.95×10−3)(126.5)=0.500 W\langle S\rangle=\langle\mathcal{H}\rangle c=(3.95\times10^{-3})(126.5)=0.500\ \mathrm{W} — energy density times transport speed. ✓ consistent.

Step 4. Average field momentum density (Derivation B): ⟨g⟩=12μA2ωk=12(0.005)(10−6)(1256.6)(9.934)=3.12×10−5 kg/s\langle g\rangle=\tfrac12\mu A^2\omega k=\tfrac12(0.005)(10^{-6})(1256.6)(9.934)=3.12\times10^{-5}\ \mathrm{kg/s} (momentum per unit length).

Step 5. Verify the ratio: ⟨H⟩/⟨g⟩=3.95×10−3/3.12×10−5=126.6 m/s=c\langle\mathcal{H}\rangle/\langle g\rangle=3.95\times10^{-3}/3.12\times10^{-5}=126.6\ \mathrm{m/s}=c. The wave carries ⟨g⟩=⟨H⟩/c\langle g\rangle=\langle\mathcal{H}\rangle/c — energy and momentum locked in the ratio E=pcE=pc, exactly like photons, because both travel undistorted at the single speed cc.

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

Hamilton reformulated mechanics twice before turning thirty: the 1834–35 essays introduced the characteristic and principal functions, the canonical equations, and the systematic trade of velocities for momenta that this article performs with densities. He never applied the scheme to continuous media — that took the century after him — but the formalism was built so tightly around the LOGIC of conjugate pairs, rather than around particles, that the generalization required only upgrading an index to a position label: (qi,pi)→(ϕ(x),π(x))(q_i,p_i)\to(\phi(x),\pi(x)). It was precisely this canonical skeleton that Heisenberg, Born and Jordan reached for in 1925–26 when they quantized the electromagnetic field mode by mode, making Hamilton's construction the load-bearing frame of quantum field theory. Ireland's Astronomer Royal at 22, he also gave physics the word — and the concept — "Hamiltonian," arguably the single most reused noun in theoretical physics.

History
1834
— Hamilton's first essay On a General Method in Dynamics introduces the canonical formulation
1835
— the second essay completes the canonical equations and the momentum-for-velocity trade
1918
— Noether's theorem ties energy and momentum conservation to spacetime translation symmetry of the action
1926
— Born, Heisenberg and Jordan quantize field oscillators canonically, seeding quantum field theory
1950
— Dirac's constrained-Hamiltonian formalism handles fields whose momenta cannot be inverted, completing the canonical program for gauge theories

Going further

References. Goldstein, Poole & Safko, Classical Mechanics 3rd ed., Ch. 13 (Continuous Systems and Fields) · Landau & Lifshitz, Mechanics Vol. 1, §32 and Classical Theory of Fields §32–33 (energy–momentum tensor) · Morin, Introduction to Classical Mechanics, Ch. on coupled oscillators and continuum limit · Taylor, Classical Mechanics, Ch. 16 (Continuum Mechanics) · José & Saletan, Classical Dynamics, Ch. 9 (Continuum Dynamics)

Provenance. All equations are standard continuum-mechanics/field-theory results. A verifier should recompute: (1) the Legendre transform giving H=π2/2μ+12Tϕ′2\mathcal{H}=\pi^2/2\mu+\tfrac12T\phi'^2 from L=12μϕ˙2−12Tϕ′2\mathcal{L}=\tfrac12\mu\dot\phi^2-\tfrac12T\phi'^2; (2) the energy continuity equation ∂tH+∂iSi=0\partial_t\mathcal{H}+\partial_i S^i=0 via the field EL equation (Derivation 1); (3) recovery of ϕ¨=c2ϕ′′\ddot\phi=c^2\phi'' with c2=T/μc^2=T/\mu from Hamilton's equations (Derivation 3); (4) the canonical tensor Tμν=(∂L/∂(∂μϕ))∂νϕ−δμνLT^\mu{}_\nu=(\partial\mathcal{L}/\partial(\partial_\mu\phi))\partial_\nu\phi-\delta^\mu{}_\nu\mathcal{L}. Cross-check against Goldstein 3rd ed. Ch. 13, Landau–Lifshitz Classical Theory of Fields §32, and Taylor Ch. 16. No experimental numbers are quoted.

Builds on: Lagrangian Density and Continuum Lagrangian Formalism · Euler–Lagrange Equations for Fields · Discrete Loaded String and the Continuum Limit · The One-Dimensional Wave Equation Leads to: Four-Vectors and Minkowski Spacetime · Elastic Waves in Solids · Stress Tensor and Cauchy's Relation

The momentum density of a transverse string wave points transverse to the string, but the wave's momentum surely points along it. Which is which?

Both statements are right about different objects, and the collision is instructive. π=μϕ˙\pi=\mu\dot\phi is the CANONICAL momentum density, conjugate to the field: for a transverse wave it points along the displacement. The MECHANICAL momentum the wave transports along the propagation direction is the Noether charge of spatial translations, with density g=−πϕ′=−μϕ˙ϕ′g=-\pi\phi'=-\mu\dot\phi\phi' — a product of the transverse velocity and the slope, which is nonzero on average for a travelling wave and points along the propagation axis. Derivation B builds it, and Worked example 2 shows ⟨g⟩=⟨H⟩/c\langle g\rangle=\langle\mathcal{H}\rangle/c. Rule of thumb: π\pi runs the canonical machinery; g=T01g=T^0{}_1 pushes on things.

Is the Hamiltonian density a Lorentz scalar like the Lagrangian density?

No — and this asymmetry is structural, not sloppy bookkeeping. L\mathcal{L} can be a scalar because the action integrates it over the invariant measure d4x\mathrm{d}^4x. But H=T00\mathcal{H}=T^0{}_0 is one component of a rank-two tensor: it is tied to a specific time direction, i.e. to a choice of frame. Under a boost, energy density mixes with momentum density and stress, just as a particle's energy mixes with its momentum. That is why relativistic QFT often prefers Lagrangian (path-integral) methods for manifest covariance, while Hamiltonian methods shine where a preferred frame is natural: lattice simulation, condensed matter, cosmology, numerical relativity.

What exactly does the functional derivative do that a partial derivative cannot?

H=∫H dxH=\int\mathcal{H}\,\mathrm{d}x depends on the whole function ϕ\phi, so "differentiate with respect to ϕ\phi at the point xx" needs care: perturb ϕ→ϕ+ϵ δ(x−y)\phi\to\phi+\epsilon\,\delta(x-y) and measure the first-order response of HH. Because H\mathcal{H} contains ϕ′\phi', the perturbation's derivative also contributes, and one integration by parts converts that into −∂x(∂H/∂ϕ′)-\partial_x(\partial\mathcal{H}/\partial\phi') evaluated at the point. So δH/δϕ=∂H/∂ϕ−∂x(∂H/∂ϕ′)\delta H/\delta\phi=\partial\mathcal{H}/\partial\phi-\partial_x(\partial\mathcal{H}/\partial\phi'): the functional derivative is the partial-derivative combination that already includes the by-parts bookkeeping. Your professor's expanded formula and the compact δH/δϕ\delta H/\delta\phi are the same object.

Why does the equal-time bracket produce a Dirac delta rather than a Kronecker delta?

Dimensional bookkeeping of the continuum limit. On the chain, {qi,pj}=δij\{q_i,p_j\}=\delta_{ij} with pjp_j a momentum. Passing to densities divides pp by the cell size aa, so the bracket of ϕ(xi)\phi(x_i) with π(xj)=pj/a\pi(x_j)=p_j/a equals δij/a\delta_{ij}/a — which is exactly the discrete representation of δ(xi−xj)\delta(x_i-x_j): zero for different sites, and blowing up as 1/a1/a on the diagonal so that its integral is 1. The Dirac delta is the Kronecker delta per unit volume, which is what pairing a field with a momentum density requires.

The static-field row of the table says the Hamiltonian density equals minus the Lagrangian density. Is that a typo?

No. With ϕ˙=0\dot\phi=0 we get π=0\pi=0, so H=πϕ˙−L=−L\mathcal{H}=\pi\dot\phi-\mathcal{L}=-\mathcal{L}. And indeed for a static string L=−12Tϕ′2\mathcal{L}=-\tfrac12 T\phi'^2 (no kinetic term, potential enters negatively), so H=+12Tϕ′2\mathcal{H}=+\tfrac12 T\phi'^2 — the positive stored elastic energy, as it must be. The sign relation H=−L\mathcal{H}=-\mathcal{L} for statics is the density version of H=VH=V when Tkin=0T_{\text{kin}}=0 while L=−VL=-V. Static equilibria minimize ∫H dx\int\mathcal{H}\,\mathrm{d}x, which is why elastostatics is an energy-minimization discipline.

When the momentum cannot be inverted for the velocity, what actually goes wrong, and what is the fix?

The transform needs π=∂L/∂ϕ˙\pi=\partial\mathcal{L}/\partial\dot\phi to be solvable for ϕ˙\dot\phi; if L\mathcal{L} is independent of some ϕ˙\dot\phi (electromagnetism: no A˙0\dot A_0 in L\mathcal{L}), the corresponding momentum is identically zero — a constraint, not an equation of motion. Naive Hamilton's equations then contradict themselves. Dirac's fix (1950): keep the constraint as a condition on phase space, check its consistency under evolution (generating possibly further constraints), and replace the Poisson bracket by the Dirac bracket that respects them. This is not exotic: every gauge theory in the Standard Model runs on this machinery, which is why the overview flags it as the doorway out of naive canonical field theory.

Do Hamilton's field equations actually help solve anything, or are they a formal curiosity?

They are the workhorse form for computation. Numerically, the first-order pair ϕ˙=π/μ\dot\phi=\pi/\mu, π˙=Tϕ′′\dot\pi=T\phi'' is what symplectic integrators (leapfrog/Verlet) march forward — they update ϕ\phi and π\pi alternately and conserve a shadow energy exactly, which is why wave codes and molecular dynamics use them. Analytically, the Hamiltonian form is the entry point to canonical perturbation theory, to stability analysis (energy as a Lyapunov function), and above all to quantization: you cannot write [ϕ^,π^]=iℏδ3[\hat\phi,\hat\pi]=i\hbar\delta^3 until you know what π\pi is. The Lagrangian form is better for symmetry arguments; the Hamiltonian form is better for dynamics and quantum mechanics. You need both hands.

Before this

Where this leads