# 7.13: Hamiltonian in Classical Mechanics

$$\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}}$$

$$\newcommand{\vectorA}[1]{\vec{#1}} % arrow$$

$$\newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow$$

$$\newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vectorC}[1]{\textbf{#1}}$$

$$\newcommand{\vectorD}[1]{\overrightarrow{#1}}$$

$$\newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}}$$

$$\newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}}$$

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

$$\newcommand{\avec}{\mathbf a}$$ $$\newcommand{\bvec}{\mathbf b}$$ $$\newcommand{\cvec}{\mathbf c}$$ $$\newcommand{\dvec}{\mathbf d}$$ $$\newcommand{\dtil}{\widetilde{\mathbf d}}$$ $$\newcommand{\evec}{\mathbf e}$$ $$\newcommand{\fvec}{\mathbf f}$$ $$\newcommand{\nvec}{\mathbf n}$$ $$\newcommand{\pvec}{\mathbf p}$$ $$\newcommand{\qvec}{\mathbf q}$$ $$\newcommand{\svec}{\mathbf s}$$ $$\newcommand{\tvec}{\mathbf t}$$ $$\newcommand{\uvec}{\mathbf u}$$ $$\newcommand{\vvec}{\mathbf v}$$ $$\newcommand{\wvec}{\mathbf w}$$ $$\newcommand{\xvec}{\mathbf x}$$ $$\newcommand{\yvec}{\mathbf y}$$ $$\newcommand{\zvec}{\mathbf z}$$ $$\newcommand{\rvec}{\mathbf r}$$ $$\newcommand{\mvec}{\mathbf m}$$ $$\newcommand{\zerovec}{\mathbf 0}$$ $$\newcommand{\onevec}{\mathbf 1}$$ $$\newcommand{\real}{\mathbb R}$$ $$\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}$$ $$\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}$$ $$\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}$$ $$\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}$$ $$\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}$$ $$\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}$$ $$\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}$$ $$\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}$$ $$\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}$$ $$\newcommand{\laspan}[1]{\text{Span}\{#1\}}$$ $$\newcommand{\bcal}{\cal B}$$ $$\newcommand{\ccal}{\cal C}$$ $$\newcommand{\scal}{\cal S}$$ $$\newcommand{\wcal}{\cal W}$$ $$\newcommand{\ecal}{\cal E}$$ $$\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}$$ $$\newcommand{\gray}[1]{\color{gray}{#1}}$$ $$\newcommand{\lgray}[1]{\color{lightgray}{#1}}$$ $$\newcommand{\rank}{\operatorname{rank}}$$ $$\newcommand{\row}{\text{Row}}$$ $$\newcommand{\col}{\text{Col}}$$ $$\renewcommand{\row}{\text{Row}}$$ $$\newcommand{\nul}{\text{Nul}}$$ $$\newcommand{\var}{\text{Var}}$$ $$\newcommand{\corr}{\text{corr}}$$ $$\newcommand{\len}[1]{\left|#1\right|}$$ $$\newcommand{\bbar}{\overline{\bvec}}$$ $$\newcommand{\bhat}{\widehat{\bvec}}$$ $$\newcommand{\bperp}{\bvec^\perp}$$ $$\newcommand{\xhat}{\widehat{\xvec}}$$ $$\newcommand{\vhat}{\widehat{\vvec}}$$ $$\newcommand{\uhat}{\widehat{\uvec}}$$ $$\newcommand{\what}{\widehat{\wvec}}$$ $$\newcommand{\Sighat}{\widehat{\Sigma}}$$ $$\newcommand{\lt}{<}$$ $$\newcommand{\gt}{>}$$ $$\newcommand{\amp}{&}$$ $$\definecolor{fillinmathshade}{gray}{0.9}$$

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.