In optics, the principle of least action basically states that you can formulate the theory by way of a mathematical expression called the “action”, and that the equations of motion of the theory will be those equations that minimize this action. (Fermat’s principle tells you that light follows the path of least time between two points. Same principle, just a more restricted application.)
Now in practice, this “action” usually appears in the form of an integral, and under the integral sign, there is the expression that will need to be minimized as the system evolves from an initial to a final state. This expression under the integral sign is called the Lagrange-functional (functional because it acts on a set of functions, describe the system’s generalized positions and velocities, and produces a number) or, in short, Lagrangian.
This approach works both in classical mechanics (for point particles as well as extended objects) and in classical field theory (continuous mediums). For instance, the electromagnetic field can be specified by way of a Lagrangian; the gravitational field, too.
In the case of quantum physics, the situation is a little different, since particles have no well-defined trajectories. However, it turns out that the Lagrange-functional is closely related to the phase of the wavefunction that describes a quantum particle, and that ultimately, what the wavefunction does is again very similar to what light does as it obeys Fermat’s principle. Finally, modern particle physics is really not particle physics at all, but the physics of quantum fields. These fields, too, are specified in the form of Lagrange-functionals that are then “quantized” according to a set of procedures that, in essence, decompose the field into a sum of pure frequencies, each of which will have an operator-valued coefficient that will have discrete states corresponding to the notion of a particle. But the starting point is still the Lagrangian that defines the theory.
When a physicist looks at a Lagrangian, he can usually tell just by looking at it what kind of entities the Lagrangian describes and what kind of interactions these entities have. Whether it is the Lagrangian that describes, say, a classical charged particle and an electromagnetic field, the Lagrangian of a metric theory of gravity, or the Lagrangian of interacting scalar, spinor and vector fields in a quantum field theory, the Lagrangian reveals a lot, at least qualitatively, to the experienced physicist simply through its appearance (e.g., the nature of the interaction terms, their coefficients, etc.)
Lagrangian is a function which encodes the dynamics of the system of interest.
- The equations of motion (or field equations) are derived from Lagrangian by partial derivatives. Hence, once you know the Lagrangian, you can derive the equations of motion.
- Typically, Lagrangian is a sum of two parts. Part which is quadratic in field variables (and their derivatives) governs the free fields, i.e. fields which do not interact. (Indeed: by differentiating a quadratic term with respect to field variable you obtain a linear term; linear equations describe non-interacting systems).
- Lagrangian is covariant, which means it fulfills the requirement of general (special) relativity that the equations of motion do not depend on the choice of the coordinates. In other words, Lagrangian treats spatial and temporal coordinates on equal footing. If you know what are the field variables (e.g. scalar field ϕϕ and its spacetime derivatives ∂μϕ∂μϕ), usually there are not many ways how to construct a Lagrangian that is both quadratic and invariant. For example, for the scalar field there are just two possibilities, ϕ2ϕ2 and (∂μϕ)(∂μϕ)(∂μϕ)(∂μϕ). Hence, the requirement that the Lagrangian is invariant significantly restricts possible forms of the Lagrangian and often you can guess the correct Lagrangian describing the system whose equations of motion you do not know. It is much easier than to guess the equations of motion directly.
- If you add an additional requirement, it’s even better. For example, in particle physics there is an important principle of gauge invariance. The Lagrangian for the (complex) scalar field has a certain kind of a global symmetry: if you change the phase of the scalar field, the Lagrangian does not change. If you insist that this symmetry be local (i.e. the phase can vary from the point to point), you have to add new terms to the Lagrangian which will ensure that symmetry. As a miracle, it turns out that these new terms are quite uniquely determined and they describe the electromagnetic field and interaction of the EM field with the scalar field. Hence, the requirement of local gauge invariance is so strong that even if you start with free scalar field (whose Lagrangian is dictated by the Lorentz symmetry), you end up with interacting system of scalar+EM field. Without the Lagrangian formalism, it is very hard to guess the right equations of motion but in Lagrangian formalism you get it (almost) for free.
- Lagrangian is covariant but often you need to select a preferred time direction so that you can study the time evolution of your field. By selecting a time, you brake the Lorentz invariance but it allows you to define a Hamiltonian (which is a Legendre transformation of the Lagrangian) which corresponds to the energy of the field. This is what you need in particle physics: find the Hamiltonian operator and quantize the field in order to get the particle interpretation. This is more subtle if you require general covariance of the theory (i.e. invariance under general diffeomorphism/coordinate transformation). For example, the Hamiltonian of gravitational field turns out to be zero. That’s a consequence of the fact that gravity is heavily constrained system and in this case we have to regard the Hamiltonian as a generator of the gauge transformation, but that is another story. The point is that Lagrangian is a natural tool to construct the energy for a given system.
These are the advantages of the Lagrangian formalism. In fact, all modern physics is based on it. There are however also some “difficulties” or conceptually problematic points. Lagrangian for a given system is not unique. You can add to it arbitrary terms of a specific form (total derivatives of arbitrary functions or, in turn, terms which enter the action only as boundary terms). Such terms do not play a role classically but they can affect the quantization of the fields and sometimes they lead to ambiguities. In general relativity, even classically, such boundary terms play a role in the definition of energy of gravitational field.