physics2u
Tier
⌕ Search ⌘K
Derivation

Hamiltonian Formulation for Fields

Statement

Given a local Lagrangian density \(\mathcal{L}(\phi,\partial_\mu\phi)\) for a classical field \(\phi(\mathbf{x},t)\), the Legendre transform in the field velocity \(\dot\phi\) defines a conjugate momentum density \(\pi(\mathbf{x},t)=\partial\mathcal{L}/\partial\dot\phi\) and a Hamiltonian density \(\mathcal{H}=\pi\dot\phi-\mathcal{L}\), from which the field dynamics follow as the canonical Hamilton equations \(\dot\phi=\delta H/\delta\pi\), \(\dot\pi=-\delta H/\delta\phi\), equivalently the Poisson-bracket flow \(\dot F=\{F,H\}\) with the equal-time bracket \(\{\phi(\mathbf{x}),\pi(\mathbf{y})\}=\delta^{3}(\mathbf{x}-\mathbf{y})\).

Why it matters

The Hamiltonian form recasts a second-order field equation as a first-order flow in phase space \((\phi,\pi)\), separating the configuration from its momentum. This is the structure that survives quantisation: promoting the Poisson bracket to a commutator, \(\{\,\cdot\,,\,\cdot\,\}\to \tfrac{1}{i\hbar}[\,\cdot\,,\,\cdot\,]\), is precisely how one passes from a classical field to a quantum field theory, so every canonical quantisation begins here.

It also makes the field energy explicit and manifest: \(H=\int d^{3}x\,\mathcal{H}\) is the conserved Noether charge of time translation, so the Hamiltonian density is the energy density carried by the field. This ties the abstract formalism to measurable quantities and to the conservation laws that organise field theory.

