In the case of field however, we can expand the Lagrangian out further, to also integrate over the space coordinates and their derivatives.
Since we are now working with something that gets integrated over space to obtain the total action, much like density would be integrated over space to obtain a total mass, the name "Lagrangian density" is fitting.
Of course, if we were to write it like that all the time we would go mad, so we can just write a much more condensed vectorized version using the gradient with :
And in the context of special relativity, people condense that even further by adding to the spacetime Four-vector as well, so you don't even need to write that separate pesky .
The main point of talking about the Lagrangian density instead of a Lagrangian for fields is likely that it treats space and time in a more uniform way, which is a basic requirement of special relativity: we have to be able to mix them up somehow to do Lorentz transformations. Notably, this is a key ingredient in a/the formulation of quantum field theory.
Articles by others on the same topic
A Lagrangian density assigns a local action contribution to field values and their derivatives. Integrating over spacetime gives . For a real scalar in flat spacetime with signature , a simple density is .
Varying the field gives , 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.