Introduced by the ItalianFrench mathematician and astronomer JosephLouis Lagrange in 1788, Lagrangian mechanics is a formulation of classical mechanics and is founded on the stationary action principle.
Lagrangian mechanics defines a mechanical system to be a pair
(M,L)
M
L=L(q,v,t)
L=TV,
T
V
q\inM,
v
q
(v
M).
L:TM x R_{t}\toR,
v\inT_{qM).}
Given the time instants
t_{1}
t_{2,}
x_{0:}[t_{1,t}_{2]}\toM
x_{0}
{\calS}[x]\stackrel{def
If
M
R^{n}
t_{1,}
t_{2}
x_{0}
{\calS}
x_{0}
\delta:[t_{1,t}_{2]}\toR^{n,}
\delta{\calS} \stackrel{def
The function
\delta(t)
\delta{\calS}
Lagrangian mechanics has been extended to allow for nonconservative forces.
Suppose there exists a bead sliding around on a wire, or a swinging simple pendulum, etc. If one tracks each of the massive objects (bead, pendulum bob, etc.) as a particle, calculation of the motion of the particle using Newtonian mechanics would require solving for the timevarying constraint force required to keep the particle in the constrained motion (reaction force exerted by the wire on the bead, or tension in the pendulum rod). For the same problem using Lagrangian mechanics, one looks at the path the particle can take and chooses a convenient set of independent generalized coordinates that completely characterize the possible motion of the particle. This choice eliminates the need for the constraint force to enter into the resultant system of equations. There are fewer equations since one is not directly calculating the influence of the constraint on the particle at a given moment.
For a wide variety of physical systems, if the size and shape of a massive object are negligible, it is a useful simplification to treat it as a point particle. For a system of N point particles with masses m_{1}, m_{2}, ..., m_{N}, each particle has a position vector, denoted r_{1}, r_{2}, ..., r_{N}. Cartesian coordinates are often sufficient, so r_{1} = (x_{1}, y_{1}, z_{1}), r_{2} = (x_{2}, y_{2}, z_{2}) and so on. In three dimensional space, each position vector requires three coordinates to uniquely define the location of a point, so there are 3N coordinates to uniquely define the configuration of the system. These are all specific points in space to locate the particles; a general point in space is written r = (x, y, z). The velocity of each particle is how fast the particle moves along its path of motion, and is the time derivative of its position, thus$$\backslash mathbf\_1\; =\; \backslash frac,\; \backslash mathbf\_2\; =\; \backslash frac,\backslash ldots,\backslash mathbf\_N\; =\; \backslash frac$$In Newtonian mechanics, the equations of motion are given by Newton's laws. The second law "net force equals mass times acceleration",$$\backslash sum\; \backslash mathbf\; =\; m\backslash frac$$applies to each particle. For an N particle system in 3 dimensions, there are 3N second order ordinary differential equations in the positions of the particles to solve for.
Instead of forces, Lagrangian mechanics uses the energies in the system. The central quantity of Lagrangian mechanics is the Lagrangian, a function which summarizes the dynamics of the entire system. Overall, the Lagrangian has units of energy, but no single expression for all physical systems. Any function which generates the correct equations of motion, in agreement with physical laws, can be taken as a Lagrangian. It is nevertheless possible to construct general expressions for large classes of applications. The nonrelativistic Lagrangian for a system of particles can be defined by
L=TV
where
T=
1  
2 
N  
\sum  
k=1 
m_{k}
2  
v  
k 
is the total kinetic energy of the system, equalling the sum Σ of the kinetic energies of the particles, and V is the potential energy of the system.
Kinetic energy is the energy of the system's motion, and v_{k}^{2} = v_{k} · v_{k} is the magnitude squared of velocity, equivalent to the dot product of the velocity with itself. The kinetic energy is a function only of the velocities v_{k}, not the positions r_{k} nor time t, so T = T(v_{1}, v_{2}, ...).
The potential energy of the system reflects the energy of interaction between the particles, i.e. how much energy any one particle will have due to all the others and other external influences. For conservative forces (e.g. Newtonian gravity), it is a function of the position vectors of the particles only, so V = V(r_{1}, r_{2}, ...). For those nonconservative forces which can be derived from an appropriate potential (e.g. electromagnetic potential), the velocities will appear also, V = V(r_{1}, r_{2}, ..., v_{1}, v_{2}, ...). If there is some external field or external driving force changing with time, the potential will change with time, so most generally V = V(r_{1}, r_{2}, ..., v_{1}, v_{2}, ..., t).
The above form of L does not hold in relativistic Lagrangian mechanics, and must be replaced by a function consistent with special or general relativity. Also, for dissipative forces another function must be introduced alongside L.
One or more of the particles may each be subject to one or more holonomic constraints; such a constraint is described by an equation of the form f(r, t) = 0. If the number of constraints in the system is C, then each constraint has an equation, f_{1}(r, t) = 0, f_{2}(r, t) = 0, ... f_{C}(r, t) = 0, each of which could apply to any of the particles. If particle k is subject to constraint i, then f_{i}(r_{k}, t) = 0. At any instant of time, the coordinates of a constrained particle are linked together and not independent. The constraint equations determine the allowed paths the particles can move along, but not where they are or how fast they go at every instant of time. Nonholonomic constraints depend on the particle velocities, accelerations, or higher derivatives of position. Lagrangian mechanics can only be applied to systems whose constraints, if any, are all holonomic. Three examples of nonholonomic constraints are: when the constraint equations are nonintegrable, when the constraints have inequalities, or with complicated nonconservative forces like friction. Nonholonomic constraints require special treatment, and one may have to revert to Newtonian mechanics, or use other methods.
If T or V or both depend explicitly on time due to timevarying constraints or external influences, the Lagrangian L(r_{1}, r_{2}, ... v_{1}, v_{2}, ... t) is explicitly timedependent. If neither the potential nor the kinetic energy depend on time, then the Lagrangian L(r_{1}, r_{2}, ... v_{1}, v_{2}, ...) is explicitly independent of time. In either case, the Lagrangian will always have implicit timedependence through the generalized coordinates.
With these definitions, Lagrange's equations of the first kind are
where k = 1, 2, ..., N labels the particles, there is a Lagrange multiplier λ_{i} for each constraint equation f_{i}, and
\partial  
\partialr_{k} 
\equiv\left(
\partial  ,  
\partialx_{k} 
\partial  ,  
\partialy_{k} 
\partial  
\partialz_{k} 
\right),
\partial  

\equiv\left(
\partial  ,  

\partial  ,  

\partial  

\right)
are each shorthands for a vector of partial derivatives with respect to the indicated variables (not a derivative with respect to the entire vector).^{[1]} Each overdot is a shorthand for a time derivative. This procedure does increase the number of equations to solve compared to Newton's laws, from 3N to 3N + C, because there are 3N coupled second order differential equations in the position coordinates and multipliers, plus C constraint equations. However, when solved alongside the position coordinates of the particles, the multipliers can yield information about the constraint forces. The coordinates do not need to be eliminated by solving the constraint equations.
In the Lagrangian, the position coordinates and velocity components are all independent variables, and derivatives of the Lagrangian are taken with respect to these separately according to the usual differentiation rules (e.g. the derivative of L with respect to the zvelocity component of particle 2, v_{z2} = dz_{2}/dt, is just that; no awkward chain rules or total derivatives need to be used to relate the velocity component to the corresponding coordinate z_{2}).
In each constraint equation, one coordinate is redundant because it is determined from the other coordinates. The number of independent coordinates is therefore n = 3N − C. We can transform each position vector to a common set of n generalized coordinates, conveniently written as an ntuple q = (q_{1}, q_{2}, ... q_{n}), by expressing each position vector, and hence the position coordinates, as functions of the generalized coordinates and time,
r_{k}=r_{k(q,}t)=(x_{k(q,}t),y_{k(q,}t),z_{k(q,}t),t).
The vector q is a point in the configuration space of the system. The time derivatives of the generalized coordinates are called the generalized velocities, and for each particle the transformation of its velocity vector, the total derivative of its position with respect to time, is
q 
_{j}=
dq_{j}  
dt 
, v_{k}=
n  
\sum  
j=1 
\partialr_{k}  
\partialq_{j} 
q 
_{j}+
\partialr_{k}  
\partialt 
.
Given this v_{k}, the kinetic energy in generalized coordinates depends on the generalized velocities, generalized coordinates, and time if the position vectors depend explicitly on time due to timevarying constraints, so T = T(q, dq/dt, t).
With these definitions, the Euler–Lagrange equations, or Lagrange's equations of the second kind
are mathematical results from the calculus of variations, which can also be used in mechanics. Substituting in the Lagrangian L(q, dq/dt, t), gives the equations of motion of the system. The number of equations has decreased compared to Newtonian mechanics, from 3N to n = 3N − C coupled second order differential equations in the generalized coordinates. These equations do not include constraint forces at all, only nonconstraint forces need to be accounted for.
Although the equations of motion include partial derivatives, the results of the partial derivatives are still ordinary differential equations in the position coordinates of the particles. The total time derivative denoted d/dt often involves implicit differentiation. Both equations are linear in the Lagrangian, but will generally be nonlinear coupled equations in the coordinates.
For simplicity, Newton's laws can be illustrated for one particle without much loss of generality (for a system of N particles, all of these equations apply to each particle in the system). The equation of motion for a particle of mass m is Newton's second law of 1687, in modern vector notation
F=ma,
where a is its acceleration and F the resultant force acting on it. In three spatial dimensions, this is a system of three coupled second order ordinary differential equations to solve, since there are three components in this vector equation. The solutions are the position vectors r of the particles at time t, subject to the initial conditions of r and v when t = 0.
Newton's laws are easy to use in Cartesian coordinates, but Cartesian coordinates are not always convenient, and for other coordinate systems the equations of motion can become complicated. In a set of curvilinear coordinates ξ = (ξ^{1}, ξ^{2}, ξ^{3}), the law in tensor index notation is the "Lagrangian form"
F^{a}=m\left(
d^{2}\xi^{a}  
dt^{2} 
+\Gamma^{a}{}_{bc}
d\xi^{b}  
dt 
d\xi^{c}  
dt 
\right)=g^{ak}\left(
d  
dt 
\partialT  


\partialT  
\partial\xi^{k} 
\right),
\xi 
^{a}\equiv
d\xi^{a}  
dt 
,
where F^{a} is the ath contravariant components of the resultant force acting on the particle, Γ^{a}_{bc} are the Christoffel symbols of the second kind,
T=
1  
2 
mg_{bc}
d\xi^{b}  
dt 
d\xi^{c}  
dt 
is the kinetic energy of the particle, and g_{bc} the covariant components of the metric tensor of the curvilinear coordinate system. All the indices a, b, c, each take the values 1, 2, 3. Curvilinear coordinates are not the same as generalized coordinates.
It may seem like an overcomplication to cast Newton's law in this form, but there are advantages. The acceleration components in terms of the Christoffel symbols can be avoided by evaluating derivatives of the kinetic energy instead. If there is no resultant force acting on the particle, F = 0, it does not accelerate, but moves with constant velocity in a straight line. Mathematically, the solutions of the differential equation are geodesics, the curves of extremal length between two points in space (these may end up being minimal so the shortest paths, but that is not necessary). In flat 3D real space the geodesics are simply straight lines. So for a free particle, Newton's second law coincides with the geodesic equation, and states free particles follow geodesics, the extremal trajectories it can move along. If the particle is subject to forces, F ≠ 0, the particle accelerates due to forces acting on it, and deviates away from the geodesics it would follow if free. With appropriate extensions of the quantities given here in flat 3D space to 4D curved spacetime, the above form of Newton's law also carries over to Einstein's general relativity, in which case free particles follow geodesics in curved spacetime that are no longer "straight lines" in the ordinary sense.
However, we still need to know the total resultant force F acting on the particle, which in turn requires the resultant nonconstraint force N plus the resultant constraint force C,
F=C+N.
The constraint forces can be complicated, since they will generally depend on time. Also, if there are constraints, the curvilinear coordinates are not independent but related by one or more constraint equations.
The constraint forces can either be eliminated from the equations of motion so only the nonconstraint forces remain, or included by including the constraint equations in the equations of motion.
A fundamental result in analytical mechanics is D'Alembert's principle, introduced in 1708 by Jacques Bernoulli to understand static equilibrium, and developed by D'Alembert in 1743 to solve dynamical problems. The principle asserts for N particles the virtual work, i.e. the work along a virtual displacement, δr_{k}, is zero
N  
\sum  
k=1 
(N_{k}+C_{k}m_{k}a_{k}) ⋅ \deltar_{k}=0.
The virtual displacements, δr_{k}, are by definition infinitesimal changes in the configuration of the system consistent with the constraint forces acting on the system at an instant of time, i.e. in such a way that the constraint forces maintain the constrained motion. They are not the same as the actual displacements in the system, which are caused by the resultant constraint and nonconstraint forces acting on the particle to accelerate and move it.^{[2]} Virtual work is the work done along a virtual displacement for any force (constraint or nonconstraint).
Since the constraint forces act perpendicular to the motion of each particle in the system to maintain the constraints, the total virtual work by the constraint forces acting on the system is zero;^{[3]}
N  
\sum  
k=1 
C_{k} ⋅ \deltar_{k}=0,
so that
N  
\sum  
k=1 
(N_{k}m_{k}a_{k}) ⋅ \deltar_{k}=0.
Thus D'Alembert's principle allows us to concentrate on only the applied nonconstraint forces, and exclude the constraint forces in the equations of motion. The form shown is also independent of the choice of coordinates. However, it cannot be readily used to set up the equations of motion in an arbitrary coordinate system since the displacements δr_{k} might be connected by a constraint equation, which prevents us from setting the N individual summands to 0. We will therefore seek a system of mutually independent coordinates for which the total sum will be 0 if and only if the individual summands are 0. Setting each of the summands to 0 will eventually give us our separated equations of motion.
If there are constraints on particle k, then since the coordinates of the position r_{k} = (x_{k}, y_{k}, z_{k}) are linked together by a constraint equation, so are those of the virtual displacements δr_{k} = (δx_{k}, δy_{k}, δz_{k}). Since the generalized coordinates are independent, we can avoid the complications with the δr_{k} by converting to virtual displacements in the generalized coordinates. These are related in the same form as a total differential,
\deltar_{k}=
n  
\sum  
j=1 
\partialr_{k}  
\partialq_{j} 
\deltaq_{j}.
There is no partial time derivative with respect to time multiplied by a time increment, since this is a virtual displacement, one along the constraints in an instant of time.
The first term in D'Alembert's principle above is the virtual work done by the nonconstraint forces N_{k} along the virtual displacements δr_{k}, and can without loss of generality be converted into the generalized analogues by the definition of generalized forces
Q_{j}=
N  
\sum  
k=1 
N_{k} ⋅
\partialr_{k}  
\partialq_{j} 
,
so that
N  
\sum  
k=1 
N_{k} ⋅ \deltar_{k}=
N  
\sum  
k=1 
N_{k} ⋅
n  
\sum  
j=1 
\partialr_{k}  
\partialq_{j} 
\deltaq_{j}=
n  
\sum  
j=1 
Q_{j}\deltaq_{j}.
N  
\sum  
k=1 
m_{k}a_{k} ⋅
\partialr_{k}  
\partialq_{j} 
=
d  
dt 
\partialT  


\partialT  
\partialq_{j} 
.
Now D'Alembert's principle is in the generalized coordinates as required,
n  
\sum  
j=1 
\left[Q_{j}\left(
d  
dt 
\partialT  


\partialT  
\partialq_{j} 
\right)\right]\deltaq_{j}=0,
and since these virtual displacements δq_{j} are independent and nonzero, the coefficients can be equated to zero, resulting in Lagrange's equations or the generalized equations of motion,
Q_{j}=
d  
dt 
\partialT  


\partialT  
\partialq_{j} 
These equations are equivalent to Newton's laws for the nonconstraint forces. The generalized forces in this equation are derived from the nonconstraint forces only – the constraint forces have been excluded from D'Alembert's principle and do not need to be found. The generalized forces may be nonconservative, provided they satisfy D'Alembert's principle.
For a nonconservative force which depends on velocity, it may be possible to find a potential energy function V that depends on positions and velocities. If the generalized forces Q_{i} can be derived from a potential V such that
Q_{j}=
d  
dt 
\partialV  


\partialV  
\partialq_{j} 
,
equating to Lagrange's equations and defining the Lagrangian as L = T − V obtains Lagrange's equations of the second kind or the Euler–Lagrange equations of motion
\partialL  
\partialq_{j} 

d  
dt 
\partialL  

=0.
However, the Euler–Lagrange equations can only account for nonconservative forces if a potential can be found as shown. This may not always be possible for nonconservative forces, and Lagrange's equations do not involve any potential, only generalized forces; therefore they are more general than the Euler–Lagrange equations.
The Euler–Lagrange equations also follow from the calculus of variations. The variation of the Lagrangian is
\deltaL=
n  
\sum  \left(  
j=1 
\partialL  
\partialq_{j} 
\deltaq_{j}+
\partialL  

\delta
q 
_{j}\right), \delta
q 
_{j}\equiv\delta
dq_{j}  
dt 
\equiv
d(\deltaq_{j)}  
dt 
,
which has a form similar to the total differential of L, but the virtual displacements and their time derivatives replace differentials, and there is no time increment in accordance with the definition of the virtual displacements. An integration by parts with respect to time can transfer the time derivative of δq_{j} to the ∂L/∂(dq_{j}/dt), in the process exchanging d(δq_{j})/dt for δq_{j}, allowing the independent virtual displacements to be factorized from the derivatives of the Lagrangian,
t_{2}  
\int  
t_{1} 
\deltaLdt
t_{2}  
=\int  
t_{1} 
n  
\sum  \left(  
j=1 
\partialL  
\partialq_{j} 
\deltaq_{j}+
d  \left(  
dt 
\partialL  

\deltaq_{j\right)}
d  
dt 
\partialL  

\deltaq_{j}\right)dt =
 
\sum  
j=1 
\deltaq_{j\right]}
t_{2}  
t_{1} 
+
t_{2}  
\int  
t_{1} 
n  
\sum  \left(  
j=1 
\partialL  
\partialq_{j} 

d  
dt 
\partialL  

\right)\deltaq_{j}dt.
Now, if the condition δq_{j}(t_{1}) = δq_{j}(t_{2}) = 0 holds for all j, the terms not integrated are zero. If in addition the entire time integral of δL is zero, then because the δq_{j} are independent, and the only way for a definite integral to be zero is if the integrand equals zero, each of the coefficients of δq_{j} must also be zero. Then we obtain the equations of motion. This can be summarized by Hamilton's principle;
t_{2}  
\int  
t_{1} 
\deltaLdt=0.
The time integral of the Lagrangian is another quantity called the action, defined as
S=
t_{2}  
\int  
t_{1} 
Ldt,
which is a functional; it takes in the Lagrangian function for all times between t_{1} and t_{2} and returns a scalar value. Its dimensions are the same as [[[angular momentum]] ], [energy]·[time], or [length]·[momentum]. With this definition Hamilton's principle is
\deltaS=0.
Thus, instead of thinking about particles accelerating in response to applied forces, one might think of them picking out the path with a stationary action, with the end points of the path in configuration space held fixed at the initial and final times. Hamilton's principle is sometimes referred to as the principle of least action, however the action functional need only be stationary, not necessarily a maximum or a minimum value. Any variation of the functional gives an increase in the functional integral of the action.
Historically, the idea of finding the shortest path a particle can follow subject to a force motivated the first applications of the calculus of variations to mechanical problems, such as the Brachistochrone problem solved by Jean Bernoulli in 1696, as well as Leibniz, Daniel Bernoulli, L'Hôpital around the same time, and Newton the following year. Newton himself was thinking along the lines of the variational calculus, but did not publish. These ideas in turn lead to the variational principles of mechanics, of Fermat, Maupertuis, Euler, Hamilton, and others.
Hamilton's principle can be applied to nonholonomic constraints if the constraint equations can be put into a certain form, a linear combination of first order differentials in the coordinates. The resulting constraint equation can be rearranged into first order differential equation. This will not be given here.
The Lagrangian L can be varied in the Cartesian r_{k} coordinates, for N particles,
t_{2}  
\int  
t_{1} 
N  
\sum  \left(  
k=1 
\partialL  
\partialr_{k} 

d  
dt 
\partialL  

\right) ⋅ \deltar_{k}dt=0.
Hamilton's principle is still valid even if the coordinates L is expressed in are not independent, here r_{k}, but the constraints are still assumed to be holonomic. As always the end points are fixed δr_{k}(t_{1}) = δr_{k}(t_{2}) = 0 for all k. What cannot be done is to simply equate the coefficients of δr_{k} to zero because the δr_{k} are not independent. Instead, the method of Lagrange multipliers can be used to include the constraints. Multiplying each constraint equation f_{i}(r_{k}, t) = 0 by a Lagrange multiplier λ_{i} for i = 1, 2, ..., C, and adding the results to the original Lagrangian, gives the new Lagrangian
L'=L(r_{1,r}


_{2,\ldots,t)}+
C  
\sum  
i=1 
λ_{i(t)}f_{i(r}_{k,t)}.
The Lagrange multipliers are arbitrary functions of time t, but not functions of the coordinates r_{k}, so the multipliers are on equal footing with the position coordinates. Varying this new Lagrangian and integrating with respect to time gives
t_{2}  
\int  
t_{1} 
\deltaL'dt=
t_{2}  
\int  
t_{1} 
N  
\sum  \left(  
k=1 
\partialL  
\partialr_{k} 

d  
dt 
\partialL  

+
C  
\sum  
i=1 
λ_{i}
\partialf_{i}  
\partialr_{k} 
\right) ⋅ \deltar_{k}dt=0.
The introduced multipliers can be found so that the coefficients of δr_{k} are zero, even though the r_{k} are not independent. The equations of motion follow. From the preceding analysis, obtaining the solution to this integral is equivalent to the statement
\partialL'  
\partialr_{k} 

