A Lagrangian is a mathematical function used to formulate the dynamics of a physical system through a variational principle. In classical mechanics, it usually depends on coordinates, velocities, and time; integrating it over time produces the action, whose stationary paths determine the equations of motion. In field theory, the corresponding local quantity is a Lagrangian density. The name honors Joseph-Louis Lagrange, whose Mécanique analytique appeared in 1788. In mathematical optimization, “Lagrangian” also denotes a function combining an objective with weighted constraints. (mitp-content-server.mit.edu)
Mechanical definition
For a system described by generalized coordinates , the usual mechanical Lagrangian has the form
where . Generalized coordinates need not be Cartesian positions: angles, distances, or other independent variables may describe the system’s configuration. They can incorporate geometric constraints, reducing the description to its independent degrees of freedom. (mitp-content-server.mit.edu)
For many nonrelativistic systems with conservative forces, the standard choice is
with the kinetic energy and the potential energy. This expression is important but is not a universal definition. Velocity-dependent interactions, relativistic dynamics, and other theories require more general forms. A mechanical Lagrangian conventionally has the dimensions of energy, although its value is not generally the total energy. (underactuated-r1.csail.mit.edu)
For example, a particle of mass moving in one dimension in a potential has
Its equation of motion is . Thus the familiar force law can be recovered from a scalar function rather than written directly as a vector equation. (damtp.cam.ac.uk)
Stationary action and equations of motion
The action associated with a candidate trajectory is
Unlike , which evaluates the system at an instant, depends on an entire path. The principle of stationary action states that physical trajectories satisfy under infinitesimal path variations that keep the endpoint configurations fixed. “Stationary” means that the first-order variation vanishes; the action need not attain a minimum. (mitp-content-server.mit.edu)
Applying the calculus of variations yields the Euler–Lagrange equations:
The coordinates and velocities are treated as independent arguments when taking the partial derivatives. For a regular Lagrangian depending on first derivatives, these are ordinarily second-order differential equations. Additional nonconservative generalized forces may be included on the right-hand side. (damtp.cam.ac.uk)
The Lagrangian is not unique. Replacing it by
changes the action only by . With fixed endpoints, this contribution does not affect the variation, so gives the same equations of motion. (mitp-content-server.mit.edu)
Momenta, energy, and symmetries
The momentum conjugate to is defined by
It need not equal mass times velocity. If is independent of a particular coordinate , the Euler–Lagrange equation gives ; that coordinate is called cyclic or ignorable. (damtp.cam.ac.uk)
When the momentum–velocity relations can be inverted, a Legendre transform gives the classical Hamiltonian:
The velocities are then expressed in terms of . Hamiltonian mechanics describes evolution in phase space using coordinates and momenta. Singular momentum–velocity relations require a constrained treatment rather than this straightforward inversion. (damtp.cam.ac.uk)
Along solutions,
so the Hamiltonian is conserved when the Lagrangian has no explicit time dependence. For ordinary systems with a time-independent potential and a kinetic energy quadratic in velocities, . More generally, Noether’s theorem connects continuous symmetries of the action with conservation laws: time translations yield energy conservation, spatial translations momentum conservation, and rotations angular-momentum conservation. (damtp.cam.ac.uk)
Fields and quantum theory
For fields , a Lagrangian density specifies dynamics locally:
For a density depending on fields and their first derivatives, variation gives
Here labels spacetime coordinates, and repeated indices are summed. Physicists frequently call itself “the Lagrangian,” although it is a density rather than the spatially integrated quantity. (damtp.cam.ac.uk)
Lagrangian densities are central to quantum field theory. Their terms describe field propagation, masses, and interactions, while symmetry requirements restrict their possible forms. Field theories may also be transferred to a Hamiltonian formulation for canonical quantization; an alternative connection to quantum theory uses the path-integral formulation. (damtp.cam.ac.uk)
Optimization usage
For minimizing an objective function subject to and , the optimization Lagrangian is
The coefficients are Lagrange multipliers; in the dual formulation, , while equality multipliers are unrestricted. This function is not a physical energy or action density. (web.stanford.edu)
Taking defines the dual function, which provides lower bounds on the constrained minimum. Maximizing those bounds produces Lagrangian duality. For differentiable problems, the Karush–Kuhn–Tucker conditions combine stationarity with feasibility and complementary slackness; their necessity requires appropriate constraint qualifications. In convex optimization, these conditions are sufficient for optimality, and suitable feasibility assumptions ensure strong duality. (web.stanford.edu)