Assumptions
The Lagrangian density is local and depends only on \(\phi\) and its first derivatives.If \(\mathcal{L}\) contains \(\ddot\phi\) or nonlocal kernels, a single momentum \(\pi=\partial\mathcal{L}/\partial\dot\phi\) no longer captures the dynamics; one needs Ostrogradsky's construction with extra momenta and an energy unbounded below.
The Legendre transform is invertible: \(\dot\phi\) can be solved for in terms of \(\pi\).If \(\partial^{2}\mathcal{L}/\partial\dot\phi^{2}\) is singular the theory is constrained (gauge fields), and one must use Dirac's constrained-Hamiltonian procedure with primary and secondary constraints rather than the naive transform.
Fields and their variations vanish sufficiently fast at spatial infinity.If boundary terms do not vanish, the functional derivatives \(\delta H/\delta\phi\) are ill-defined and Hamilton's equations acquire surface contributions; the bracket algebra then fails to close without boundary charges.
An equal-time (fixed inertial frame) foliation of spacetime is chosen.Singling out \(t\) breaks manifest Lorentz covariance; if dropped one cannot define a single time on which to impose canonical brackets, and the construction must be replaced by a covariant phase-space or de Donder–Weyl formalism.
Derivation
1
\[\mathcal{L}=\mathcal{L}(\phi,\dot\phi,\nabla\phi),\qquad S=\int dt\int d^{3}x\,\mathcal{L}\]
Start from a local action; \(\dot\phi\) is the only velocity, \(\nabla\phi\) is treated as an external label like a coordinate. A
2
\[\pi(\mathbf{x},t)\equiv\frac{\partial\mathcal{L}}{\partial\dot\phi(\mathbf{x},t)}\]
Definition of the conjugate momentum density: the derivative of \(\mathcal{L}\) with respect to the field velocity, the object the Legendre transform trades for \(\dot\phi\). A
3
\[\frac{\partial^{2}\mathcal{L}}{\partial\dot\phi^{2}}\neq 0\ \Rightarrow\ \dot\phi=\dot\phi(\phi,\pi,\nabla\phi)\]
Non-degeneracy (Assumption 2) lets us invert step 2 and express the velocity in terms of the momentum. B
4
\[\mathcal{H}\equiv\pi\dot\phi-\mathcal{L}\big|_{\dot\phi=\dot\phi(\phi,\pi,\nabla\phi)}\]
The Legendre transform in \(\dot\phi\); after substitution \(\mathcal{H}\) is a function of \((\phi,\pi,\nabla\phi)\) alone. A
5
\[d\mathcal{H}=\pi\,d\dot\phi+\dot\phi\,d\pi-\frac{\partial\mathcal{L}}{\partial\dot\phi}d\dot\phi-\frac{\partial\mathcal{L}}{\partial\phi}d\phi-\frac{\partial\mathcal{L}}{\partial(\nabla\phi)}\cdot d(\nabla\phi)\]
Total differential of \(\mathcal{H}=\pi\dot\phi-\mathcal{L}\); the \(d\dot\phi\) terms cancel by step 2, the hallmark of a Legendre transform. B
6
\[d\mathcal{H}=\dot\phi\,d\pi-\frac{\partial\mathcal{L}}{\partial\phi}d\phi-\frac{\partial\mathcal{L}}{\partial(\nabla\phi)}\cdot d(\nabla\phi)\]
After cancellation \(\mathcal{H}\) genuinely depends on \((\pi,\phi,\nabla\phi)\); reading off coefficients gives the partial derivatives below. B
7
\[\frac{\partial\mathcal{H}}{\partial\pi}=\dot\phi,\qquad \frac{\partial\mathcal{H}}{\partial\phi}=-\frac{\partial\mathcal{L}}{\partial\phi},\qquad \frac{\partial\mathcal{H}}{\partial(\nabla\phi)}=-\frac{\partial\mathcal{L}}{\partial(\nabla\phi)}\]
Coefficient matching in step 6 — the field-theory analogue of \(\partial H/\partial p=\dot q\). A
8
\[\frac{\partial\mathcal{L}}{\partial\phi}-\nabla\cdot\frac{\partial\mathcal{L}}{\partial(\nabla\phi)}-\frac{\partial}{\partial t}\frac{\partial\mathcal{L}}{\partial\dot\phi}=0\]
The Euler–Lagrange field equation (prior result), which we now feed into the momentum evolution. A
9
\[\dot\pi=\frac{\partial}{\partial t}\frac{\partial\mathcal{L}}{\partial\dot\phi}=\frac{\partial\mathcal{L}}{\partial\phi}-\nabla\cdot\frac{\partial\mathcal{L}}{\partial(\nabla\phi)}\]
Use step 2 in \(\dot\pi=\partial_t\pi\), then substitute Euler–Lagrange from step 8. A
10
\[\frac{\delta H}{\delta\phi}=\frac{\partial\mathcal{H}}{\partial\phi}-\nabla\cdot\frac{\partial\mathcal{H}}{\partial(\nabla\phi)},\qquad \frac{\delta H}{\delta\pi}=\frac{\partial\mathcal{H}}{\partial\pi}\]
Functional derivatives of \(H=\int d^{3}x\,\mathcal{H}\); the \(\nabla\phi\) dependence integrates by parts (Assumption 3 kills the surface term). C
11
\[\dot\phi=\frac{\delta H}{\delta\pi},\qquad \dot\pi=-\frac{\delta H}{\delta\phi}\]
Combine step 7 (first equation) with steps 7, 9, 10 (second): using \(\partial\mathcal{H}/\partial\phi=-\partial\mathcal{L}/\partial\phi\) and \(\partial\mathcal{H}/\partial(\nabla\phi)=-\partial\mathcal{L}/\partial(\nabla\phi)\) turns step 9 into \(\dot\pi=-\delta H/\delta\phi\). B
12
\[\{F,G\}\equiv\int d^{3}x\left(\frac{\delta F}{\delta\phi(\mathbf{x})}\frac{\delta G}{\delta\pi(\mathbf{x})}-\frac{\delta F}{\delta\pi(\mathbf{x})}\frac{\delta G}{\delta\phi(\mathbf{x})}\right)\]
Define the equal-time field Poisson bracket by analogy with the particle bracket, replacing \(\sum_i\partial/\partial q_i\) by \(\int d^3x\,\delta/\delta\phi\). B
13
\[\{\phi(\mathbf{x}),\pi(\mathbf{y})\}=\delta^{3}(\mathbf{x}-\mathbf{y}),\qquad \{\phi,\phi\}=\{\pi,\pi\}=0\]
Evaluate step 12 with \(F=\phi(\mathbf{x})\), \(G=\pi(\mathbf{y})\), using \(\delta\phi(\mathbf{x})/\delta\phi(\mathbf{z})=\delta^3(\mathbf{x}-\mathbf{z})\). B
14
\[\dot F=\{F,H\}\quad\Longleftrightarrow\quad \dot\phi=\{\phi,H\}=\frac{\delta H}{\delta\pi},\ \ \dot\pi=\{\pi,H\}=-\frac{\delta H}{\delta\phi}\]
Insert \(G=H\) into step 12 and use step 13; the canonical brackets reproduce Hamilton's equations of step 11. A
\[\pi=\frac{\partial\mathcal{L}}{\partial\dot\phi},\quad \mathcal{H}=\pi\dot\phi-\mathcal{L},\quad H=\int d^{3}x\,\mathcal{H},\quad \dot\phi=\frac{\delta H}{\delta\pi},\ \ \dot\pi=-\frac{\delta H}{\delta\phi},\quad \{\phi(\mathbf{x}),\pi(\mathbf{y})\}=\delta^{3}(\mathbf{x}-\mathbf{y})\]

