Hamiltonian Mechanics

This discussion is adapted from the following reference:

Susskind, L. and Hrabovsky, G. (2014). The Theoretical Minimum: What You Need to Know to Start Doing Physics. 1st ed. Basic Books, pp. 148-160.

It can be found here.

We introduced, in a separate article, the concept of the Lagrangian. Suppose we want to see how the Lagrangian evolves with time. This can be expressed mathematically as follows:

(1)   \begin{equation*}\frac{dL}{dt}=\displaystyle\sum_i\left( \frac{\partial L}{\partial q_i}\frac{d q_i}{dt}+\frac{\partial L}{\partial \dot{q_i}}\frac{d \dot{q_i}}{dt}\right)=\displaystyle\sum_i\left( \frac{\partial L}{\partial q_i}\dot{q_i}}+\frac{\partial L}{\partial \dot{q_i}}\ddot{q_i}\right)\end{equation*}

The Lagrangian above has no explicit dependence on time. However, there is nothing to say that this has to be the case. If we examine the time evolution of a Lagrangian with time dependence, equation 1 becomes:

(2)   \begin{equation*}\frac{dL}{dt}=\displaystyle\sum_i\left( \frac{\partial L}{\partial q_i}\dot{q_i}}+\frac{\partial L}{\partial \dot{q_i}}\ddot{q_i}\right)+\frac{\partial L}{\partial t}\end{equation*}

Let’s look at the terms on the right-hand side of the equation individually. First, terms in the Lagrangian that depend on the partial derivative of q_i involve the derivative of the potential energy which is equal to the negative of force. Force, in turn, is the derivative of the canonical momentum, p_i. For example, for the Lagrangian we’ve been working with, L=\frac12 m\dot{q_i}^2-V(q_i), \frac{\partial L}{\partial q_i}=-\frac{\partial V(q_i)}{\partial q_i}=-\text{force}=\dot{p}. Thus,

    \begin{equation*}\frac{\partial L}{\partial q_i}\dot{q_i}=-\dot{p_i}\dot{q_i}\end{equation*}

In the second term on the right-hand side, \frac{\partial L}{\partial \dot{q_i}}\ddot{q_i}, the only term in the Lagrangian that depends on \dot{q_i} is the kinetic energy term, \frac12 m \dot{q_i}^2. Therefore,

\frac{\partial L}{\partial \dot{q_i}}=\frac12 m \frac{d \ddot{q_i}^2}{d \dot{q_i}}=\frac12 m 2 \dot{q_i} = m\dot{q_i} =p_i

and

\frac{\partial L}{\partial \dot{q_i}}\ddot{q_i}=p_i\ddot{q_i}

Combining the above equations, we get

\frac{d L}{dt}=\displaystyle\sum_i(\dot{p_i}\dot{q_i} + p_i\ddot{q_i}) + \frac{\partial L}{\partial t}

By the the product rule of derivatives, the first two terms on the right side of the above equation can be simplified:

\displaystyle\sum_i(\dot{p_i}\dot{q_i} + p_i\ddot{q_i})=\frac{d}{dt}\displaystyle\sum_i(p_i\dot{q_i})

Thus, we’re left with

(3)   \begin{equation*}\frac{dL}{dt}=\frac{d}{dt}\displaystyle\sum_i(p_i\dot{q_i}) + \frac{\partial L}{\partial t}\end{equation*}

Next, define a new quantity called the Hamiltonian. Represent it mathematically by H. Define it as follows:

(4)   \begin{equation*}H=\displaystyle\sum_i(p_i\dot{q_i}) - L\end{equation*}

That means that \displaystyle\sum_i(p_i\dot{q_i})=H+L. Substitute this into equation 3:

\frac{d L}{d t}=\frac{d}{dt}\displaystyle\sum_i(p_i\dot{q_i}) + \frac{\partial L}{\partial t}

\frac{d L}{d t}=\frac{d}{dt}(H + L) + \frac{\partial L}{\partial t}

\frac{d L}{d t}=\frac{dH}{dt} + \frac{dL}{dt} + \frac{\partial L}{\partial t} \quad \text{subtract } \frac{dL}{dt} \text{ from both sides}

0=\frac{d H}{d t} + \frac{\partial L}{\partial t} \quad \text{subtract } \frac{\partial L}{\partial t} \text{ from both sides}

(5)   \begin{equation*}\frac{d H}{d t}=-\frac{\partial L}{\partial t}\end{equation*}

What this indicates is that, if the Lagrangian contains a term or terms that are dependent on time, then the Hamiltonian varies with time. On the other hand, if the Lagrangian does not contain a term or terms that depend explicitly on time, then \frac{\partial L}{\partial t}=0 and \frac{d H}{d t}=0. That means that the the Hamiltonian does not change with time, which means that it’s constant, which means that it’s a so-called conserved quantity.

But what actually is the Hamiltonian. This next series of equations will make it’s nature clear.

To see this best, let’s return to our simple Lagrangian associated with a single particle moving through a potential energy field in one direction, the x-direction: L=\frac12 m \dot{x}^2 - V(x}

