--- title: "Lagrangian mechanics" sort_title: "Lagrangian mechanics" date: 2021-07-01 categories: - Physics - Classical mechanics layout: "concept" --- **Lagrangian mechanics** is a formulation of classical mechanics, which is equivalent to Newton's laws, but offers some advantages. Its mathematical backbone is the [calculus of variations](/know/concept/calculus-of-variations/), and hence it is built on the **principle of least action**, which states that the path taken by a system will be a minimum of the **action** (i.e. energy cost) of that path. For a moving object with position $$x(t)$$ and velocity $$\dot{x}(t)$$, we define the Lagrangian $$L$$ as the difference between its kinetic and potential energies: $$\begin{aligned} \boxed{ L(x, \dot{x}, t) \equiv T - V = \frac{1}{2} m \dot{x}^2 - V(x) } \end{aligned}$$ From variational calculus we then get the Euler-Lagrange equation, which in this case turns out to just be Newton's second law: $$\begin{aligned} \dv{}{t}\Big( \pdv{L}{\dot{x}} \Big) = \pdv{L}{x} \qquad \implies \qquad m \ddot{x} = - \pdv{V}{x} = F \end{aligned}$$ But compared to Newtonian mechanics, Lagrangian mechanics scales better for large systems. For example, to describe the dynamics of $$N$$ objects $$x_1(t), ..., x_N(t)$$, we only need a single $$L$$ from which the equations of motion can easily be derived. Getting these equations directly from Newton's laws could get messy. At no point have we assumed Cartesian coordinates: the Euler-Lagrange equations keep their form for any independent coordinates $$q_1(t), ..., q_N(t)$$: $$\begin{aligned} \dv{}{t}\Big( \pdv{L}{\dot{q}_n} \Big) = \pdv{L}{q_n} \end{aligned}$$ We define the **canonical momentum conjugate** $$p_n(t)$$ and the **generalized force conjugate** $$F_n(t)$$ as follows, such that we can always get Newton's second law: $$\begin{aligned} \boxed{ p_n \equiv \pdv{L}{\dot{q}_n} \qquad F_n \equiv \pdv{L}{q_n} } \qquad \implies \qquad \dv{p_n}{t} = F_n \end{aligned}$$ But this is actually a bit misleading, since $$p_n$$ need not be a momentum, nor $$F_n$$ a force, although often they are. For example, $$p_n$$ could be angular momentum, and $$F_n$$ torque. Another advantage of Lagrangian mechanics is that the conserved quantities can be extracted from $$L$$ using Noether's theorem. In the simplest case, if $$L$$ does not depend on $$q_n$$ (then known as a **cyclic coordinate**), then we know that the "momentum" $$p_n$$ is a conserved quantity: $$\begin{aligned} F_n = \pdv{L}{q_n} = 0 \qquad \implies \qquad \dv{p_n}{t} = 0 \end{aligned}$$ Now, as the number of particles $$N$$ increases to infinity, variational calculus will give infinitely many coupled equations, which is obviously impractical. Such a system can be regarded as continuous, so the $$N$$ functions $$q_n$$ can be replaced by a single density function $$u(x,t)$$. This approach can also be used for continuous fields, in which case the complex conjugate $$u^*$$ is often included. The Lagrangian $$L$$ then becomes: $$\begin{aligned} L(u, u^*, u_x, u_x^*, u_t, u_t^*, x, t) = \int_{-\infty}^\infty \mathcal{L}(u, u^*, u_x, u_x^*, u_t, u_t^*, x, t) \dd{x} \end{aligned}$$ Where $$\mathcal{L}$$ is known as the **Lagrangian density**. By inserting this into the functional $$J$$ used for the derivation of the Euler-Lagrange equations, we get: $$\begin{aligned} J[u] = \int_{t_0}^{t_1} L \dd{t} = \int_{t_0}^{t_1} \! \int_{-\infty}^\infty \mathcal{L} \dd{x} \dd{t} \end{aligned}$$ This is simply 2D variational problem, so the Euler-Lagrange equations will be two PDEs: $$\begin{aligned} 0 &= \pdv{\mathcal{L}}{u} - \pdv{}{x}\Big( \pdv{\mathcal{L}}{u_x} \Big) - \pdv{}{t}\Big( \pdv{\mathcal{L}}{u_t} \Big) \\ 0 &= \pdv{\mathcal{L}}{u^*} - \pdv{}{x}\Big( \pdv{\mathcal{L}}{u_x^*} \Big) - \pdv{}{t}\Big( \pdv{\mathcal{L}}{u_t^*} \Big) \end{aligned}$$ If $$\mathcal{L}$$ is real, then these two Euler-Lagrange equations will in fact be identical. Finally, note that for abstract fields, the Lagrangian density $$\mathcal{L}$$ rarely has a physical interpretation, and is not unique. Instead, it must be reverse-engineered from a relevant equation. ## References 1. R. Shankar, *Principles of quantum mechanics*, 2nd edition, Springer.