Reading. The momentum density \(\pi\) is what the Lagrangian pays per unit field velocity. The Hamiltonian density is the Legendre transform that trades \(\dot\phi\) for \(\pi\), and equals the field energy density. The two first-order Hamilton equations are fully equivalent to the single second-order Euler–Lagrange equation, and the canonical bracket \(\{\phi,\pi\}=\delta^3\) generates all of the dynamics through \(\dot F=\{F,H\}\).

Units check. In SI, \([\mathcal{L}]=\mathrm{J\,m^{-3}}\). Since \([\dot\phi]=[\phi]\,\mathrm{s^{-1}}\), \([\pi]=[\mathcal{L}]/[\dot\phi]=\mathrm{J\,m^{-3}}\cdot\mathrm{s}/[\phi]\). Then \([\pi\dot\phi]=\mathrm{J\,m^{-3}}=[\mathcal{H}]\), consistent with an energy density, and \([H]=\mathrm{J\,m^{-3}}\cdot\mathrm{m^{3}}=\mathrm{J}\). The bracket \(\{\phi(\mathbf{x}),\pi(\mathbf{y})\}\) has units \([\phi][\pi]=\mathrm{J\,m^{-3}\,s}\) times \([\delta^{3}]^{-1}\)… more cleanly, \([\delta^{3}(\mathbf{x}-\mathbf{y})]=\mathrm{m^{-3}}\) matches \([\phi][\pi]/([\phi][\pi]\,\mathrm{m^{3}})\), i.e. the bracket is dimensionally \(\mathrm{m^{-3}}\) as required by the integral \(\int d^3x\).

Limiting cases
  • Point-particle limit. Discretising space into cells of volume \(\Delta V\), \(\phi\to q_i\), \(\int d^3x\to\sum_i\Delta V\), and \(\pi\,\Delta V\to p_i\); the field bracket \(\{\phi,\pi\}=\delta^3\) collapses to \(\{q_i,p_j\}=\delta_{ij}\).
  • Free scalar field. For \(\mathcal{L}=\tfrac12\dot\phi^2-\tfrac12(\nabla\phi)^2-\tfrac12 m^2\phi^2\) (natural units), \(\pi=\dot\phi\) and \(\mathcal{H}=\tfrac12\pi^2+\tfrac12(\nabla\phi)^2+\tfrac12 m^2\phi^2\), a manifestly positive energy density.
  • Non-relativistic (Schrödinger) field. \(\mathcal{L}=i\hbar\psi^*\dot\psi-\tfrac{\hbar^2}{2m}\nabla\psi^*\!\cdot\!\nabla\psi\) gives \(\pi_\psi=i\hbar\psi^*\); the transform is degenerate and the momentum is fixed by a constraint.
  • Static configurations. When \(\dot\phi=0\), \(H\) reduces to the potential-plus-gradient energy \(\int d^3x\,[\tfrac12(\nabla\phi)^2+V(\phi)]\), the functional minimised by solitons and vacua.