d  
dt 
\partialL'  

=0 ⇒
\partialL  
\partialr_{k} 

d  
dt 
\partialL  

+
C  
\sum  
i=1 
λ_{i}
\partialf_{i}  
\partialr_{k} 
=0,
which are Lagrange's equations of the first kind. Also, the λ_{i} EulerLagrange equations for the new Lagrangian return the constraint equations
\partialL'  
\partialλ_{i} 

d  
dt 
\partialL'  

=0 ⇒ f_{i(r}_{k,t)}=0.
For the case of a conservative force given by the gradient of some potential energy V, a function of the r_{k} coordinates only, substituting the Lagrangian L = T − V gives
\underbrace{
\partialT  
\partialr_{k} 

d  
dt 
\partialT  

}  
F_{k} 
+\underbrace{
\partialV  
\partialr_{k} 
and identifying the derivatives of kinetic energy as the (negative of the) resultant force, and the derivatives of the potential equaling the nonconstraint force, it follows the constraint forces are
C_{k}=
C  
\sum  
i=1 
λ_{i}
\partialf_{i}  
\partialr_{k} 
,
thus giving the constraint forces explicitly in terms of the constraint equations and the Lagrange multipliers.
The Lagrangian of a given system is not unique. A Lagrangian L can be multiplied by a nonzero constant a, an arbitrary constant b can be added, and the new Lagrangian aL + b will describe exactly the same motion as L. If, in addition, we restrict ourselves, as we did above, to trajectories
q
[t_{st,t}_{fin]}
P_{st}=q(t_{st)}
P_{fin}=q(t_{fin)}
f(q,t)
L'(q,q,t) 
=L(q,
q,t) 
+
df(q,t)  
dt 
,
where
style  df(q,t) 
dt 
style
\partialf(q,t)  
\partialt 
+\sum_{i}
\partialf(q,t)  {  
\partialq_{i} 
q} 
_{i.}
Both Lagrangians
L
L'
S
S'
\begin{align} S'[q]=
t_{fin}  
\int\limits  L'(q(t),  
t_{st} 
q(t),t)dt 
=
t_{fin}  
\int\limits  L(q(t),  
t_{st} 
q(t),t)dt 
+
t_{fin}  
\int  
t_{st} 
df(q(t),t)  
dt 
dt\ = S[q]+f(P_{fin,t}_{fin)}f(P_{st,t}_{st), \end{align} }
with the last two components
f(P_{fin,t}_{fin)}
f(P_{st,t}_{st)}
q.
Given a set of generalized coordinates q, if we change these variables to a new set of generalized coordinates s according to a point transformation q = q(s, t), the new Lagrangian L′ is a function of the new coordinates
L(q(s,t),
q  (s, 
s 
,t),t)=L'(s,
s 
,t),
and by the chain rule for partial differentiation, Lagrange's equations are invariant under this transformation;
d  
dt 
\partialL'  

