7.2 Legendre Transform of the Lagrangian

Consider now the Lagrangian, \(L(q_i,\dot{q}_i,t)\), where we will consider the \(q_i\) as the passive variables, and the \(\dot{q}_i\) as the active variables. We introduce a new set of variables, \(p_i\), given by:

\begin{align} p_i\equiv\die{L}{\dot q_i} \tag{7.12}\end{align}

and we introduce a new function, \(H(q_i,p_i,t)\), called the Hamiltonian, which is the Legendre transform of the Lagrangian:

\begin{align} H(q_i,p_i,t)\equiv \sum_ip_i\dot q_i-L \tag{7.13}\end{align}

Again, consider the variation of the Hamiltonian:

\begin{align} \delta H &= \delta \left(\sum_ip_i\dot q_i-L \right)\\ &=\sum_i\left( p_i\delta \dot q_i + \dot q_i \delta p_i \right)-\sum_i\left(\die{L}{q_i}\delta q_i+\die{L}{\dot q_i}\delta \dot q_i\right)-\die{L}{t}\delta t \\ &=\sum_i\left( \dot q_i\delta p_i -\die{L}{q_i}\delta q_i \right)- \die{L}{t}\delta t \tag{7.14}\end{align}

Again, we can identify this with the variation of \(H(q_i,p_i,t)\):

\begin{align} \delta H = \sum_i\left(\die{H}{p_i} \delta p_i+\die{H}{q_i}\delta q_i \right)+\die{H}{t}\delta t \tag{7.15}\end{align}

to obtain:

\begin{align} \dot q_i&=\die{H}{p_i} \\ \die{H}{q_i}&=-\die{L}{q_i} \\ \die{H}{t}&=-\die{L}{t} \tag{7.16}\end{align}

Note that the Hamiltonian can and must always be written explicitly only in terms of the generalized momenta and the coordinates (that is, the velocities should always be eliminated in favour of the momenta).