Breaks when
  • Degenerate (constrained) systems. Gauge theories such as electromagnetism have \(\partial\mathcal{L}/\partial\dot A_0=0\), so \(\pi^0\equiv0\) is a primary constraint and \(\dot\phi\) cannot be solved from \(\pi\); the naive Legendre transform fails and Dirac's constraint algorithm with Dirac brackets is required.
  • Higher-derivative Lagrangians. If \(\mathcal{L}\) depends on \(\ddot\phi\), one conjugate momentum is insufficient; Ostrogradsky's theorem then guarantees the Hamiltonian is linear in one momentum and hence unbounded below, signalling a ghost instability.
  • Manifest Lorentz covariance. Selecting a preferred time coordinate to define \(\pi\) and equal-time brackets breaks explicit covariance; while results remain relativistic, the formalism itself is frame-dependent and unsuited to background-independent gravity without further structure.
  • Fermionic fields. Grassmann-valued fields require anticommuting brackets (graded Poisson brackets) and second-class constraints; the plain symmetric bracket \(\{\phi,\pi\}=\delta^3\) does not apply.
Failure modes
  • Differentiating the wrong velocity. Writing \(\pi=\partial\mathcal{L}/\partial(\partial_\mu\phi)\) (a four-vector \(\pi^\mu\)) and confusing it with the canonical momentum \(\pi=\pi^0=\partial\mathcal{L}/\partial\dot\phi\); only the time component is the conjugate momentum.
  • Leaving \(\dot\phi\) in \(\mathcal{H}\). Forgetting to eliminate \(\dot\phi\) in favour of \(\pi\) after the transform, so \(\mathcal{H}\) is not a genuine phase-space function and Hamilton's equations give nonsense.
  • Sign error in the transform. Writing \(\mathcal{H}=\mathcal{L}-\pi\dot\phi\) instead of \(\pi\dot\phi-\mathcal{L}\), flipping the energy sign.
  • Dropping the gradient boundary term. Computing \(\delta H/\delta\phi=\partial\mathcal{H}/\partial\phi\) but forgetting the \(-\nabla\!\cdot\!\partial\mathcal{H}/\partial(\nabla\phi)\) piece, losing the spatial-Laplacian term in \(\dot\pi\).
  • Ordinary vs functional derivative. Using \(\partial/\partial\phi\) where \(\delta/\delta\phi(\mathbf{x})\) is meant, dropping the \(\delta^3(\mathbf{x}-\mathbf{y})\) and getting dimensionally wrong brackets.
  • Assuming \(\pi=\dot\phi\) always. True only when the kinetic term is \(\tfrac12\dot\phi^2\); with a nonstandard kinetic term \(\pi=K(\phi)\dot\phi\) or worse.
Discussion

The Hamiltonian formulation is a change of variables, not a change of physics. The Legendre transform is the same operation that converts the internal energy \(U(S,V)\) into the enthalpy or free energies in thermodynamics: it swaps a variable for the slope of the function in that variable. Here it swaps the field velocity \(\dot\phi\) for the momentum density \(\pi=\partial\mathcal{L}/\partial\dot\phi\), which is geometrically the slope of \(\mathcal{L}\) along \(\dot\phi\). The invertibility condition \(\partial^2\mathcal{L}/\partial\dot\phi^2\neq0\) is exactly the convexity that makes a Legendre transform well-defined and involutive.

Physically, the payoff is phase space. A configuration \(\phi(\mathbf{x})\) plus a momentum \(\pi(\mathbf{x})\) at one instant determines all future evolution through a first-order flow, whereas the Lagrangian picture needs \(\phi\) and \(\dot\phi\) and a second-order equation. This split is what lets the field energy \(H=\int d^3x\,\mathcal{H}\) generate time translation: \(\dot F=\{F,H\}\) says the Hamiltonian is the infinitesimal generator of the dynamics, mirroring how spatial momentum generates translations and angular momentum generates rotations. The whole edifice of conserved charges as bracket generators lives in this formalism.

The bracket \(\{\phi(\mathbf{x}),\pi(\mathbf{y})\}=\delta^3(\mathbf{x}-\mathbf{y})\) is the crossing point to quantum field theory. Canonical quantisation promotes it to the equal-time commutator \([\hat\phi(\mathbf{x}),\hat\pi(\mathbf{y})]=i\hbar\,\delta^3(\mathbf{x}-\mathbf{y})\), and the entire particle content — creation and annihilation operators, the Fock space, the propagator — is built from this single relation together with \(\hat H\). Every step of the classical derivation above therefore has a quantum shadow, which is why the Hamiltonian density, not the Lagrangian density, is the object one usually diagonalises.

