Lagrangian Density and Continuum Lagrangian Formalism
In particle mechanics the configuration of a system at an instant is a finite set of generalized coordinates , and the Lagrangian is a single function whose time integral is the action. Many physical systems, however, are most naturally described by a continuous degree of freedom at every point of space: the transverse displacement of a string, the density of a gas, the components of the electromagnetic potential. Such a system has an uncountable infinity of degrees of freedom, one for each spatial point, and the discrete index is replaced by a continuous label . The continuum Lagrangian formalism is the systematic extension of Hamilton's principle to this case. The central object is the Lagrangian density , a function of the field , its time derivative , its spatial derivatives (and in higher dimensions ), and possibly the coordinates explicitly. The total Lagrangian is , and the action is the spacetime integral . The appearance of spatial gradients in is the new ingredient: it encodes the coupling between neighbouring field values, which in the discrete picture came from springs linking adjacent masses. Requiring the action to be stationary under variations that vanish on the boundary produces the field Euler–Lagrange equations — partial differential equations rather than ordinary ones. The price of treating space and time symmetrically is PDEs; the reward is a single variational framework that handles waves, elastic media, and ultimately relativistic fields. Historically and pedagogically, the continuum Lagrangian is best understood as the limit of a discrete chain — the loaded string — which makes manifest that is a true density and that the gradient term descends from spring stretching energy.
- For a system with infinitely many degrees of freedom — a field — the discrete Lagrangian becomes a spatial integral of a Lagrangian density , and the action is .
- The density depends not only on the field and its time derivative but also on its spatial gradients, treating space and time on a more even footing.
- Hamilton's principle , applied to the field, yields the field Euler–Lagrange equations — partial differential equations governing .
- The canonical example is the stretched string, whose density produces the one-dimensional wave equation with .
- The formalism arises rigorously as the continuum limit of a discrete loaded string and generalizes naturally to relativistic field theory, where is a Lorentz scalar built from four-vectors.
- Symmetries of give conservation laws (Noether), and a Legendre transform of defines the Hamiltonian density and canonical field momentum.
- Key idea: Replace the discrete index by a continuous coordinate: , , . The Lagrangian density depends on the field, its time derivative, AND its spatial gradient — the gradient term being the continuum residue of nearest-neighbour coupling — and Hamilton's principle becomes a field PDE.
Where this lives today
The single most computationally intensive use of a Lagrangian density in 2026 is lattice quantum chromodynamics: to compute hadron masses from first principles, the QCD action is discretized on a spacetime grid — deliberately running Derivation B in reverse — and sampled on exascale machines. The continuum limit that this article performs analytically for a string is performed numerically there, with the same anxieties about what must be held fixed as the spacing shrinks. Meanwhile, effective field theory has turned the Lagrangian density into an organizing principle for ignorance: gravitational-wave groups match LIGO–Virgo signals against post-Newtonian actions, and machine-learning groups now fit symbolic Lagrangian densities directly to field data, with the fitted as the interpretable output. For the student the density is the gateway object: everything in this chapter — the wave equation, Hamiltonian field theory, elasticity — and everything beyond it in the action-principle-to-QFT capstone is a choice of fed through the same Euler–Lagrange crank.
The physical picture
Picture a chain of beads connected by springs. Each bead is a degree of freedom with its own kinetic energy, coupled to its neighbours by spring potential energy that depends on the DIFFERENCE of adjacent displacements. As you pack the beads infinitely densely, the difference becomes a derivative , the sum becomes an integral, and the per-bead Lagrangian becomes a per-length density. The spatial gradient in is literally the memory of those springs. This is not an analogy: the companion article on the loaded string performs the limit line by line, and everything below is its payoff.
Think of as the elementary contribution to the action from a tiny spacetime cell. Stationarity of the total action means the field arranges itself so that, locally, no infinitesimal wiggle changes to first order — this local condition, integrated over the cell with the boundary terms thrown away, IS the field equation. Field theory is Hamilton's principle democratized over space: every cell votes, and the equation of motion is the unanimous verdict.
The formalism puts and on a similar footing inside , which is why it is the natural language for waves and for relativity: a Lorentz boost mixes space and time derivatives, and a density that is a scalar function of is automatically frame-independent.
The core equations
Everything in the continuum formalism flows from a single functional. Where particle mechanics integrates over time alone, field mechanics assigns an action contribution to every spacetime cell, so the action becomes a double (in 3D, quadruple) integral. This is the master object; every equation below is extracted from it.
where: — action functional of the field configuration; — Lagrangian density (energy per unit volume in 3D, per unit length in 1D); — the field, the value of the dynamical variable at each spacetime point; — time derivative of the field (analogue of ); — spatial gradient of the field (new compared to particle mechanics). Note that and enter as integration labels, not as dynamical variables — the field is the only thing that gets varied. The translation between the discrete and continuum descriptions is a strict dictionary, established term by term in the loaded-string article. Keeping it in view prevents the most common conceptual error — treating as a coordinate to be varied.
where: — the ordinary Lagrangian, recovered by integrating the density over space at fixed time; — discrete generalized coordinate, replaced by the field; — continuous label that replaces the discrete index . The ordinary Lagrangian still exists at every instant; the density is simply its local bookkeeping. Demanding for all variations that vanish on the boundary yields the central dynamical statement of the whole subject — the field Euler–Lagrange equation. Compared with the particle version (owned by the Euler–Lagrange article at finite degrees of freedom, which this equation generalizes), one new term appears: the divergence of the derivative of with respect to the gradient. It is derived as Derivation A below.
where: — canonical momentum density conjugate to ; — momentum-flux (stress) contribution from the gradient; — generalized force density. Read physically: the rate of change of local momentum plus the divergence of the local stress equals the local force — Newton's second law written for a cell of the medium. The prototype density, extracted from the loaded string in Derivation B, is the stretched string. It is worth memorizing because every other classical field density is a decoration of this template: a kinetic term quadratic in minus a stiffness term quadratic in gradients.
where: — mass per unit length; — tension; — transverse velocity; — local slope; — stretching potential per unit length, valid to quadratic order in the slope. Feeding (4) into (3) takes three lines: , , and , so the field equation reads . For constant and this is the one-dimensional wave equation — the full solution theory lives in the companion wave-equation article.
where: — wave speed on the string; — curvature of the string profile. Stiffer (larger ) means faster; heavier (larger ) means slower — the template scaling for every restoring-force-over-inertia wave speed in physics. The formalism does not stop at equations of motion. A Legendre transform of the density — the field version of the passage from to at finite degrees of freedom — defines the canonical momentum density and the Hamiltonian density, whose conservation is proved in Derivation C. The full canonical field theory built on these objects is the subject of the Hamiltonian-density article; here we need only the definitions.
where: — canonical momentum density conjugate to the field ( times displacement units in 1D — a density, not a momentum); — Hamiltonian (energy) density obtained by the Legendre transform. For the string, and — the sum, not the difference, of kinetic and potential densities. Finally, the payoff that motivates the whole construction: if is built as a Lorentz scalar from the four-gradient, the action is frame-independent because the measure is too. This is the doorway from mechanics to relativistic field theory, walked through in the action-principle-to-QFT capstone.
where: — four-gradient ; — contravariant four-gradient with metric ; — scalar potential, e.g. giving the Klein–Gordon equation. The string density (4) is the -dimensional, shadow of this structure.
Which equation when:
| You want | Use | Because |
|---|---|---|
| Equation of motion for a given medium | (3) with the medium's | The field EL equation is the universal crank |
| To construct from a microscopic model | Continuum limit, Derivation B | Densities inherit their meaning from the discrete chain |
| Energy bookkeeping, canonical structure | (6), then Derivation C | Legendre transform hands you and |
| A relativistic or frame-independent theory | (7) | Scalar + invariant measure = invariant action |
We derive the field equation (3) by demanding that the action (1) be stationary under an arbitrary infinitesimal deformation of the field. The strategy mirrors the finite-dimensional proof in the Euler–Lagrange article — vary, integrate by parts, invoke arbitrariness of the variation — but with two integration-by-parts moves instead of one, because now depends on spatial gradients as well as the time derivative. The step to watch is the disposal of boundary terms: the variation must vanish on the entire boundary of the spacetime region, both at the initial and final times AND at the spatial edges.
Step 1. Deform the field by with on the boundary of the integration region, and expand the density to first order:
Why: is an ordinary function of its slots ; the chain rule distributes the variation across all three dependences.
Step 2. Commute variation and differentiation:
Why: is a difference of two field configurations evaluated at the SAME spacetime point, so derivatives with respect to the labels pass through it freely.
Step 3. Integrate the second term by parts in and the third term by parts in (divergence theorem in 3D). The boundary contributions are and the flux of through the spatial boundary; both vanish because there. What survives is
Why: integration by parts moves the derivative off and onto the conjugate quantity at the cost of a sign — exactly the manoeuvre of the particle case, done once per independent variable.
Step 4. The deformation is arbitrary in the interior. A vanishing integral against an arbitrary function forces the bracket to vanish pointwise:
Why: choose to be a sharply localized bump at any point; the integral then samples the bracket there, so the bracket must vanish everywhere — the fundamental lemma of the calculus of variations, upgraded to spacetime. *Two quick checks confirm the result: setting the -dependence to zero collapses equation (3) to the familiar particle Euler–Lagrange equation, and applying it to the string density (4) reproduces the wave equation (5).*
Go deeper · Derivation B · 1 minContinuum limit of the loaded string defines the Lagrangian density
We take equal masses on a taut chain, write the discrete Lagrangian, and let the spacing to obtain the density . The strategy is to multiply and divide by the spacing until the sum looks like a Riemann sum, then hold the macroscopic quantities — mass per length and tension — fixed as and vanish together. The trap to avoid: sending at fixed (or vice versa) destroys the physics, because the wave speed would diverge or vanish.
Step 1. Write the discrete Lagrangian for masses at nodes with nearest-neighbour spring constant :
Why: kinetic energy of each mass minus the spring energy stored in stretching between neighbours — the standard coupled-oscillator Lagrangian from the normal-modes chapter.
Step 2. Multiply and divide by to expose the densities:
Why: is finite mass per length and is the tension; the difference quotient is engineered to become a derivative.
Step 3. Take at fixed and :
Why: the sum over cells of width is a Riemann sum for the spatial integral; the label merges into the continuous label .
Step 4. Read off the density:
Why: the gradient term is the direct descendant of the spring energy — nearest-neighbour coupling has become a local penalty on slope. *Dimensional check: carries units (kg/m)(m/s)² = J/m, and carries units (N)(dimensionless)² = J/m; both terms are energy per unit length, confirming that is a genuine 1D density.*
Go deeper · Derivation C · 1 minEnergy density by Legendre transform and its local conservation
We define the canonical momentum density and Hamiltonian density for the string and show that energy is conserved locally — not just globally — obeying a continuity equation with an identifiable energy flux. The strategy is the field version of : Legendre-transform the density, then differentiate along solutions and use the equation of motion to reorganize the result into a total spatial derivative. Watch the sign flip that turns into .
Step 1. Canonical momentum density from the string Lagrangian (4):
Why: only the kinetic term contains ; the field momentum density is mass density times transverse velocity, exactly the discrete per unit length.
Step 2. Legendre transform:
Why: the transform flips the sign of the potential piece — the Hamiltonian density is the physical energy density, kinetic plus potential.
Step 3. Differentiate along a solution and eliminate with the wave equation :
Why: the equation of motion is the only dynamical input; energy conservation is a consequence of the dynamics, not an independent postulate.
Step 4. Recognize a total spatial derivative:
Why: is exactly by the product rule; the combination is the power transmitted along the string — the transverse component of tension, , times the transverse velocity .
Step 5. The continuity equation integrates over a closed or clamped string to : total energy is constant, and locally energy moves at a computable flux. Two checks are worth noting: is positive-definite (a sum of squares), as a physical energy density must be; and the flux has units (N)(dimensionless)(m/s) = W, a genuine power. The local conservation law is the Noether consequence of time-translation invariance of .
Limiting cases
The continuum density reduces to or connects with familiar structures in several limits:
| Case | Result | Meaning |
|---|---|---|
| Discrete limit | Reversing the continuum limit (spacing , mass , spring ) recovers the loaded-string Lagrangian — the discrete origin. | |
| No gradient coupling | If is absent, each point oscillates independently — a continuum of uncoupled oscillators; the EL equation has no spatial propagation. | |
| Relativistic scalar | A manifestly Lorentz-scalar density gives the Klein–Gordon equation; the string is its , -dimensional cousin. | |
| Static field | For time-independent configurations Hamilton's principle becomes an energy-minimization problem (elastostatics, electrostatics). | |
| Stiff term added | Higher spatial derivatives (beam bending) are allowed in ; the EL equation then acquires fourth-order terms — see the FAQ. |
Worked examples
Example 1 — energy stored in a plucked guitar string (confidence builder). A steel high-E guitar string has length , linear density , and is tuned to its fundamental . Find the tension, then the total energy when the string vibrates in its fundamental standing mode with amplitude .
Step 1. The fundamental of a clamped string satisfies , so the wave speed is .
Step 2. From , the tension is — about 10 kg-force, which is why guitar necks need truss rods.
Step 3. The energy density is . Integrate over the string. With and (the dispersion relation), both terms combine to a time-independent total
Step 4. With : . Compute inside out: ; times gives ; times gives ; times gives ; divided by 4:
— under half a millijoule, which is why a guitar needs a resonant body to move audible amounts of air.
Example 2 — dispersion from a modified density (exam level). A string with and rests on an elastic (Winkler) foundation that pushes back locally, adding a potential density with . Find the field equation, the dispersion relation, and the phase and group velocities at .
Step 1. The density is . Now no longer vanishes, and the EL equation (3) gives
Step 2. Insert a plane wave : each derivative pulls down a factor, giving , i.e. the dispersion relation
This is formally the Klein–Gordon dispersion: the foundation gives the string wave a "mass" and a cutoff frequency below which no travelling wave exists.
Step 3. At : , so . The phase velocity is — FASTER than .
Step 4. The group velocity is — slower than .
Check: exactly, the signature identity of Klein–Gordon-type dispersion. The medium is dispersive: energy travels at while crests travel at .
Origins · 1 minJoseph-Louis Lagrange and how this was discovered
Lagrange met the continuum through the discrete: his 1759 analysis of a weighted string solved the -body chain exactly and watched the solution survive the passage — the template this article still follows. Three decades later the Mécanique analytique rebuilt all of mechanics on the variational principle without a single diagram, boasting "no figures will be found in this work." That austerity was the point: once dynamics is an integral to be made stationary, the same machinery serves a bead, a chain, or a continuous medium — one only swaps the sum for an integral. The Lagrangian density that now underwrites everything from elasticity to the Standard Model carries his name because he built the mould into which every later field theory was poured.
Going further
References. Goldstein, Poole & Safko, Classical Mechanics 3rd ed., Ch. 13 (The Classical Field Theory) · Landau & Lifshitz, Mechanics Vol. 1, 3rd ed., §23 (oscillations of systems with more than one degree of freedom — the discrete precursor to the continuum limit; L&L treat field Lagrangians in later volumes) · Morin, Introduction to Classical Mechanics, Ch. on coupled oscillators and the continuum string · Taylor, Classical Mechanics, Ch. 16 (Continuum Mechanics) Three internal consistency checks underpin this article: (1) each term in is energy per unit length — and both carry units J/m; (2) the Legendre transform yields together with the local energy continuity equation; (3) the relativistic density produces the Klein–Gordon equation when fed through the field Euler–Lagrange equation (3). No empirical constants are quoted; all relations are standard.
Builds on: Discrete Loaded String and the Continuum Limit · Euler–Lagrange Equations for Fields · Normal Modes and Standing Waves on a String Leads to: The One-Dimensional Wave Equation · Hamiltonian Density and Canonical Field Momentum · Elastic Waves in Solids · Four-Vectors and Minkowski Spacetime
Why am I allowed to treat the field, its time derivative, and its gradient as independent arguments of the density when they are obviously related?
For the same reason and are treated as independent slots of : the density is a function whose arguments only get filled with a specific and its derivatives after the variation is done. When you vary the action, you deform the whole configuration , and the variations of the slots are then not independent — they are linked by , which is exactly what Steps 2–3 of Derivation A use. Independence of slots is a statement about the function , not about the physics of any particular solution.
Is the canonical momentum density actually a momentum? Its units look wrong.
It is not the mechanical momentum of anything, and for the transverse string it is not even directed along the string. has units of momentum per unit length (kg/s in 1D, since carries metres), and it is conjugate to the field value, not to a particle position. The mechanical momentum carried by a wave along the propagation direction is a different object, built from the stress tensor. Confusing the two is a classic exam trap; the Hamiltonian-density article draws the distinction carefully.
Where exactly did the boundary terms go in the derivation, and what happens on an infinite domain?
Two boundary terms appear: a temporal one, , killed by the standard variational convention that the configuration is pinned at the initial and final instants, and a spatial one — the flux of through the region's edge — killed either by clamped ends ( there) or, on an infinite domain, by requiring fields to decay fast enough at infinity. On domains with free ends, that spatial term does not vanish automatically; demanding it vanish for arbitrary boundary yields the natural boundary condition — the free-end condition of the standing-waves article. Boundary terms are physics, not debris.
Is the Lagrangian density unique for a given physical system?
No. Adding a total derivative (a four-divergence in covariant language) to changes the action only by boundary contributions, which the variation never sees, so the field equations are unchanged. Densities related this way are physically equivalent even though and can look different at intermediate stages. This freedom is used constantly — to make symmetries manifest, to move derivatives around, and in gauge theories where no single "natural" exists.
Do I need relativity for any of this? My course introduced Lagrangian densities together with four-vectors.
No — the string density is Galilean, and elasticity, acoustics, and shallow-water theory all run on non-relativistic Lagrangian densities. Relativity enters only when you choose to be a Lorentz scalar, as in equation (7); the formalism itself is indifferent. The reason courses couple the two is strategic: the field EL equation is the one classical structure that survives verbatim into relativistic QFT, so it is taught as the on-ramp. That on-ramp is the action-principle-to-QFT article.
What if the density depends on second derivatives, like the curvature of a beam?
Then the Euler–Lagrange machinery extends: varying requires integrating by parts twice on the slot, producing a term in the field equation and a fourth-order PDE. The Euler–Bernoulli beam, with bending energy , yields — dispersive, unlike the string. In fundamental physics, higher time derivatives are avoided (they generically produce Ostrogradsky instabilities), but higher spatial derivatives in effective descriptions are routine.
How does the functional derivative notation relate to the Euler-Lagrange combination?
The functional derivative measures the change of per unit change of the field at the single point . Carrying out the same integration by parts as Derivation A shows , so the field equation is compactly — Lagrange's equation with straight replaced by curly . The continuum formalism is the finite-dimensional one with a better index set.
Why is the potential energy of the string quadratic in the slope rather than proportional to the actual stretching?
The exact stretching of an element is for small slopes, and tension times stretch gives per unit length. The quadratic form is thus the leading term of an expansion, valid when . Keeping the full square root gives a nonlinear field theory whose small-amplitude limit returns the wave equation — one reason the Lagrangian route is preferred: approximating one scalar function once is cleaner than approximating forces in three places.