Lagrangian mechanics is a formulation of classical mechanics in which the motion of a system is determined by a scalar function called the Lagrangian. Instead of resolving all forces into Cartesian components, it describes configurations using suitable coordinates and obtains their evolution from differential equations or an equivalent variational principle. For many mechanical systems, the Lagrangian is the difference between kinetic energy and potential energy, although its general definition is not restricted to this form.
Developed from eighteenth-century analytical mechanics and systematized by Joseph-Louis Lagrange, the method is particularly effective for interconnected bodies, constrained motion, and systems whose geometry suggests coordinates other than Cartesian position. It also reveals relationships that are less apparent in a direct force-based description: continuous symmetries imply conservation laws, mechanical motion has a geometric interpretation, and particle dynamics and classical field equations share a common mathematical structure.
Lagrangian mechanics is ordinarily equivalent to Newtonian mechanics when both are applied to the same system under the same assumptions. Its importance lies in its organization and generality rather than in different predictions for ordinary mechanical motion. Extensions of the framework underpin relativistic mechanics, electromagnetism, and much of modern theoretical physics.
Historical development
The origins of Lagrangian mechanics lie in several attempts to express mechanical laws through general mathematical principles. In the seventeenth century, Isaac Newton established a force-based account of motion, published in the Principia in 1687. At approximately the same period, developments in calculus made it possible to describe entire trajectories analytically. Problems involving pendulums, planetary orbits, vibrating strings, and constrained bodies increasingly required techniques that went beyond writing independent Cartesian force equations.
One important predecessor was the principle of virtual work. In a static equilibrium, the total work of the applied forces vanishes for every infinitesimal displacement compatible with the constraints, provided the constraint reactions themselves do no virtual work. Jean le Rond d’Alembert extended this reasoning to dynamics in his Traité de dynamique of 1743. By including inertial terms alongside applied forces, he expressed motion in a form resembling equilibrium. This allowed many unknown constraint reactions to disappear before the equations were solved.
A second line of development concerned variational principles. Pierre-Louis Moreau de Maupertuis advanced a principle of least action in the 1740s, while Leonhard Euler developed systematic methods for finding functions that extremize integrals. Lagrange’s work in the 1750s provided a more general analytical method for such problems. These developments formed the foundation of the calculus of variations, in which the unknown object is a function or path rather than a finite collection of numbers.
Lagrange’s Mécanique analytique, published in 1788, organized mechanics around generalized coordinates and analytical operations. Its characteristic achievement was to replace problem-specific geometric constructions with a common procedure. Once the kinetic energy, applied forces, and constraints were expressed in suitable variables, the equations of motion could be obtained systematically. The formulation did not eliminate physical modeling: choosing the coordinates, identifying the forces, and deciding which constraints are ideal remained essential steps.
The modern stationary-action presentation also reflects nineteenth-century developments. William Rowan Hamilton formulated his principle in 1834–1835 and developed the related Hamiltonian description. In 1918, Emmy Noether established a precise connection between continuous variational symmetries and conservation laws. During the twentieth century, action-based methods became central to relativity and quantum field theory. The contemporary subject therefore combines Lagrange’s analytical treatment of mechanical systems with later work on variational principles, geometry, symmetry, and fields.
Generalized coordinates and the mechanical Lagrangian
A system’s configuration space is the collection of its possible configurations. A point in this space specifies positions or orientations, but not velocities. For unconstrained point particles in three-dimensional space, Cartesian coordinates are sufficient. Independent constraints can reduce the number of coordinates required. A particle confined to a sphere, for example, needs only two angular coordinates even though its position has three Cartesian components.
Coordinates on configuration space are called generalized coordinates and are conventionally written . They may be distances, angles, or other parameters. Particle positions are expressed as
so their velocities follow by differentiation:
The explicit time dependence allows the coordinate description to incorporate moving supports or prescribed moving constraints.
For particles with fixed masses , the kinetic energy is
When the position mapping has no explicit time dependence, this becomes a quadratic form,
The coefficients constitute the mass matrix. Their dependence on configuration accounts for many coupling and inertial effects that would otherwise appear as separate force terms. For suitable independent coordinates and positive masses, the matrix is positive definite.
If the applied forces derive from a position-dependent potential , the standard mechanical Lagrangian is
For a pendulum with bob mass , length , and angle measured from the downward vertical, one convenient choice is
The fixed length has already been incorporated into the coordinate choice. The string tension therefore need not appear in the equation determining .
The expression is important but not universal. Velocity-dependent interactions, relativistic particles, and fields require more general functions. Nor is a Lagrangian unique. Adding a constant changes no equation of motion, and adding a total time derivative also leaves the fixed-endpoint variational equations unchanged. Thus, the physical content belongs to a class of equivalent Lagrangians rather than to a single algebraic expression.
Stationary action and the Euler–Lagrange equations
The action associated with a path is the time integral of its Lagrangian:
In ordinary mechanical applications, action has dimensions of energy multiplied by time. Hamilton’s principle states that the physical path makes this functional stationary under sufficiently small admissible variations that keep the endpoint configurations fixed. “Stationary” means that the first-order change vanishes; it does not necessarily mean that the action is the smallest possible value.
To obtain the equations of motion, consider neighboring paths
Differentiating the action with respect to at zero gives
An integration by parts moves the time derivative from to its coefficient. The boundary term vanishes because the endpoint variations are zero. Since the remaining variations are arbitrary, each coefficient must vanish:
These are the Euler–Lagrange equations. For a particle in Cartesian coordinates with , they reduce to , reproducing Newton’s laws of motion for a conservative force.
The derivation also establishes the importance of boundary conditions. Fixing positions at both endpoints removes the boundary contribution automatically. If endpoints are free to move, additional endpoint conditions arise. A variational problem with prescribed endpoint positions is mathematically different from an initial-value problem, although both can describe the same differential equations. In practical mechanics, an initial position and velocity usually determine a local trajectory when the equations are regular.
Stationary action should not be interpreted as a particle anticipating its destination or comparing future paths. It is a compact mathematical characterization of local differential equations. Likewise, the phrase “least action” requires caution: depending on the trajectory and time interval, a stationary path may be a local minimum or a saddle point. The vanishing of the first variation alone does not determine which case occurs.
Constraints, virtual work, and nonconservative forces
Constraints restrict either configurations or velocities. A holonomic constraint can be written as
Examples include a particle confined to a surface or two points kept at a fixed separation. When independent holonomic constraints are incorporated directly into the coordinates, fewer variables are needed. Alternatively, redundant coordinates can be retained and the constraints enforced through Lagrange multipliers.
For constraints depending only on coordinates and time, the multiplier equations take the form
together with the constraint equations themselves. The multipliers parameterize the constraint reactions. Their numerical values depend on how the constraint functions are normalized, but the resulting generalized reaction forces have physical significance. This method is useful when tensions or normal forces are required in addition to the motion.
The usual elimination of constraint reactions relies on ideality. For ideal constraints, the reactions do no work on admissible virtual displacements at a fixed time. A virtual displacement is therefore not necessarily the displacement that occurs during a small time interval. A moving constraint can transfer actual energy to a system even when its reaction does zero virtual work. A pendulum with a prescribed moving pivot illustrates this distinction.
Some velocity constraints cannot be integrated into restrictions on position alone. Such nonholonomic constraints occur in rolling without slipping. For a constraint of the form
the standard ideal Lagrange–d’Alembert formulation restricts virtual displacements by . Simply inserting the velocity constraint into an unconstrained action principle is not generally equivalent. Varying an action over velocity-constrained paths can produce different equations, often called vakonomic equations.
Forces not represented by the chosen Lagrangian appear as generalized forces:
Linear viscous damping can often be represented by a Rayleigh dissipation function , with . This is an extension of the equations of motion, not a claim that dissipative motion follows from the ordinary conservative action. Dry friction, impacts, and changing contacts generally require additional constitutive laws or nonsmooth formulations.
Pendulums, orbital motion, and small oscillations
The pendulum illustrates how a compact Lagrangian produces nonlinear dynamics. Substituting its Lagrangian into the Euler–Lagrange equation gives
For small angular amplitudes, , and the angular frequency is . The corresponding small-amplitude period is . At larger amplitudes, the approximation fails and the period increases. The nonlinearity lies in the potential rather than in any complication of the variational procedure.
Central-force motion demonstrates the value of symmetry-adapted coordinates. After separating the center-of-mass motion of two interacting bodies, their relative planar motion can be described using radius , angle , and reduced mass :
Because does not depend explicitly on , its conjugate momentum is constant:
This is the angular momentum perpendicular to the orbital plane.
The radial equation can then be interpreted using an effective potential,
The second term is the centrifugal contribution. For Newtonian gravity, , and the effective potential helps classify bound motion, escape, and circular orbits. A circular orbit occurs where , while its response to small radial perturbations depends on the curvature of the effective potential.
Coupled small oscillations provide another major application. Near a stable equilibrium, write the coordinate deviations as . To quadratic order, a conservative system has
where is the mass matrix and is the stiffness matrix. The equations are
Seeking a motion proportional to gives the generalized eigenvalue problem
Its eigenvectors specify normal modes: collective patterns in which the system oscillates at a single frequency. This approach applies to coupled pendulums, elastic structures, and molecular vibrations. It also exposes the limits of linearization. Zero-frequency modes may reflect a continuous symmetry or an unconstrained motion; negative values of indicate exponential instability rather than oscillation. At larger amplitudes, neglected higher-order terms couple modes and can produce resonances and more complicated dynamics.
Symmetry, momentum, and conservation laws
The generalized momentum conjugate to is
It need not equal a mass multiplied by the coordinate velocity. For an angular coordinate it may be an angular momentum, and in a velocity-dependent interaction it may contain an additional field contribution. Its definition follows from the structure of the Lagrangian rather than from the coordinate’s name or physical units.
A coordinate is cyclic, or ignorable, when the Lagrangian does not depend on it explicitly. The Euler–Lagrange equation then gives . This makes an appropriate coordinate choice a powerful analytical tool: a symmetry that is obscure in Cartesian coordinates may become an immediate conservation law in polar or other adapted coordinates.
Noether’s theorem generalizes this observation. Every continuous symmetry of an action, subject to the theorem’s assumptions, determines a conserved quantity along solutions. In ordinary isolated systems, spatial translation symmetry leads to conservation of linear momentum, rotational symmetry leads to conservation of angular momentum, and time-translation symmetry leads to conservation of energy. Symmetry concerns the complete physical system, including external fields and constraints. A particle in a fixed external potential need not conserve its own momentum because the environment can exchange momentum with it.
For a mechanical Lagrangian, define the energy function
Along solutions of the unforced Euler–Lagrange equations,
Thus, the absence of explicit time dependence guarantees conservation of . For a standard system with time-independent coordinates, quadratic kinetic energy, and a velocity-independent potential, this quantity is . With moving coordinates or more general interactions, its identification with physical energy requires greater care.
The action can be invariant even when the Lagrangian changes by a total derivative. For an infinitesimal fixed-time transformation , if , the conserved quantity is
The boundary contribution is therefore part of the conservation law. Transformations that also change time have a corresponding extension involving .
These distinctions are visible in electromagnetism. For charge moving in scalar and vector potentials and ,
The canonical momentum differs from mechanical momentum. Under and , the Lagrangian changes only by . This gauge freedom leaves the equations of motion and the observable Lorentz force unchanged.
Hamiltonian formulation and geometric structure
The relationship to Hamiltonian mechanics is established through a Legendre transformation. Starting with , suppose these equations can locally be solved for the velocities as functions of . The Hamiltonian is then
with the velocities replaced by those functions. The resulting equations are
For a regular system with coordinates, the Lagrangian formulation ordinarily supplies second-order differential equations, while the Hamiltonian formulation supplies first-order equations. They describe the same dynamics in different variables.
Regularity is determined by the velocity Hessian,
If this matrix is nonsingular, the inverse-function theorem guarantees a local transformation between velocities and momenta. If it is singular, not all canonical variables are independent. Relations among positions and momenta become constraints, and the ordinary Legendre transformation must be replaced by a constrained analysis. Gauge field theories provide important examples; the Dirac–Bergmann method organizes their primary constraints, consistency conditions, and gauge freedoms.
The geometric distinction is between position–velocity space and phase space. If configuration space is a manifold , positions and velocities form its tangent bundle . Positions and covectors representing canonical momenta form the cotangent bundle . The Lagrangian naturally acts on , whereas the Hamiltonian naturally acts on . For a time-dependent system, time appears as an additional argument.
In an unforced system whose kinetic energy is purely quadratic,
the coefficients define a metric on configuration space, and the trajectories are affinely parameterized geodesics of that metric. The metric contains masses and geometric factors, so it is not necessarily the metric of ordinary physical space. For example, two angles describing an articulated mechanism can constitute coordinates on a curved configuration space even though every component moves in Euclidean space.
This viewpoint explains why coordinate-dependent inertial terms need not represent new interactions. They can arise from the geometry of the chosen variables. It also clarifies coordinate singularities: a failure of angular coordinates at a pole is not a failure of the physical dynamics. Hamiltonian and Lagrangian descriptions provide complementary tools—one emphasizing phase-space structure and canonical transformations, the other often preserving a more direct connection to constraints, geometry, and model construction.
Relativistic particles and classical fields
The variational framework extends beyond Newtonian kinetic energy. In special relativity, a free massive particle has the coordinate-time Lagrangian
where is the speed of light. The resulting momentum is , and the Hamiltonian is , with . At speeds much smaller than ,
The constant rest-energy term does not affect the equations of motion, so the Newtonian free-particle Lagrangian emerges in the low-speed limit.
An invariant form of the particle action is
where is proper time along the worldline. In general relativity, the same construction uses the spacetime metric to define proper time. Its stationary paths are geodesics for freely falling massive test particles. This unifies the description of inertia and gravity at the level of the action, while massless trajectories require a different, suitably constrained formulation.
For continuous fields, a finite set of coordinates is replaced by quantities defined at points of spacetime. The action is an integral of a Lagrangian density:
The choice of spacetime coordinates and units determines any factors of in the measure. The field Euler–Lagrange equations are
They are partial differential equations rather than ordinary differential equations because fields vary across space as well as time.
A vibrating string gives a direct mechanical example. For transverse displacement , linear mass density , and constant tension , the small-amplitude Lagrangian density is
Variation gives the wave equation , with wave speed . Field theory is therefore a natural extension of coupled mechanical degrees of freedom.
Electromagnetic potentials likewise admit a Lagrangian density whose variation produces Maxwell’s equations. In quantum field theory, Lagrangian densities organize fields, symmetries, and interactions. In quantum mechanics, the path-integral formulation associates paths with phases involving . Classical stationary-action behavior emerges through interference in appropriate semiclassical regimes; quantum theory does not restrict contributions to the single classical path.
Engineering applications, computation, and limits
Lagrangian methods are widely used in multibody engineering because they organize the dynamics of connected components. Robot arms, vehicle suspensions, spacecraft mechanisms, and biomechanical models can be described using joint coordinates and body orientations. For a typical mechanical system, the equations can be arranged as
where is the mass matrix, collects velocity-dependent inertial terms, contains gravitational contributions, and represents applied generalized forces. The matrix is not unique, although the complete modeled inertial force is fixed.
In structural mechanics, approximating a displacement field by finitely many basis functions converts a continuum Lagrangian into a finite-dimensional one. The coefficients become generalized coordinates. This is one route to the mass and stiffness matrices used in finite-element vibration analysis. Electrical circuits also admit analogous formulations: for suitable circuits, node fluxes or branch charges act as generalized coordinates, while inductive and capacitive energies provide the storage terms. Resistive losses must be included separately or represented through an extended model.
Computational methods can exploit the variational structure rather than merely discretizing the differential equations. A variational integrator begins with a discrete action,
where approximates the action over a time step . Requiring stationarity with respect to the intermediate configurations gives discrete Euler–Lagrange equations. For regular unconstrained systems, the resulting evolution preserves an appropriate symplectic structure. If the discrete action preserves a continuous symmetry, a corresponding discrete momentum is conserved.
Such schemes can have good long-time behavior in conservative orbital and molecular simulations, but they do not ordinarily conserve the original continuous energy exactly. Their performance still depends on step size, smoothness, constraints, and implementation. Structure preservation is not equivalent to exact trajectories, and close encounters or rapidly changing forces can remain computationally demanding.
The framework also has conceptual limits. A closed conservative mechanical model does not by itself describe entropy production, random thermal forcing, irreversible material response, or the loss of energy into unresolved degrees of freedom. Effective equations may require damping, noise, memory kernels, or coupling to additional variables. Thermodynamic consistency then places requirements beyond the ordinary stationary-action principle.
Contact and impact create a different difficulty: velocities may jump, admissible configurations may change, and the equations may involve inequalities rather than smooth equalities. Flexible bodies undergoing large deformation require suitable constitutive laws, while higher-time-derivative Lagrangians require additional boundary data and can introduce instabilities absent from ordinary first-derivative mechanics. In these cases, the central task remains the specification of a physically appropriate model; the variational formalism organizes its consequences but does not supply the missing material laws, interaction rules, or environmental assumptions.