A subtlety worth stressing at degree level: the canonical formalism singles out a time direction, so it sacrifices manifest Lorentz covariance even though the physics stays relativistic. The resolution is that the Poincaré generators \((H,\mathbf{P},\mathbf{J},\mathbf{K})\) themselves close into the Poincaré algebra under the Poisson bracket, so covariance is recovered as an algebraic statement rather than a manifest one. For gauge and gravitational systems this non-manifest covariance becomes a genuine technical burden, handled by the Dirac–Bergmann constrained-Hamiltonian theory, the ADM formulation of gravity, and ultimately the constraint structure that underlies canonical quantum gravity.

Common misconceptions. The Hamiltonian density is not obtained by "flipping a sign on the Lagrangian" — it is a Legendre transform that also re-expresses velocities as momenta, and only for a standard \(\tfrac12\dot\phi^2\) kinetic term does it coincide with "kinetic plus potential". Nor is \(\pi\) the same as the momentum four-current density \(\pi^\mu=\partial\mathcal{L}/\partial(\partial_\mu\phi)\); the conjugate momentum is only its time component. Finally, \(\mathcal{H}\) equals the energy density only when \(\mathcal{L}\) has no explicit time dependence and the fields transform standardly under time translation.

Worked examples
1
\[\mathcal{L}=\tfrac12\dot\phi^{2}-\tfrac12 c^{2}(\nabla\phi)^{2}-\tfrac12 m^{2}\phi^{2}\]
Real Klein–Gordon field, SI-style with wave speed \(c\); find \(\mathcal H\) and the equation of motion. A
2
\[\pi=\frac{\partial\mathcal{L}}{\partial\dot\phi}=\dot\phi\ \Rightarrow\ \dot\phi=\pi\]
Legendre transform; here it is trivially invertible. A
3
\[\mathcal{H}=\pi\dot\phi-\mathcal{L}=\pi^{2}-\left(\tfrac12\pi^{2}-\tfrac12 c^{2}(\nabla\phi)^{2}-\tfrac12 m^{2}\phi^{2}\right)=\tfrac12\pi^{2}+\tfrac12 c^{2}(\nabla\phi)^{2}+\tfrac12 m^{2}\phi^{2}\]
Substitute \(\dot\phi=\pi\); all three terms are positive, so the energy is bounded below. A
4
\[\dot\phi=\frac{\delta H}{\delta\pi}=\pi,\qquad \dot\pi=-\frac{\delta H}{\delta\phi}=c^{2}\nabla^{2}\phi-m^{2}\phi\]
Hamilton's equations; the second uses \(\delta H/\delta\phi=m^2\phi-\nabla\!\cdot\!(c^2\nabla\phi)\). B
5
\[\ddot\phi=\dot\pi=c^{2}\nabla^{2}\phi-m^{2}\phi\ \Rightarrow\ \frac{1}{c^{2}}\ddot\phi-\nabla^{2}\phi+\frac{m^{2}}{c^{2}}\phi=0\]
Eliminate \(\pi\) to recover the Klein–Gordon wave equation, confirming equivalence. A
\[\mathcal{H}=\tfrac12\pi^{2}+\tfrac12 c^{2}(\nabla\phi)^{2}+\tfrac12 m^{2}\phi^{2},\qquad \frac{1}{c^{2}}\ddot\phi-\nabla^{2}\phi+\frac{m^{2}}{c^{2}}\phi=0\]

Reading. The three energy-density pieces are the momentum (kinetic), the gradient (elastic), and the mass (potential) contributions; the pair of first-order Hamilton equations reproduces exactly the second-order Klein–Gordon equation.

Units check. With \([\phi]=\mathrm{kg^{1/2}\,m^{-1/2}\,s^{-1}}\) chosen so \([\tfrac12\dot\phi^2]=\mathrm{J\,m^{-3}}\), each term of \(\mathcal{H}\) is \(\mathrm{J\,m^{-3}}\): \([\pi^2]=[\dot\phi]^2\) matches, \([c^2(\nabla\phi)^2]=\mathrm{m^2 s^{-2}}\cdot[\phi]^2\mathrm{m^{-2}}=[\dot\phi]^2\), and \([m^2\phi^2]\) with \([m]=\mathrm{s^{-1}}\) (Compton frequency) matches likewise.

