10.1 From the Lagrangian to the Hamiltonian
The Lagrangian formulation describes a system with \(n\) degrees of freedom by \(n\) generalized coordinates \(q_1,\dots,q_n\) and yields \(n\) second-order differential equations for them. Hamilton’s reformulation of mechanics replaces these by \(2n\) first-order equations for \(2n\) independent variables, namely the coordinates \(q_i\) and the generalized momenta \(p_i\). Nothing new is added to the physics, but the change of variables reveals a symmetry between coordinates and momenta that underlies canonical transformations (Chapter 11), statistical mechanics and the passage to quantum mechanics.
The momentum conjugate to \(q_i\) is defined from the Lagrangian \(L(q_i,\dot q_i,t)\) as
\[\boxed{p_i=\frac{\partial L}{\partial \dot q_i}},\qquad i=1,\dots,n.\]
It is called the canonical momentum, or the momentum conjugate to \(q_i\). Its dimensions depend on those of \(q_i\): when \(q_i\) is a length, \(p_i\) is a linear momentum, and when \(q_i\) is an angle, \(p_i\) is an angular momentum. With this definition the Lagrange equations \(\frac{d}{dt}\frac{\partial L}{\partial\dot q_i}-\frac{\partial L}{\partial q_i}=0\) take the compact form \(\dot p_i=\partial L/\partial q_i\).
The Hamiltonian of the system is defined by
\[\boxed{H(q_i,p_i,t)=\sum_{i=1}^{n}p_i\dot q_i-L(q_i,\dot q_i,t)},\]
in which every generalized velocity \(\dot q_i\) on the right-hand side is to be expressed in terms of \((q_j,p_j,t)\) by inverting the \(n\) relations \(p_i=\partial L/\partial\dot q_i\). Numerically \(H\) is the same quantity whether it is written in terms of velocities or momenta, but as a function it must always be regarded as depending on \(q\), \(p\) and \(t\). The distinction matters, because Hamilton’s equations involve partial derivatives of \(H\) taken at constant \(p\), not at constant \(\dot q\).
The passage from \(L\) to \(H\) is an example of a Legendre transformation, which replaces a variable by the derivative of a function with respect to it. Consider a function \(f(x)\) and define the new variable \(u=df/dx\). The function
\[g(u)=ux-f(x),\]
with \(x\) eliminated in favour of \(u\), satisfies \(dg=u\,dx+x\,du-f'(x)\,dx=x\,du\), so that \(dg/du=x\). The roles of the two variables are therefore exchanged symmetrically: \(u=df/dx\) and \(x=dg/du\). The transformation is possible only if \(u=f'(x)\) can be solved uniquely for \(x\), which requires \(f''(x)\neq0\). Thermodynamics uses the same construction to pass from the internal energy \(U(S,V)\) to the enthalpy and to the free energies.
In mechanics the active variables are the velocities \(\dot q_i\), while \(q_i\) and \(t\) are passive. The momenta can be solved for the velocities only if the Hessian determinant
\[\det\left(\frac{\partial^2L}{\partial\dot q_i\,\partial\dot q_j}\right)\neq0.\]
A Lagrangian for which this determinant vanishes is called degenerate or singular. For example, a Lagrangian linear in a velocity gives a momentum that does not contain that velocity, and the Hamiltonian cannot be constructed by the elementary procedure. All the Lagrangians met in this book, apart from a few deliberately chosen examination exercises, are non-degenerate.