In the case of fields 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.
E.g. for a 2-dimensional field :
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.
- Yang-Mills existence and mass gap | 374, 374, 1