1
\[\mathcal{L}=\tfrac12\sigma\,\dot u^{2}-\tfrac12 T\left(\frac{\partial u}{\partial x}\right)^{2}\]
Transverse vibrations of a stretched string: \(u(x,t)\) displacement, \(\sigma\) linear mass density, \(T\) tension (a 1+1 field). Take \(\sigma=0.020\ \mathrm{kg\,m^{-1}}\), \(T=80\ \mathrm{N}\). A
2
\[\pi=\frac{\partial\mathcal{L}}{\partial\dot u}=\sigma\dot u\ \Rightarrow\ \dot u=\frac{\pi}{\sigma}\]
Momentum density conjugate to the string displacement. A
3
\[\mathcal{H}=\pi\dot u-\mathcal{L}=\frac{\pi^{2}}{\sigma}-\left(\frac{\pi^{2}}{2\sigma}-\tfrac12 T u_{x}^{2}\right)=\frac{\pi^{2}}{2\sigma}+\tfrac12 T u_{x}^{2}\]
Legendre transform, with \(u_x\equiv\partial u/\partial x\). A
4
\[\dot u=\frac{\delta H}{\delta\pi}=\frac{\pi}{\sigma},\qquad \dot\pi=-\frac{\delta H}{\delta u}=T\,u_{xx}\ \Rightarrow\ \sigma\ddot u=T\,u_{xx}\]
Hamilton's equations give the wave equation with speed \(v=\sqrt{T/\sigma}\). B
5
\[v=\sqrt{\frac{T}{\sigma}}=\sqrt{\frac{80}{0.020}}=\sqrt{4000}=63.2\ \mathrm{m\,s^{-1}}\]
Insert the numbers into the wave speed read off from step 4. A
6
\[\text{For }u(x,t)=A\sin(kx)\cos(\omega t),\ A=3.0\ \mathrm{mm},\ k=\pi/L,\ L=0.65\ \mathrm{m}:\ \langle\mathcal{H}\rangle_{\text{peak, }x}=\tfrac14 T A^{2}k^{2}\]
Peak (in time) energy density averaged over a wavelength for a standing mode; evaluate the elastic term at maximum. C
7
\[k=\frac{\pi}{0.65}=4.83\ \mathrm{m^{-1}},\quad \tfrac14 T A^{2}k^{2}=\tfrac14(80)(3.0\times10^{-3})^{2}(4.83)^{2}=4.2\times10^{-3}\ \mathrm{J\,m^{-1}}\]
Numerical energy per unit length; note in 1D \([\mathcal H]=\mathrm{J\,m^{-1}}\). B
\[\mathcal{H}=\frac{\pi^{2}}{2\sigma}+\tfrac12 T u_{x}^{2},\qquad v=\sqrt{T/\sigma}=63\ \mathrm{m\,s^{-1}},\qquad \tfrac14 TA^2k^2\approx4.2\ \mathrm{mJ\,m^{-1}}\]

Reading. The Hamiltonian density of a string is kinetic (momentum) plus elastic (stretching) energy per unit length; Hamilton's equations return the familiar wave equation and its speed, and the standing-mode energy density scales as \(TA^2k^2\).

Units check. \([\pi^2/2\sigma]=(\mathrm{kg\,m^{-1}\,s^{-1}}\cdot\dot u)^2/(\mathrm{kg\,m^{-1}})\); with \([\pi]=[\sigma\dot u]=\mathrm{kg\,s^{-1}}\), \([\pi^2/\sigma]=\mathrm{kg\,s^{-2}}=\mathrm{J\,m^{-1}}\). \([T u_x^2]=\mathrm{N}\cdot(\text{dimensionless})^2=\mathrm{J\,m^{-1}}\), matching. \([v]=\sqrt{\mathrm{N}/(\mathrm{kg\,m^{-1}})}=\sqrt{\mathrm{m^2 s^{-2}}}=\mathrm{m\,s^{-1}}\).

