3.3. Lagrangian formulation of classical mechanics

\label{sec-classmech-lagrange}

While Newton’s second law of motion is familiar and intuitive, in the centuries after Newton proposed his laws, more powerful frameworks for expressing these laws were discovered. These are, for example, useful for working in different coordinate systems—including systems where positions and velocities get mixed up—they simplify the discussion of the equilibria of galactic systems, and they are helpful in designing efficient numerical algorithms for gravitational dynamics. These are all topics that we will discuss in the coming chapters. In this and the next section, we provide a brief overview of the tools of these alternative frameworks: Lagrangian and Hamiltonian mechanics.

The Lagrangian re-formulation of classical mechanics starts with Hamilton’s principle:

Hamilton’s principle: The motion of a system from time \(t_1\) to time \(t_2\) is such that the action integral \begin{equation}\label{eq-classmech-actionintegral} S = \int_{t_1}^{t_2}\mathrm{d}t \,\mathcal{L}\,, \end{equation} where \(\mathcal{L}(\vec{x},\dot{\vec{x}},t) = T-V\) is the Lagrangian, has an extremal value for the actual path of the system.

Using the Euler-Lagrange equation from the calculus of variations (Appendix B.2), we find that the trajectory is extremal if and only if \begin{equation} \frac{\mathrm{d}}{\mathrm{d} t}\left(\frac{\partial \mathcal{L}}{\partial \dot{\vec{x}}}\right)-\frac{\partial \mathcal{L}}{\partial \vec{x}} = 0\,. \end{equation} Using the definition of the Lagrangian, kinetic, and potential energy, this is equivalent to \begin{equation} \frac{\mathrm{d}}{\mathrm{d} t}\left( m\dot{\vec{x}}\right) = - \frac{\partial V}{\partial \vec{x}} \,, \end{equation} which is exactly Newton’s second law of motion. Thus, Hamilton’s principle is equivalent to Newton’s second law.

What makes Hamilton’s principle so powerful is that it involves scalar quantities (the action \(S\) and the Lagrangian \(\mathcal{L}\)) rather than the vector quantities (forces and momenta) that appear in Newton’s second law. This makes it far easier to derive the correct equations of motion in different coordinate systems, because it is typically more straightforward to re-write the Lagrangian in an alternative, generalized coordinate system \((\vec{q},\dot{\vec{q}},t)\) as \(\mathcal{L}(\vec{q},\dot{\vec{q}},t)\) than it is to directly transform Newton’s second (vector) law of motion to a different coordinate system. The Euler-Lagrange equation remains the same, and thus in a generalized coordinate system we have the following Lagrange equations \begin{equation}\label{eq-lagrange} \frac{\mathrm{d}}{\mathrm{d} t}\left(\frac{\partial \mathcal{L}}{\partial \dot{\vec{q}}}\right)-\frac{\partial \mathcal{L}}{\partial\vec{q}} = 0\,. \end{equation} Working out this equation in an alternative coordinate system then directly provides the equations of motion.

As an example, we can derive the equations of motion for a three-dimensional system in cylindrical coordinates \((R,\phi,z)\) using the Lagrangian formalism. Because galaxies are close to axisymmetric (symmetric with respect to rotations around the direction of their angular momentum vector), cylindrical coordinates are often used to study galactic dynamics. Directly deriving these from Newton’s second law would require working out how to compute the acceleration and the potential gradient in cylindrical coordinates, which is quite tedious. However, in the Lagrangian formalism we simply write down the Lagrangian and use Equation (3.20). In cylindrical coordinates \((R,\phi,z)\) we have that (see Appendix A.1) \begin{align} x & = R\,\cos \phi\,;\quad y = R\,\sin \phi\,;\quad z = z \end{align} and that the velocities are \begin{align} \dot{x} & = \dot{R}\,\cos \phi - R\,\dot{\phi}\,\sin \phi\,;\quad \dot{y} = \dot{R}\,\sin \phi + R\,\dot{\phi}\,\cos \phi\,;\quad \dot{z} = \dot{z}\,. \end{align} The kinetic energy is therefore \begin{equation} \frac{m}{2}\,\left(\dot{x}^2 + \dot{y}^2 + \dot{z}^2\right) = \frac{m}{2}\,\left(\dot{R}^2 + R^2\,\dot{\phi}^2 +\dot{z}^2\right)\,, \end{equation} and the Lagrangian is \begin{equation}\label{eq-classmech-lagrangian-cyl} \mathcal{L} = T-V = \frac{m}{2}\,\left(\dot{R}^2 + R^2\,\dot{\phi}^2 + \dot{z}^2\right) - m\Phi(R,\phi,z)\,. \end{equation} Equation (3.20) applied to \(R\), \(\phi\), and \(z\) then gives the equations of motion \begin{align}\label{eq-classmech-lagrangian-cyl-eom} \ddot{R}- R\,\dot{\phi}^2& =-\frac{\partial \Phi}{\partial R} \,;\quad \frac{\mathrm{d}}{\mathrm{d} t}\left(R^2\,\dot{\phi}\right) = -\frac{\partial \Phi}{\partial \phi}\,;\quad \ddot{z} =-\frac{\partial \Phi}{\partial z} \,. \end{align} These are the equations of motion in cylindrical coordinates.

Because Newton’s second law relates the time derivative of the momentum to the force, in the Lagrangian formalism it makes sense to associate a generalized momentum (also known as conjugate momentum) \(\vec{p}\) with generalized coordinates \(\vec{q}\) as \begin{equation}\label{eq-gen-momentum} \vec{p} = \frac{\partial \mathcal{L}}{\partial \dot{\vec{q}}}\,, \end{equation} because the Euler-Lagrange equation then becomes \begin{equation}\label{eq-lagrange-in-terms-of-gen-momentum} \dot{\vec{p}} = \frac{\partial \mathcal{L}}{\partial \vec{q}}\,. \end{equation} This form is reminiscent of Newton’s second law. What this form of the Euler-Lagrange equation makes particularly clear is that if a generalized coordinate component \(q_j\) does not appear in the Lagrangian, then its associated generalized momentum component is conserved; such a coordinate is known as a cyclic coordinate. This means that an inspection of the Lagrangian in a well-chosen coordinate frame can reveal a system’s conserved quantities. This statement is closely related to Noether’s theorem, which states that if a system has a continuous symmetry property, then there are corresponding quantities whose values are conserved in time. For example, in the example of cylindrical coordinates above, if the potential does not depend on \(\phi\), its associated momentum \(p_\phi = \partial \mathcal{L}/\partial \dot{\phi} = mR^2\,\dot{\phi}\) is conserved. The momentum \(p_\phi\) is the \(z\) component of the angular momentum in this case and it is conserved by virtue of the rotational symmetry of the potential. Note that the units of the generalized momentum are not necessarily the same as those of the regular, linear momentum \(\vec{p} = m\vec{v}\). In the context of Hamiltonian mechanics, the generalized momentum is also known as the canonical momentum.