Recall that the momentum is given by p_i=m\dot{x}.

Substituting these values into equation 4, we have

\begin{array}{rcl}  H &=& p\dot{x}-L \\  &=& (m \dot{x}) \dot{x} - (\frac12 m \dot{x}^2 - V(x)) \\  &=& m \dot{x}^2 - \frac12 m \dot{x}^2 + V(x) \\  &=& \underbrace{\frac12 m \dot{x}^2}_{\text{kinetic energy}} + \underbrace{V(x)}_{\text{potential energy}}  \end{array}

But kinetic energy + potential energy equals the total kinetic energy of a system. Thus, the Hamiltonian represents the total energy of a system.

That the Hamiltonian represents the total energy of a system, in and of itself, is an important fact. However, its importance in physics ranges even further than this. Namely, its equations are functions of p_i, the momentum and q_i, position in space. This is in contradistinction to the Lagrangian formulation of classical physics which deals with functions of q_i only. The former leads to first-order differential equations, which are generally easier to solve, as opposed to the Lagrangian formulation which involves second-order differential equation. Also, because the Hamiltonian mechanics utilizes functions of momentum and position, it deals with phase space – a plot of position versus momentum – as opposed to Lagrangian physics, which utilizes configuration space – a plot of position versus time. Both yield the same results, results which agree with the Newtonian physics. They just approach the issues of classical physics from different angles.

Indeed, just as there are distinctive equations that characterize Newtonian mechanics and Lagrangian physics, the Hamilton formulation of classical physics is marked by characteristic equations of motion. We will derive them now. We’ll follow the lead of Dr. Susskind’s book and start with an intuitive argument involving one particle affected by a potential energy field moving in only one dimension.

We start with two equations:

p=m\dot{x}

H=\frac12 \dot{x}^2 + V(x)

Replace velocity with \frac{p}{m}. We get

H=\frac 12 m \frac{p^2}{m^2}+V(x)=\frac{p^2}{2m}+V(x)

Take the partial derivative of both sides with respect to x. The only term that depends on x on the right side of this equation is V(x). So,

\frac{\partial H}{\partial x} = \frac{\partial}{\partial x}(\frac{p^2}{2m}+V(x))=\frac{dV}{dx} which equals

-\text{Force}=-\text{mass }\times\text{acceleration}=-ma=-\dot{p}

Therefore,

(6)   \begin{equation*}\frac{\partial H}{\partial x} = -\dot{p}\end{equation*}

This is the first of the so-called Hamilton’s equations.

To derive the second, take the partial derivative of H with respect to p, the momentum:

\frac{\partial H}{\partial p}=\frac{\partial}{\partial p}(\frac{p^2}{2m}+V(x))=\frac{d \frac{p^2}{2m}}{dp}=\frac22\frac{p}{m}=\frac pm

But \frac pm=\text{velocity}=\dot{x}. Thus,

(7)   \begin{equation*}\frac{\partial H}{\partial p}=\dot{x}\end{equation*}

This is the second of Hamilton’s equations.

Here is the general derivation. Consider the Lagrangian written in terms of general coordinates:

L=L(q,\dot{q})

The Hamiltonian is

H=\displaystyle\sum_i(p_i\dot{q_i})-L

Now make an infinitesimal change (denoted by \delta) in H:

\begin{array}{rcl}  \delta H &=& \displaystyle\sum_i(p_i\delta \dot{q_i} + \dot{q_i}\delta p_i) - \delta L\\  &=& \displaystyle\sum_i \left( p_i \delta \dot{q_i} + \dot{q_i} \delta p_i - \frac{\partial L}{\partial q_i} \delta q_i - \frac{\partial L}{\partial \dot{q_i}} \delta \partial \dot{q_i} \right)  \end{array}

From Lagrangian mechanics, we have p_i = \frac {\partial L}{\partial \dot{q}}. We this expression into the first term of the equation above giving us \frac {\partial L}{\partial \dot{q}}\delta \dot{q_i}. This term cancels out with the fourth term in the above equation leaving us with:

\delta H = \displaystyle\sum_i \left(  \dot{q_i} \delta p_i - \frac{\partial L}{\partial q_i} \delta q_i  \right)

Let’s develop an expression for an infinitesimal change in H and compare it to this last equation:

\delta H(q_i,p_i) =  \displaystyle\sum_i \left( \frac{\partial H}{\partial p_i}\delta p_i + \frac{\partial H}{\partial q_i}\delta q_i  \right)

Comparison of these two equations reveals that:

(8)   \begin{equation*}\frac{\partial H}{\partial p_i}=\dot{q}\end{equation*}

and

(9)   \begin{equation*}\frac{\partial H}{\partial q_i} = -\frac{\partial L}{\partial \dot{q_i}}\end{equation*}

From Lagrangian mechanics, we know that \frac{\partial L}{\partial \dot{q_i}}=\dot{p_i}. Therefore,

(10)   \begin{equation*} \frac{\partial H}{\partial q_i}=-\dot{p_i}  \end{equation*}