Problems
  1. For a free real scalar with \(\mathcal{L}=\tfrac12\dot\phi^2-\tfrac12(\nabla\phi)^2-\tfrac12 m^2\phi^2\) (natural units), write down \(\pi\), \(\mathcal{H}\), and verify \(\{\phi(\mathbf{x}),\pi(\mathbf{y})\}=\delta^3(\mathbf{x}-\mathbf{y})\) reproduces \(\dot\phi=\pi\).
    Solution\(\pi=\partial\mathcal{L}/\partial\dot\phi=\dot\phi\); \(\mathcal{H}=\pi\dot\phi-\mathcal{L}=\tfrac12\pi^2+\tfrac12(\nabla\phi)^2+\tfrac12 m^2\phi^2\). Then \(\dot\phi=\{\phi,H\}=\int d^3y\,\{\phi(\mathbf x),\pi(\mathbf y)\}\,\delta H/\delta\pi(\mathbf y)=\int d^3y\,\delta^3(\mathbf x-\mathbf y)\pi(\mathbf y)=\pi(\mathbf x)\). Consistent with \(\pi=\dot\phi\).
  2. A field has \(\mathcal{L}=\tfrac12 f(\phi)\dot\phi^2-V(\phi)\) with \(f(\phi)>0\). Find \(\pi\), invert for \(\dot\phi\), and show \(\mathcal{H}=\pi^2/(2f(\phi))+V(\phi)\).
    Solution\(\pi=\partial\mathcal L/\partial\dot\phi=f(\phi)\dot\phi\Rightarrow\dot\phi=\pi/f(\phi)\) (invertible since \(f>0\)). \(\mathcal H=\pi\dot\phi-\mathcal L=\pi\cdot\frac{\pi}{f}-\left(\tfrac12 f\frac{\pi^2}{f^2}-V\right)=\frac{\pi^2}{f}-\frac{\pi^2}{2f}+V=\frac{\pi^2}{2f(\phi)}+V(\phi)\). The kinetic term is not simply \(\tfrac12\pi^2\), illustrating that \(\pi\neq\dot\phi\) in general.
  3. Show that for a Lagrangian density with no explicit time dependence, \(dH/dt=0\), where \(H=\int d^3x\,\mathcal H\) and the fields obey Hamilton's equations. Assume fields vanish at infinity.
    Solution\(\dot H=\int d^3x\left(\frac{\delta H}{\delta\phi}\dot\phi+\frac{\delta H}{\delta\pi}\dot\pi\right)=\int d^3x\left(\frac{\delta H}{\delta\phi}\frac{\delta H}{\delta\pi}+\frac{\delta H}{\delta\pi}\left(-\frac{\delta H}{\delta\phi}\right)\right)=0\), using \(\dot\phi=\delta H/\delta\pi\), \(\dot\pi=-\delta H/\delta\phi\). Equivalently \(\dot H=\{H,H\}=0\). Boundary terms from the \(\nabla\phi\) integration by parts vanish by the assumption. Energy is conserved.
  4. For the string of Worked Example 2 with \(\sigma=0.020\ \mathrm{kg\,m^{-1}}\), \(T=80\ \mathrm{N}\), \(L=0.65\ \mathrm{m}\), find the fundamental angular frequency \(\omega_1\) and its ordinary frequency \(f_1\).
    Solution\(v=\sqrt{T/\sigma}=\sqrt{80/0.020}=63.2\ \mathrm{m\,s^{-1}}\). Fundamental \(k_1=\pi/L=\pi/0.65=4.83\ \mathrm{m^{-1}}\). \(\omega_1=vk_1=63.2\times4.83=305\ \mathrm{rad\,s^{-1}}\). \(f_1=\omega_1/2\pi=305/6.283=48.6\ \mathrm{Hz}\). (Equivalently \(f_1=v/2L=63.2/1.30=48.6\ \mathrm{Hz}\).)
  5. Electromagnetism has \(\mathcal{L}=-\tfrac14 F_{\mu\nu}F^{\mu\nu}\). Compute \(\pi^0=\partial\mathcal{L}/\partial\dot A_0\) and explain why the standard Legendre transform breaks down.
    Solution\(F_{\mu\nu}=\partial_\mu A_\nu-\partial_\nu A_\mu\) is antisymmetric, so \(F_{00}=0\) and \(\mathcal L\) contains no \(\dot A_0=\partial_0 A_0\) term (it would need \(F_{00}\)). Hence \(\pi^0=\partial\mathcal L/\partial\dot A_0=0\). This is a primary constraint: \(\dot A_0\) cannot be solved for in terms of \(\pi^0\), the Hessian \(\partial^2\mathcal L/\partial\dot A_\mu\partial\dot A_\nu\) is singular (rank 3, not 4), and one must use Dirac's constrained-Hamiltonian method. The constraint \(\pi^0\approx0\) generates a secondary constraint \(\nabla\!\cdot\!\mathbf E\approx0\) (Gauss's law), and \(A_0\) is a Lagrange multiplier / gauge variable rather than a dynamical field.