Skip to main content
Physics LibreTexts

15.8: Comparison of the Lagrangian and Hamiltonian Formulations

  • Page ID
    14243
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Common features

    The discussion of Lagrangian and Hamiltonian dynamics has illustrated the power of such algebraic formulations. Both approaches are based on application of variational principles to scalar energy which gives the freedom to concentrate solely on active forces and to ignore internal forces. Both methods can handle manybody systems and exploit canonical transformations, which are impractical or impossible using the vectorial Newtonian mechanics. These algebraic approaches simplify the calculation of the motion for constrained systems by representing the vector force fields, as well as the corresponding equations of motion, in terms of either the Lagrangian function \(L(\mathbf{q}, \mathbf{\dot{q}}, t)\) or the action functional \(S(\mathbf{q},\mathbf{p},t)\) which are related by the definite integral

    \[S(\mathbf{q},\mathbf{p},t) = \int^{t_2}_{t_1} L(\mathbf{q}, \mathbf{\dot{q}}, t)dt \label{15.1}\]

    The Lagrangian function \(L(\mathbf{q}, \mathbf{\dot{q}}, t)\), and the action functional \(S(\mathbf{q},\mathbf{p},t)\), are scalar functions under rotation, but they determine the vector force fields and the corresponding equations of motion. Thus the use of rotationally-invariant functions \(L(\mathbf{q}, \mathbf{\dot{q}}, t)\) and \(S(\mathbf{q},\mathbf{p},t)\) provide a simple representation of the vector force fields. This is analogous to the use of scalar potential fields \(\phi (\mathbf{q}, t)\) to represent the electrostatic and gravitational vector force fields. Like scalar potential fields, Lagrangian and Hamiltonian mechanics represents the observables as derivatives of \(L(\mathbf{q}, \mathbf{\dot{q}}, t)\) and \(S(\mathbf{q},\mathbf{p},t)\), and the absolute values of \(L(\mathbf{q}, \mathbf{\dot{q}}, t)\) and \(S(\mathbf{q},\mathbf{p},t)\) are undefined; only differences in \(L(\mathbf{q}, \mathbf{\dot{q}}, t)\) and \(S(\mathbf{q},\mathbf{p},t)\) are observable. For example, the generalized momenta are given by the derivatives \(p_i \equiv \frac{\partial L}{ \partial \dot{q}_i}\) and \(p_j = \frac{\partial S }{\partial q_j }\). The physical significance of the least action \(S(\mathbf{q}, \boldsymbol{\alpha},t)\) is illustrated when the canonically transformed momenta \(\mathbf{P} = \boldsymbol{\alpha}\) is a constant. Then the generalized momenta and the Hamilton-Jacobi equation, imply that the total time derivative of the action equals

    \[\frac{dS}{ dt} = \frac{\partial S}{ \partial q_i} \dot{q}_i + \frac{\partial S}{ \partial t} = p_iq_i − H = L \label{15.154}\]

    The indefinite integral of this equation reproduces the definite integral \ref{15.1} to within an arbitrary constant, i.e.

    \[S(\mathbf{q}, \mathbf{p}) = \int L(\mathbf{q}, \mathbf{\dot{q}}, t)dt + \text{ constant} \label{15.155}\]

    Lagrangian Formulation

    Consider a system with \(n\) independent generalized coordinates, plus \(m\) constraint forces that are not required to be known. The Lagrangian approach can reduce the system to a minimal system of \(s = n − m\) independent generalized coordinates leading to \(s = n - m\) second-order differential equations. By comparison, the Newtonian approach uses \(n + m\) unknowns. Alternatively, the Lagrange multipliers approach allows determination of the holonomic constraint forces resulting in \(s = n + m\) second order equations to determine \(s = n + m\) unknowns. The Lagrangian potential function is limited to conservative forces, but generalized forces can be used to handle non-conservative and non-holonomic forces. The advantage of the Lagrange equations of motion is that they can deal with any type of force, conservative or non-conservative, and they directly determine \(q, \dot{q}\) rather than \(q,p\) which then requires relating \(p\) to \(\dot{q}\). The Lagrange approach is superior to the Hamiltonian approach if a numerical solution is required for typical undergraduate problems in classical mechanics. However, Hamiltonian mechanics has a clear advantage for addressing more profound and philosophical questions in physics.

    Hamiltonian Formulation

    For a system with \(n\) independent generalized coordinates, and \(m\) constraint forces, the Hamiltonian approach determines \(2n\) first-order differential equations. In contrast to Lagrangian mechanics, where the Lagrangian is a function of the coordinates and their velocities, the Hamiltonian uses the variables \(\mathbf{q}\) and \(\mathbf{p}\), rather than velocity. The Hamiltonian has twice as many independent variables as the Lagrangian which is a great advantage, not a disadvantage, since it broadens the realm of possible transformations that can be used to simplify the solutions. Hamiltonian mechanics uses the conjugate coordinates \(\mathbf{q},\mathbf{p}\), corresponding to phase space. This is an advantage in most branches of physics and engineering. Compared to Lagrangian mechanics, Hamiltonian mechanics has a significantly broader arsenal of powerful techniques that can be exploited to obtain an analytical solution of the integrals of the motion for complicated systems. These techniques include, the Poisson bracket formulation, canonical transformations, the Hamilton-Jacobi approach, the action-angle variables, and canonical perturbation theory. In addition, Hamiltonian dynamics provides a means of determining the unknown variables for which the solution assumes a soluble form, and it is ideal for study of the fundamental underlying physics in applications to other fields such as quantum or statistical physics. However, the Hamiltonian approach endemically assumes that the system is conservative putting it at a disadvantage with respect to the Lagrangian approach. The appealing symmetry of the Hamiltonian equations, plus their ability to utilize canonical transformations, makes it the formalism of choice for examination of system dynamics. For example, Hamilton-Jacobi theory, action-angle variables and canonical perturbation theory are used extensively to solve complicated multibody orbit perturbations in celestial mechanics by finding a canonical transformation that transforms the perturbed Hamiltonian to a solved unperturbed Hamiltonian.

    The Hamiltonian formalism features prominently in quantum mechanics since there are well established rules for transforming the classical coordinates and momenta into linear operators used in quantum mechanics. The variables \(\mathbf{q}, \mathbf{\dot{q}}\) used in Lagrangian mechanics do not have simple analogs in quantum physics. As a consequence, the Poisson bracket formulation, and action-angle variables of Hamiltonian mechanics played a key role in development of matrix mechanics by Heisenberg, Born, and Dirac, while the Hamilton-Jacobi formulation played a key role in development of Schrödinger’s wave mechanics. Similarly, Hamiltonian mechanics is the preeminent variational approached used in statistical mechanics.


    This page titled 15.8: Comparison of the Lagrangian and Hamiltonian Formulations is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Douglas Cline via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.