Skip to main content
Library homepage
Physics LibreTexts

8.3: Hamilton’s Equations of Motion

  • Page ID
  • \( \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 explicit form of the Legendre transform \((8.2.6)\) gives that the time derivative of the generalized coordinate \(q_{j}\) is

    \[\dot{q}_{j}\mathbf{=}\frac{\partial H(\mathbf{q,p,}t)}{\partial p_{j}}\label{8.15}\]

    The Euler-Lagrange equation \((6.6.1)\) is

    \[\frac{d}{dt}\frac{\partial L}{\partial \dot{q}_{j}}-\frac{\partial L}{ \partial q_{j}}=\sum_{k=1}^{m}\lambda _{k}\frac{\partial g_{k}}{\partial q_{j}}+Q_{j}^{EXC}\label{8.16}\]

    This gives the corresponding Hamilton equation for the time derivative of \(p_{i}\) to be

    \[\frac{d}{dt}\frac{\partial L}{\partial \dot{q}_{j}}=\dot{p}_{j}=\frac{ \partial L}{\partial q_{j}}+\sum_{k=1}^{m}\lambda _{k}\frac{\partial g_{k}}{ \partial q_{j}}+Q_{j}^{EXC}\label{8.17}\]

    Substitute equation \((8.2.9)\) into Equation \ref{8.17} leads to the second Hamilton equation of motion \[\dot{p}_{j}=-\frac{\partial H(\mathbf{q,p,}t)}{\partial q_{j}} +\sum_{k=1}^{m}\lambda _{k}\frac{\partial g_{k}}{\partial q_{j}}+Q_{j}^{EXC}\label{8.18}\]

    One can explore further the implications of Hamiltonian mechanics by taking the time differential of \((8.1.3)\) giving.

    \[\frac{dH(\mathbf{q,p,}t)}{dt}=\sum_{j}\left( \dot{q}_{j}\frac{dp_{j} }{dt}+p_{j}\frac{d\dot{q}_{j}}{dt}-\frac{\partial L}{\partial q_{j}}\frac{ dq_{j}}{dt}-\frac{\partial L}{\partial \dot{q}_{j}}\frac{d\dot{q}_{j}}{dt} \right) -\frac{\partial L}{\partial t}\label{8.19}\]

    Inserting the conjugate momenta \(p_{i}\equiv \frac{\partial L}{\partial \dot{ q}_{i}}\) and Equation \ref{8.17} into Equation \ref{8.19} results in

    \[\frac{dH(\mathbf{q,p,}t)}{dt}=\sum_{j}\left( \dot{q}_{j}\dot{p} _{j}+p_{j}\frac{d\dot{q}_{j}}{dt}-\left[ \dot{p}_{j}-\sum_{k=1}^{m}\lambda _{k}\frac{\partial g_{k}}{\partial q_{j}}-Q_{j}^{EXC}\right] \dot{q} _{j}-p_{j}\frac{d\dot{q}_{j}}{dt}\right) -\frac{\partial L}{\partial t}\label{8.20}\] The second and fourth terms cancel as well as the \(\dot{q}_{j}\dot{p}_{j}\) terms, leaving

    \[\frac{dH(\mathbf{q,p,}t)}{dt}=\sum_{j}\left( \left[ \sum_{k=1}^{m}\lambda _{k}\frac{\partial g_{k}}{\partial q_{j}}+Q_{j}^{EXC} \right] \dot{q}_{j}\right) -\frac{\partial L}{\partial t}\label{8.21}\]

    This is the generalized energy theorem given by equation \((7.8.1)\).

    The total differential of the Hamiltonian also can be written as

    \[\frac{dH(\mathbf{q,p,}t)}{dt}=\sum_{j}\left( \frac{\partial H}{ \partial p_{j}}\dot{p}_{j}+\frac{\partial H}{\partial q_{j}}\dot{q} _{j}\right) +\frac{\partial H}{\partial t}\label{8.22}\]

    Use equations \ref{8.15} and \ref{8.18} to substitute for \(\frac{\partial H}{ \partial p_{j}}\) and \(\frac{\partial H}{\partial q_{j}}\) in Equation \ref{8.22} gives

    \[\frac{dH(\mathbf{q,p,}t)}{dt}=\sum_{j}\left( \left[ \sum_{k=1}^{m}\lambda _{k}\frac{\partial g_{k}}{\partial q_{j}}+Q_{j}^{EXC} \right] \dot{q}_{j}\right) +\frac{\partial H(\mathbf{q,p,}t)}{ \partial t}\label{8.23}\]

    Note that Equation \ref{8.23} must equal the generalized energy theorem, i.e. Equation \ref{8.21}. Therefore,

    \[\frac{\partial H}{\partial t}=-\frac{\partial L}{\partial t}\label{8.24}\]

    In summary, Hamilton’s equations of motion are given by

    \[\begin{align} \dot{q}_{j} &= \frac{\partial H(\mathbf{q,p,}t)}{\partial p_{j}} \label{8.25}\\[4pt] \dot{p}_{j} &=-\frac{\partial H(\mathbf{q,p,}t)}{\partial q_{j}}+ \left[ \sum_{k=1}^{m}\lambda _{k}\frac{\partial g_{k}}{\partial q_{j}} +Q_{j}^{EXC}\right] \label{8.26}\\[4pt] \frac{dH(\mathbf{q,p,}t)}{dt} &= \sum_{j}\left( \left[ \sum_{k=1}^{m}\lambda _{k}\frac{\partial g_{k}}{\partial q_{j}}+Q_{j}^{EXC} \right] \dot{q}_{j}\right) -\frac{\partial L(\mathbf{q,\dot{q},}t)}{ \partial t}\label{8.27}\end{align}\]

    The symmetry of Hamilton’s equations of motion is illustrated when the Lagrange multiplier and generalized forces are zero. Then

    \[\begin{align} \dot{q}_{j} &= \frac{\partial H(\mathbf{q,p,}t)}{\partial p_{j}} \label{8.28}\\[4pt] \dot{p}_{j} &= -\frac{\partial H(\mathbf{p,q},t)}{\partial q_{j}} \label{8.29}\\[4pt] \frac{dH(\mathbf{p,q},t)}{dt} &= \frac{\partial H(\mathbf{p,q},t )}{\partial t}=-\frac{\partial L(\mathbf{\dot{q},q,}t)}{ \partial t}\end{align}\label{8.30}\]

    This simplified form illustrates the symmetry of Hamilton’s equations of motion. Many books present the Hamiltonian only for this special simplified case where it is holonomic, conservative, and generalized coordinates are used.

    Canonical Equations of Motion

    Hamilton’s equations of motion, summarized in equations \ref{8.25}-\ref{8.27} use either a minimal set of generalized coordinates, or the Lagrange multiplier terms, to account for holonomic constraints, or generalized forces \(Q_{j}^{EXC}\) to account for non-holonomic or other forces. Hamilton’s equations of motion usually are called the canonical equations of motion. Note that the term "canonical" has nothing to do with religion or canon law; the reason for this name has bewildered many generations of students of classical mechanics. The term was introduced by Jacobi in \(1837\) to designate a simple and fundamental set of conjugate variables and equations. Note the symmetry of Hamilton’s two canonical equations, plus the fact that the canonical variables \(p_{k},q_{k}\) are treated as independent canonical variables. The Lagrange mechanics coordinates \((\mathbf{q, \dot{q},}t)\) are replaced by the Hamiltonian mechanics coordinates \((\mathbf{ q,p,}t),\) where the conjugate momenta \(\mathbf{p}\) are taken to be independent of the coordinate \(\mathbf{q}\).

    Lagrange was the first to derive the canonical equations but he did not recognize them as a basic set of equations of motion. Hamilton derived the canonical equations of motion from his fundamental variational principle, chapter \(9.2\), and made them the basis for a far-reaching theory of dynamics. Hamilton’s equations give \(2s\) first-order differential equations for \(p_{k},q_{k}\) for each of the \(s=n-m\) degrees of freedom. Lagrange’s equations give \(s\) second-order differential equations for the \(s\) independent generalized coordinates \(q_{k},\dot{q}_{k}.\)

    It has been shown that \(H(\mathbf{p,q},t)\) and \(L(\mathbf{\dot{q},q, }t)\) are the Legendre transforms of each other. Although the Lagrangian formulation is ideal for solving numerical problems in classical mechanics, the Hamiltonian formulation provides a better framework for conceptual extensions to other fields of physics since it is written in terms of the fundamental conjugate coordinates, \(\mathbf{q,p}\). The Hamiltonian is used extensively in modern physics, including quantum physics, as discussed in chapters \(15\) and \(18\). For example, in quantum mechanics there is a straightforward relation between the classical and quantal representations of momenta; this does not exist for the velocities.

    The concept of state space, introduced in chapter \(3.3.2\), applies naturally to Lagrangian mechanics since \((\dot{q},q)\) are the generalized coordinates used in Lagrangian mechanics. The concept of Phase Space, introduced in chapter \(3.3.3\), naturally applies to Hamiltonian phase space since \((p,q)\) are the generalized coordinates used in Hamiltonian mechanics.

    This page titled 8.3: Hamilton’s Equations of Motion 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.