=
\partialL'  
\partials_{i} 
.
This may simplify the equations of motion.
An important property of the Lagrangian is that conserved quantities can easily be read off from it. The generalized momentum "canonically conjugate to" the coordinate q_{i} is defined by
p_{i}=
\partialL  

.
If the Lagrangian L does not depend on some coordinate q_{i}, it follows immediately from the Euler–Lagrange equations that
p 
_{i}=
d  
dt 
\partialL  

=
\partialL  
\partialq_{i} 
=0
and integrating shows the corresponding generalized momentum equals a constant, a conserved quantity. This is a special case of Noether's theorem. Such coordinates are called "cyclic" or "ignorable".
For example, a system may have a Lagrangian
L(r,\theta,s  , 
z  , 
r  , 
\theta  , 
\phi 
,t),
where r and z are lengths along straight lines, s is an arc length along some curve, and θ and φ are angles. Notice z, s, and φ are all absent in the Lagrangian even though their velocities are not. Then the momenta
p_{z}=
\partialL  

, p_{s}=
\partialL  

, p_{\phi}=
\partialL  

,
are all conserved quantities. The units and nature of each generalized momentum will depend on the corresponding coordinate; in this case p_{z} is a translational momentum in the z direction, p_{s} is also a translational momentum along the curve s is measured, and p_{φ} is an angular momentum in the plane the angle φ is measured in. However complicated the motion of the system is, all the coordinates and velocities will vary in such a way that these momenta are conserved.
Given a Lagrangian
L,
E=
n  
\sum  {  
i=1 
q 
At every time instant
t,
q\toQ
E(q,q,t) 
=E(Q,
Q,t). 
\partialL/\partial{
q} 
_{i}
Proof  
For a coordinate transformation Q=F(q), dQ=F_{*(q)dq,} F_{*(q)}
_{i ⋅ }\left(\partial/\partialq_{il}_{q}\right) l {
_{i}\inR\right\} to the vector space
_{i ⋅ }\left(\partial/\partialQ_{il}_{F(q)}\right) l {
_{i}\inR\right\}, styleF_{*(q)=l(\partial}F_{i/}\partialq_{jl}  _\bigr)^n_is the Jacobian. In the coordinates
_{i}
_{i,} dQ
=
=G(q,
+
 _\mathbf dq_k \right)^n_= \left(\sum^n__j\sum^n_\frac\biggl  _\mathbf dq_k \right)^T_ \\&= \left(\sum^n_dq_k\sum^n_\frac\biggl  _\mathbf _j \right)^T_= \left(\sum^n_\frac\biggl  _\mathbf _j \right)^n_d\mathbf.\end In vector notations,
dQ +
dt\\ &=\left(
F_{*(q)}+
+
+
. \end{align} On the other hand,
dq +
dt. It was mentioned earlier that Lagrangians do not depend on the choice of configuration space coordinates, i.e.
=L(q,
=dL(q,
F_{*(q)}=
. q,
t,
_{i}
_{i}}
=
. E 
In Lagrangian mechanics, the system is closed if and only if its Lagrangian
L
E
More precisely, let
q=q(t)
q
L

\partialL  
\partialt 
l_{q(t)}=
d  
dt 
\left[El_{q(t)}\right].
L
\partialL/\partialt=0,
E
E(q(t),
q(t), 
t)=const.
It also follows that the kinetic energy is a homogenous function of degree 2 in the generalized velocities. If in addition the potential V is only a function of coordinates and independent of velocities, it follows by direct calculation, or use of Euler's theorem for homogenous functions, that
n  
\sum  
i=1 
q 

=
n  
\sum  
i=1 
q 

=2T.
Under all these circumstances, the constant
E=T+V
is the total energy of the system. The kinetic and potential energies still change as the system evolves, but the motion of the system will be such that their sum, the total energy, is constant. This is a valuable simplification, since the energy E is a constant of integration that counts as an arbitrary constant for the problem, and it may be possible to integrate the velocities from this energy relation to solve for the coordinates. In the case the velocity or kinetic energy or both depends on time, then the energy is not conserved.
See main article: Mechanical similarity.
If the potential energy is a homogeneous function of the coordinates and independent of time, and all position vectors are scaled by the same nonzero constant α, r_{k}′ = αr_{k}, so that
V(\alphar_{1,\alphar}_{2,\ldots,}
N  
\alphar  
N)=\alpha 
V(r_{1,r}_{2,\ldots,}r_{N)}
and time is scaled by a factor β, t′ = βt, then the velocities v_{k} are scaled by a factor of α/β and the kinetic energy T by (α/β)^{2}. The entire Lagrangian has been scaled by the same factor if
\alpha^{2}  
\beta^{2} 
=\alpha^{N} ⇒ \beta=
 
\alpha 
.
Since the lengths and times have been scaled, the trajectories of the particles in the system follow geometrically similar paths differing in size. The length l traversed in time t in the original trajectory corresponds to a new length l′ traversed in time t′ in the new trajectory, given by the ratios
t'  
t 
=\left(
l'  
l 
 
\right) 
.
For a given system, if two subsystems A and B are noninteracting, the Lagrangian L of the overall system is the sum of the Lagrangians L_{A} and L_{B} for the subsystems:
L=L_{A}+L_{B}.
If they do interact this is not possible. In some situations, it may be possible to separate the Lagrangian of the system L into the sum of noninteracting Lagrangians, plus another Lagrangian L_{AB} containing information about the interaction,
L=L_{A}+L_{B}+L_{AB}.
This may be physically motivated by taking the noninteracting Lagrangians to be kinetic energies only, while the interaction Lagrangian is the system's total potential energy. Also, in the limiting case of negligible interaction, L_{AB} tends to zero reducing to the noninteracting case above.
The extension to more than two noninteracting subsystems is straightforward – the overall Lagrangian is the sum of the separate Lagrangians for each subsystem. If there are interactions, then interaction Lagrangians may be added.
The following examples apply Lagrange's equations of the second kind to mechanical problems.
A particle of mass m moves under the influence of a conservative force derived from the gradient ∇ of a scalar potential,
F=\boldsymbol{\nabla}V(r).
If there are more particles, in accordance with the above results, the total kinetic energy is a sum over all the particle kinetic energies, and the potential is a function of all the coordinates.
The Lagrangian of the particle can be written
L(x,y,z,
x 
,
y  , 
z 
)=
1  
2 
m(
x 
^{2}+
y 
^{2}+
z 
^{2)}V(x,y,z).
The equations of motion for the particle are found by applying the Euler–Lagrange equation, for the x coordinate
d  
dt 
\left(
\partialL  

\right)=
\partialL  
\partialx 
,
with derivatives
\partialL  
\partialx 
=
\partialV  
\partialx 
,
\partialL  

=m
x 
,
d  
dt 
\left(
\partialL  

\right)=m\ddot{x},
hence
m\ddot{x}=
\partialV  
\partialx 
,
and similarly for the y and z coordinates. Collecting the equations in vector form we find
m\ddot{r
which is Newton's second law of motion for a particle subject to a conservative force.
The Lagrangian for the above problem in spherical coordinates (2D polar coordinates can be recovered by setting
\theta=\pi/2
L=
m  (  
2 
r 
^{2+r}
 
^{2}+r^{2\sin}^{2\theta}
\varphi 
^{2)V(r),}
so the Euler–Lagrange equations are
m\ddot{r}mr(\theta 
^{2+\sin}^{2\theta}
\varphi 
 
=0,
d  
dt 
 
(mr 
)mr^{2\sin\theta\cos\theta}
\varphi 
^{2=0,}
d  
dt 
(mr^{2\sin}^{2\theta}
\varphi 
)=0.
The φ coordinate is cyclic since it does not appear in the Lagrangian, so the conserved momentum in the system is the angular momentum
p_{\varphi}=
\partialL  

=mr^{2\sin}^{2\theta}
\varphi 
,
in which r, θ and dφ/dt can all vary with time, but only in such a way that p_{φ} is constant.
Consider a pendulum of mass m and length ℓ, which is attached to a support with mass M, which can move along a line in the xdirection. Let x be the coordinate along the line of the support, and let us denote the position of the pendulum by the angle θ from the vertical. The coordinates and velocity components of the pendulum bob are
\begin{array}{rll} &x_{pend}=x+\ell\sin\theta& ⇒
x 
_{pend}=
x 
+\ell
\theta 
\cos\theta\\ &y_{pend}=\ell\cos\theta& ⇒
y 
_{pend}=\ell
\theta 
\sin\theta. \end{array}
The generalized coordinates can be taken to be x and θ. The kinetic energy of the system is then
T=
1  
2 
M
x 
^{2}+
1  
2 
m\left(
x 
2  
pend 
+
y 
2  
pend 
\right)
and the potential energy is
V=mgy_{pend}
giving the Lagrangian
\begin{array}{rcl} L&=&TV\\ &=&
1  
2 
M
x 
^{2}+
1  
2 
m\left[\left(
x 
+\ell
\theta 
\cos\theta\right)^{2}+\left(\ell
\theta 
\sin\theta\right)^{2}\right]+mg\ell\cos\theta\\ &=&
1  
2 
\left(M+m\right)
x 
^{2}+m
x 
\ell
\theta 
\cos\theta+
1  
2 
m\ell^{2}
\theta 
^{2}+mg\ell\cos\theta. \end{array}
Since x is absent from the Lagrangian, it is a cyclic coordinate. The conserved momentum is
p_{x}=
\partialL  

=(M+m)
x 
+m\ell
\theta 
\cos\theta
and the Lagrange equation for the support coordinate x is
(M+m)\ddotx+m\ell\ddot\theta\cos\thetam\ell
\theta 
^{2}\sin\theta=0.
The Lagrange equation for the angle θ is
d  
dt 
\left[m(
x 
\ell\cos\theta+\ell^{2}
\theta 
)\right]+m\ell(
x 
\theta 
+g)\sin\theta=0;
and simplifying
\ddot\theta+
\ddotx  
\ell 
\cos\theta+
g  
\ell 
\sin\theta=0.
These equations may look quite complicated, but finding them with Newton's laws would have required carefully identifying all forces, which would have been much more laborious and prone to errors. By considering limit cases, the correctness of this system can be verified: For example,
\ddotx\to0
\ddot\theta\to0
See main article: Twobody problem and Central force.
Two bodies of masses and with position vectors and are in orbit about each other due to an attractive central potential . We may write down the Lagrangian in terms of the position coordinates as they are, but it is an established procedure to convert the twobody problem into a onebody problem as follows. Introduce the Jacobi coordinates; the separation of the bodies and the location of the center of mass . The Lagrangian is then^{[4]}
L=\underbrace{
1  
2 
M
R 
2}  
L_{cm} 
+\underbrace{
1  
2 
\mu
r 
^{2}V(r)
}  
L_{rel} 
where is the total mass, is the reduced mass, and the potential of the radial force, which depends only on the magnitude of the separation . The Lagrangian splits into a centerofmass term and a relative motion term .
The Euler–Lagrange equation for is simply
M\ddot{R
which states the center of mass moves in a straight line at constant velocity.
Since the relative motion only depends on the magnitude of the separation, it is ideal to use polar coordinates and take,
L  

\mu(
r 
^{2}+r^{2}
\theta 
^{2})V(r),
so is a cyclic coordinate with the corresponding conserved (angular) momentum
p_{\theta}=
\partialL_{rel}  

=\mur^{2}
\theta 
=\ell.
The radial coordinate and angular velocity can vary with time, but only in such a way that is constant. The Lagrange equation for is
\mur
\theta 
^{2}
dV  
dr 
=\mu\ddot{r}.
This equation is identical to the radial equation obtained using Newton's laws in a corotating reference frame, that is, a frame rotating with the reduced mass so it appears stationary. Eliminating the angular velocity from this radial equation,
\mu\ddotr=
dV  
dr 
+
\ell^{2}  
\mur^{3} 
.
which is the equation of motion for a onedimensional problem in which a particle of mass is subjected to the inward central force and a second outward force, called in this context the centrifugal force
F_{cf}=\mur
\theta 
^{2}=
\ell^{2}  
\mur^{3} 
.
Of course, if one remains entirely within the onedimensional formulation, enters only as some imposed parameter of the external outward force, and its interpretation as angular momentum depends upon the more general twodimensional problem from which the onedimensional problem originated.
If one arrives at this equation using Newtonian mechanics in a corotating frame, the interpretation is evident as the centrifugal force in that frame due to the rotation of the frame itself. If one arrives at this equation directly by using the generalized coordinates and simply following the Lagrangian formulation without thinking about frames at all, the interpretation is that the centrifugal force is an outgrowth of using polar coordinates. As Hildebrand says:
"Since such quantities are not true physical forces, they are often called inertia forces. Their presence or absence depends, not upon the particular problem at hand, but upon the coordinate system chosen." In particular, if Cartesian coordinates are chosen, the centrifugal force disappears, and the formulation involves only the central force itself, which provides the centripetal force for a curved motion.
This viewpoint, that fictitious forces originate in the choice of coordinates, often is expressed by users of the Lagrangian method. This view arises naturally in the Lagrangian approach, because the frame of reference is (possibly unconsciously) selected by the choice of coordinates. For example, see for a comparison of Lagrangians in an inertial and in a noninertial frame of reference. See also the discussion of "total" and "updated" Lagrangian formulations in. Unfortunately, this usage of "inertial force" conflicts with the Newtonian idea of an inertial force. In the Newtonian view, an inertial force originates in the acceleration of the frame of observation (the fact that it is not an inertial frame of reference), not in the choice of coordinate system. To keep matters clear, it is safest to refer to the Lagrangian inertial forces as generalized inertial forces, to distinguish them from the Newtonian vector inertial forces. That is, one should avoid following Hildebrand when he says (p. 155) "we deal always with generalized forces, velocities accelerations, and momenta. For brevity, the adjective "generalized" will be omitted frequently."
It is known that the Lagrangian of a system is not unique. Within the Lagrangian formalism the Newtonian fictitious forces can be identified by the existence of alternative Lagrangians in which the fictitious forces disappear, sometimes found by exploiting the symmetry of the system.
A test particle is a particle whose mass and charge are assumed to be so small that its effect on external system is insignificant. It is often a hypothetical simplified point particle with no properties other than mass and charge. Real particles like electrons and up quarks are more complex and have additional terms in their Lagrangians.
The Lagrangian for a charged particle with electrical charge, interacting with an electromagnetic field, is the prototypical example of a velocitydependent potential. The electric scalar potential and magnetic vector potential are defined from the electric field and magnetic field as follows;
E=\boldsymbol{\nabla}\phi
\partialA  
\partialt 
, B=\boldsymbol{\nabla} x A.
The Lagrangian of a massive charged test particle in an electromagnetic field
L=\tfrac{1}{2}m
r 
^{2}+q
r 
⋅ Aq\phi,
is called minimal coupling. Combined with Euler–Lagrange equation, it produces the Lorentz force law
m\ddot{r
Under gauge transformation:
A → A+\boldsymbol{\nabla}f, \phi → \phi
f 
,
where is any scalar function of space and time, the aforementioned Lagrangian transforms like:
L → L+q\left(
r  ⋅ \boldsymbol{\nabla}+ 
\partial  \right)f=L+q  
\partialt 
df  
dt 
,
which still produces the same Lorentz force law.
Note that the canonical momentum (conjugate to position) is the kinetic momentum plus a contribution from the field (known as the potential momentum):
p=
\partialL  

=m
r 
+qA.
This relation is also used in the minimal coupling prescription in quantum mechanics and quantum field theory. From this expression, we can see that the canonical momentum is not gauge invariant, and therefore not a measurable physical quantity; However, if is cyclic (i.e. Lagrangian is independent of position), which happens if the and fields are uniform, then this canonical momentum given here is the conserved momentum, while the measurable physical kinetic momentum is not.
Dissipation (i.e. nonconservative systems) can also be treated with an effective Lagrangian formulated by a certain doubling of the degrees of freedom.
In a more general formulation, the forces could be both conservative and viscous. If an appropriate transformation can be found from the F_{i}, Rayleigh suggests using a dissipation function, D, of the following form:
D=
1  
2 
m  
\sum  
j=1 
m  
\sum  
k=1 
C_{j}
q 
_{j}
q 
_{k}
where C_{jk} are constants that are related to the damping coefficients in the physical system, though not necessarily equal to them. If D is defined this way, then
Q_{j}=
\partialV  
\partialq_{j} 

\partialD  

and
d  
dt 
\left(
\partialL  

\right)
\partialL  
\partialq_{j} 
+
\partialD  

=0.
The ideas in Lagrangian mechanics have numerous applications in other areas of physics, and can adopt generalized results from the calculus of variations.
A closely related formulation of classical mechanics is Hamiltonian mechanics. The Hamiltonian is defined by
H=
n  
\sum  
i=1 
q 

L
and can be obtained by performing a Legendre transformation on the Lagrangian, which introduces new variables canonically conjugate to the original variables. For example, given a set of generalized coordinates, the variables canonically conjugate are the generalized momenta. This doubles the number of variables, but makes differential equations first order. The Hamiltonian is a particularly ubiquitous quantity in quantum mechanics (see Hamiltonian (quantum mechanics)).
Routhian mechanics is a hybrid formulation of Lagrangian and Hamiltonian mechanics, which is not often used in practice but an efficient formulation for cyclic coordinates.
The Euler–Lagrange equations can also be formulated in terms of the generalized momenta rather than generalized coordinates. Performing a Legendre transformation on the generalized coordinate Lagrangian L(q, dq/dt, t) obtains the generalized momenta Lagrangian L′(p, dp/dt, t) in terms of the original Lagrangian, as well the EL equations in terms of the generalized momenta. Both Lagrangians contain the same information, and either can be used to solve for the motion of the system. In practice generalized coordinates are more convenient to use and interpret than generalized momenta.
There is no reason to restrict the derivatives of generalized coordinates to first order only. It is possible to derive modified EL equations for a Lagrangian containing higher order derivatives, see Euler–Lagrange equation for details.
See main article: Hamiltonian optics.
Lagrangian mechanics can be applied to geometrical optics, by applying variational principles to rays of light in a medium, and solving the EL equations gives the equations of the paths the light rays follow.
See main article: Relativistic Lagrangian mechanics.
Lagrangian mechanics can be formulated in special relativity and general relativity. Some features of Lagrangian mechanics are retained in the relativistic theories but difficulties quickly appear in other respects. In particular, the EL equations take the same form, and the connection between cyclic coordinates and conserved momenta still applies, however the Lagrangian must be modified and is not simply the kinetic minus the potential energy of a particle. Also, it is not straightforward to handle multiparticle systems in a manifestly covariant way, it may be possible if a particular frame of reference is singled out.
In quantum mechanics, action and quantummechanical phase are related via Planck's constant, and the principle of stationary action can be understood in terms of constructive interference of wave functions.
In 1948, Feynman discovered the path integral formulation extending the principle of least action to quantum mechanics for electrons and photons. In this formulation, particles travel every possible path between the initial and final states; the probability of a specific final state is obtained by summing over all possible trajectories leading to it. In the classical regime, the path integral formulation cleanly reproduces Hamilton's principle, and Fermat's principle in optics.
In Lagrangian mechanics, the generalized coordinates form a discrete set of variables that define the configuration of a system. In classical field theory, the physical system is not a set of discrete particles, but rather a continuous field ϕ(r, t) defined over a region of 3D space. Associated with the field is a Lagrangian density
l{L}(\phi,\nabla\phi,\partial\phi/\partialt,r,t)
defined in terms of the field and its space and time derivatives at a location r and time t. Analogous to the particle case, for nonrelativistic applications the Lagrangian density is also the kinetic energy density of the field, minus its potential energy density (this is not true in general, and the Lagrangian density has to be "reverse engineered"). The Lagrangian is then the volume integral of the Lagrangian density over 3D space
L(t)=\intl{L}d^{3}r
where d^{3}r is a 3D differential volume element. The Lagrangian is a function of time since the Lagrangian density has implicit space dependence via the fields, and may have explicit spatial dependence, but these are removed in the integral, leaving only time in as the variable for the Lagrangian.
The action principle, and the Lagrangian formalism, are tied closely to Noether's theorem, which connects physical conserved quantities to continuous symmetries of a physical system.
If the Lagrangian is invariant under a symmetry, then the resulting equations of motion are also invariant under that symmetry. This characteristic is very helpful in showing that theories are consistent with either special relativity or general relativity.
\delta  
\deltar_{k} 
\equiv
\partial  
\partialr_{k} 

d  
dt 
\partial  

is used. Throughout this article only partial and total derivatives are used.
C_{k ⋅ \deltar}_{k}=0
for particle k subject to a constraint force, however
C_{kx}\deltax_{k} ≠ 0, C_{ky}\deltay_{k} ≠ 0, C_{kz}\deltaz_{k} ≠ 0
because of the constraint equations on the r_{k} coordinates.