Skip to main content
Chemistry LibreTexts

1.2: The Hamiltonian formulation of classical mechanics

  • Page ID
    5099
  • \( \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}}\)

    The Lagrangian formulation of mechanics will be useful later when we study the Feynman path integral. For our purposes now, the Lagrangian formulation is an important springboard from which to develop another useful formulation of classical mechanics known as the Hamiltonian formulation. The Hamiltonian of a system is defined to be the sum of the kinetic and potential energies expressed as a function of positions and their conjugate momenta. What are conjugate momenta?

    Recall from elementary physics that momentum of a particle, \(P_i\), is defined in terms of its velocity \(\dot {r}_i\) by

    \[ p_i = m_i \dot {r} _i \nonumber \]

    In fact, the more general definition of conjugate momentum, valid for any set of coordinates, is given in terms of the Lagrangian:

    \[ p_i = \frac {\partial L}{\partial \dot {r} _i } \nonumber \]

    Note that these two definitions are equivalent for Cartesian variables. In terms of Cartesian momenta, the kinetic energy is given by

    \[ K = \sum _{i=1}^N \frac {P^2_i}{2 m_i} \nonumber \]

    Then, the Hamiltonian, which is defined to be the sum, \(K + U \), expressed as a function of positions and momenta, will be given by

    \[ H (p, r) = \sum _{i=1}^N \frac {P^2_i}{2m_i} + U ( r_1, \cdots , r_N) = H (p, r) \nonumber \]

    where \(p \equiv p_1, \cdots , p_N \). In terms of the Hamiltonian, the equations of motion of a system are given by Hamilton's equations:

    \[ \dot {r} _i = \frac {\partial H}{\partial p_i} \dot {p}_i = - \frac {\partial H}{\partial r_i} \nonumber \]

    The solution of Hamilton's equations of motion will yield a trajectory in terms of positions and momenta as functions of time. Again, Hamilton's equations can be easily shown to be equivalent to Newton's equations, and, like the Lagrangian formulation, Hamilton's equations can be used to determine the equations of motion of a system in any set of coordinates.

    The Hamiltonian and Lagrangian formulations possess an interesting connection. The Hamiltonian can be directly obtained from the Lagrangian by a transformation known as a Legendre transform. We will say more about Legendre transforms in a later lecture. For now, note that the connection is given by

    \[ H (p, r) = \sum _{i=1}^N p_i \cdot \dot {r}_i - L (r , \dot {r} ) \nonumber \]

    which, when the fact that \(\dot {r}_i = \frac {p_i}{m_i} \) is used, becomes

    \[H (p, r)= \sum _{i=1}^N p_i \cdot \frac {p_i}{m_i} - \sum _{i=1}^N \frac {1}{2} m_i \left (\frac {p_i}{m_i} \right )^2 + U (r_1, \cdots , r_N ) \nonumber \]

    \[= \sum _{i=1}^N \frac {P_i^2}{2m_i} + U(r_1, \cdots , r_N ) \nonumber \]

    Because a system described by conservative forces conserves the total energy, it follows that Hamilton's equations of motion conserve the total Hamiltonian. Hamilton's equations of motion conserve the Hamiltonian

    \[ H (p (t), r (t) ) = H (p(0), r (0) ) = E \nonumber \]

    Proof

    \(H = \text {const} \Rightarrow \frac {dH}{dt} = 0 \)

    \[\frac {dH}{dt}= \sum _{i=1}^N \left ( \frac {\partial H}{\partial r_i} \cdot \dot {r} _i + \frac {\partial H}{\partial p_i} \cdot \dot {p} _i \right ) \nonumber \]

    \[=\sum _{i=1}^N \left ( \frac {\partial H}{\partial r_i} \cdot \frac {\partial H}{\partial p_i} - \frac {\partial H}{\partial p_i} \cdot \frac {\partial H}{\partial r_i} \right ) = 0 \nonumber \]

    QED. This, then, provides another expression of the law of conservation of energy.


    This page titled 1.2: The Hamiltonian formulation of classical mechanics is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Mark Tuckerman.