Lagrangian density (source code)

= Lagrangian density
{title2=$\mathcal L$}

A Lagrangian density assigns a local action contribution to field values and their derivatives. Integrating over spacetime gives $S=\int d^dx\,\mathcal L$. For a real scalar in flat spacetime with signature $(+---)$, a simple density is $\mathcal L=\tfrac12\partial_\mu\phi\partial^\mu\phi-V(\phi)$.

Varying the field gives $\Box\phi+V'(\phi)=0$, illustrating how the density encodes propagation and forces. Continuous symmetries yield <Noether currents> under the appropriate variational assumptions. The Lagrangian density is not generally the energy density: temporal and spatial derivative terms combine differently in the Hamiltonian. Adding a total derivative leaves the bulk equations unchanged under compatible boundary conditions, though boundary contributions and canonical expressions can change.