Skip to main content
Physics LibreTexts

7.13: Hamiltonian in Classical Mechanics

  • 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 Hamiltonian was defined by equation \((7.7.6)\) during the discussion of time invariance and energy conservation. The Hamiltonian is of much more profound importance to physics than implied by the ad hoc definition given by equation \((7.7.6)\). This relates to the fact that the Hamiltonian is written in terms of the fundamental coordinate \( q_{i}\) and its generalized momentum \(p_{i}\) defined by equation \((7.2.3)\).

    It is more convenient to write the \(n\) generalized coordinates \(q_{i},\) plus their generalized momentum \(p_{i},\) as vectors, e.g. \(\mathbf{q}\equiv (q_{1},q_{2},..q_{n})\), \(\mathbf{p}\equiv (p_{1},p_{2},..p_{n})\). The generalized momenta conjugate to the coordinate \(q_{i}\), defined by \((7.2.3)\), then can be written in the form \[p_{i}= \frac{\partial L(\mathbf{q,\dot{q},t)}}{\partial \dot{q}_{i}}\]

    Substituting this definition of the generalized momentum into the Hamiltonian defined in \((7.7.6)\), and expressing it in terms of the coordinate \(\mathbf{q}\) and its conjugate generalized momenta \(\mathbf{p}\), leads to

    \[\begin{aligned} H\left( \mathbf{q},\mathbf{p},t\right) &= \sum_{i}p_{i}\dot{q}_{i}-L(\mathbf{ q},\mathbf{\dot{q}},t) \\ &= \mathbf{p\cdot \dot{q}-}L(\mathbf{q},\mathbf{\dot{q}},t)\end{aligned}\]

    Note that the scalar product \(\mathbf{p\cdot \dot{q}=}\sum_{i}p_{i}\dot{q} _{i}\) equals \(2T\) for systems that are scleronomic and when the potential is velocity independent.

    The crucial feature of the Hamiltonian is that it is expressed as \(H\left( \mathbf{q},\mathbf{p},t\right) ,\) that is, it is a function of the \(n\) generalized coordinates \(\mathbf{q}\) and their conjugate momenta \(\mathbf{p}\), which are taken to be independent, in addition to the independent variable, \(t\). This is in contrast to the Lagrangian \(L(\mathbf{q},\mathbf{ \dot{q}},t)\) which is a function of the \(n\) generalized coordinates \(q_{j}\), the corresponding velocities \(\dot{q}_{j}\), and time \(t.\) The velocities \( \mathbf{\dot{q}}\) are the time derivatives of the coordinates \(\mathbf{q}\) and thus these are related. In physics, the fundamental conjugate coordinates are \((\mathbf{q,p}),\) which are the coordinates underlying the Hamiltonian. This is in contrast to \((\mathbf{q,\dot{q}})\) which are the coordinates that underlie the Lagrangian. Thus the Hamiltonian is more fundamental than the Lagrangian and is a reason why the Hamiltonian mechanics, rather than the Lagrangian mechanics, was used as the foundation for development of quantum and statistical mechanics.

    Hamiltonian mechanics will be derived two other ways. Chapter \(8\) uses the Legendre transformation between the conjugate variables \(\left( \mathbf{q}, \mathbf{\dot{q}},t\right)\) and \(\left( \mathbf{q},\mathbf{p},t\right)\) where the generalized coordinate \(\mathbf{q}\) and its conjugate generalized momentum, \(\mathbf{p}\) are independent. This shows that Hamiltonian mechanics is based on the same variational principles as those used to derive Lagrangian mechanics. Chapter \(9\) derives Hamiltonian mechanics directly from Hamilton’s Principle of Least action. Chapter \(8\) will introduce the algebraic Hamiltonian mechanics, that is based on the Hamiltonian. The powerful capabilities provided by Hamiltonian mechanics will be described in chapter \(15\).

    This page titled 7.13: Hamiltonian in Classical Mechanics 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.