Classical Mechanics
UNIVERSIDADE FEDERAL DO RIO GRANDE DO SUL
INSTITUTO DE FÍSICA
PROF. MARIA BEATRIZ GAY DUCATI
LECTURE 7
The Hamilton Equations of Motion
2
Legendre Transformations and the Hamilton Equations of
Motion
In the Lagrangian formulation (nonrelativistic), a system with n
degrees of freedom possesses n equations of motion of the form:
d ∂L ∂L
− = 0. (8.1)
dt ∂ q̇i ∂qi
The equations are of second order, so the motion of the system is
determined for all time only when 2n initial values are specified:
I n qi ’s and n q̇i ’s at time t1 or;
I n qi ’s at two times, t1 and t2 .
We represent the state of the system by a point in an n-dimensional
configuration space whose coordinates are the n generalized coor-
dinates qi .
3
Legendre Transformations and the Hamilton Equations of
Motion (cont.)
I Lagrangian point of view:
• a system with n independent degrees of freedom is a problem of
n independent variables qi (t) and q̇i appears only as the time
derivative of qi .
• All n coordinates must be independent.
I Hamiltonian formulation:
• No constraint equations among the coordinates.
• If the n coordinates are not independent, a reduced set of m
coordinates, m < n, must be used for the formulation of the
problem.
4
Legendre Transformations and the Hamilton Equations of
Motion (cont.)
In the Hamiltonian formulation we seek to describe the motion in
terms of first-order e quations o f motion.
I 2n independent first-order equations, in terms of 2n independent
variables
The 2n equations of the motion describe the behavior of the system
point in a phase space whose coordinates are the 2n independent
variables.
I We choose half of the independent quantities as the generalized
coordinates qi ;
I The formulation is symmetric if the other half is the conjugate
momenta pi .
∂L(qj , q̇j , t)
pi = , (no sum on j) (8.2)
∂ q̇i
I (q,p): canonical variables 5
Legendre Transformations and the Hamilton Equations of Motion
(cont.)
Transition from Lagrangian to Hamiltonian formulation:
(q, q̇, t) → (q, p, t) by Legendre Transformations.
Consider a function f (x, y ), so that
df = udx + vdy (8.3)
where ∂f ∂f
u= , v= (8.4)
∂x ∂y
Change (x, y ) → (u, y ), needs du and dy . Let g be:
g = f − ux (8.5)
so that (using 8.3):
dg = df − udx − xdu = vdy − xdu
The quantities x and v are now functions of the variables u and y:
∂g ∂g
x =− , v = (8.6)
∂u ∂y 6
Legendre Transformations in Thermodynamics
The Legendre transformation so defined is used frequently in
thermodynamics.
The First Law of Thermodynamics is:
dU = dQ − dW . (8.7)
For a gas undergoing a reversible process:
dU = TdS − PdV (8.8)
with U = U(S, V ) and
∂U ∂U
T = , P=− (8.9)
∂S ∂V
7
Legendre Transformations in Thermodynamics (cont.)
The enthalpy H(S, P) is generated by the Legendre transformation:
H = U + PV (8.10)
so that
dH = TdS + VdP (8.11)
where
∂H ∂H
T = , P=−
∂S ∂P
Similarly, the Legendre transformations
F = U − TS (8.12)
G = H − TS
generates the Helmholtz free energy, F (T, V), and the Gibbs free
energy, G(T, P), respectively.
8
Legendre Transformations and the Hamilton Equations of
Motion (cont.)
The transformation from (q, q̇, t) to (q, p, t), differs from the ones
considered in Eqs. (8.3) to (8.12) only in that more than one variable
is to be transformed.
First we write:
∂L ∂L ∂L
dL = dqi + d q̇i + dt. (8.13)
∂qi ∂ q̇i ∂t
Substituting pi = ∂L
∂ q̇i into the Lagrange equation (8.1), we obtain:
∂L
ṗi = (8.14)
∂qi
so that:
∂L
dL = ṗi dqi + pi d q̇i + dt. (8.13’)
∂t
9
Legendre Transformations and the Hamilton Equations of
Motion (cont.)
The Hamiltonian H(q, p, t) is generated by the Legendre
transformation:
H(q, p, t) = q̇i pi − L(qi, q̇i , t) (8.15)
which has the differential
∂L
dH = q̇i dpi − ṗi dqi − . (8.16)
∂t
But:
∂H ∂H ∂H
dH = dqi + dpi + dt (8.17)
∂qi ∂pi ∂t
10
Legendre Transformations and the Hamilton Equations of
Motion (cont.)
Comparing Eqs. (8.16) and (8.17), we obtain the 2n + 1 relations:
∂H
q̇i = (8.18)
∂pi
∂H
−ṗi =
∂qi
∂L ∂H
− = (8.19)
∂t ∂t
Equations (8.18) are known as the canonical equations of Hamilton.
They are the set of 2n first-order equations of motion replacing the n
second-order Lagrange equations.
11
Legendre Transformations and the Hamilton Equations of
Motion (cont.)
The Hamiltonian for each problem must be constructed via the
Lagrangian formulation. The formal procedure is the following:
1. With a chosen set of generalized coordinates, qi , the
Lagrangian L(qi , q̇i .t) = T − V is constructed.
2. The conjugate momenta are defined as functions of qi , q̇i , and
t by Eqs. (8.2).
3. Equation (8.15) is used to form the Hamiltonian. At this stage
we have some mixed function of qi , q̇i , pi , and t.
4. Equations (8.2) are then inverted to obtain qi as functions of
(q, p, t).
5. The results of the previous step are then applied to eliminate q̇
from H so as to express it solely as a function of (q, p, t).
12
Legendre Transformations and the Hamilton Equations of
Motion (cont.)
For many physical systems it is possible to shorten this sequence.
I For a Lagrangian that is sum of functions homogeneous in the
generalized velocities of degree 0, 1 and 2, the Hamiltonian is
given by:
H = q̇i pi − L (8.20)
= q̇i pi − [L0 (qi , t) + L1 (qi , t)q̇k + L2 (qi , t)q̇k q̇m ].
• For functions defining the generalized coordinates don’t depend
on time explicitly;
• and for forces are derivable from a conservative potential
I The Hamiltonian is the total energy:
H = T + V = E. (8.21)
If either Eq. (8.20) or (8.21) holds, then much of the algebra in
steps 3 and 4 are eliminated. 13
Legendre Transformations and the Hamilton Equations of
Motion (cont.)
When the Lagrangian has the form:
L(qi , q̇i , t) = L0 (q, t) + q̇i ai (q, t) + q̇i2 Ti (q, t) (8.22)
that is, L1 is linear on the generalized velocities and L2 is quadratic,
the algebraic manipulations in steps 2-5 can be carried out, as shown
next.
First, lets write the q̇i ’s into a column matrix q̇ and rewrite the
Lagrangian:
˜ + 1 q̇T
L(qi , q̇i , t) = L0 (q, t) + q̇a ˜ q̇ (8.23)
2
where q̇
˜ is the transpose of q̇, a is a column matrix and T is a n × n
matrix.
14
Legendre Transformations and the Hamilton Equations of
Motion (cont.)
Special case when qi = {x, y , z} and T is diagonal:
m 0 0
ẋ
1˜ 1
q̇Tq̇ = ẋ ẏ ż 0 m 0 ẏ
2 2
0 0 m ż
m 2 2
= (ẋ + ẏ + ż )2
(8.24a)
2
and
ax
˜ =
q̇a ẋ ẏ ż ay = ax ẋ + ay ẏ + az ż
az
= a · ṙ (8.24b)
15
Legendre Transformations and the Hamilton Equations of
Motion (cont.)
In this notation the Hamiltonian, H = q̇p
˜ − L, becomes:
˜ − a) − 1 q̇T
H = q̇(p ˜ q̇ − L0 (8.24c)
2
and the conjugate momenta:
p = Tq̇ + a. (8.25)
This last expression can be inverted to find q̇ (step 4):
q̇ = T−1 (p − a). (8.26a)
The corresponding equation for q̇
˜ is:
˜ = (p̃ − ã)T−1
q̇ (8.26b)
16
Legendre Transformations and the Hamilton Equations of
Motion (cont.)
Using Eqs. (8.26) we obtain the final form for H:
1
H(q, p, t) = (p̃ − ã)T−1 (p − a) − L0 (q, t). (8.27)
2
If the Lagrangian can be written as in (8.23), the Hamiltonian can
directly be written as above. The inverse matrix T−1 can be
obtained as
T̃c
T−1 = (8.28)
|T|
where Tc is the cofactor matrix whose elements (T̃ c )jk are (−1)j+k
times the determinant of the matrix obtained by striking out the jth
row and the kth column of T.
17
Legendre Transformations and the Hamilton Equations of
Motion (cont.)
In the example of Eq (8.24a), these matrices are:
m 0 0 0 0
−1
m
T= 0 m 0 , T−1 = 0 m−1 0
0 0 m 0 0 m−1
m2 0 0
T̃c = 0 m2 0
0 0 m2
Two very simple examples illustrating some important aspects of this
technique will be presented next.
18
Example 1: particle in a central force field
Using the spherical coordinates (r , θ, φ) as the generalized
coordinates:
V = V (r )
mv 2 m
T = = (r˙2 + r 2 sin2 (θ)φ̇2 + r 2 θ̇2 ) (8.28’)
2 2
The Hamiltonian has the form of Eq(8.21) and thus corresponds to
the total energy of the system, T + V .
Since T is diagonal:
!
1 p2 pφ2
H(r , θ, pr , pθ , pφ ) = pr2 + 2θ + 2 2 + V (r ) (8.29)
2m r r sin θ
19
Example 1: particle in a central force field (cont.)
If we had chosen the Cartesian coordinates as the generalized
coordinates:
mv 2 mẋi ẋi
T = =
2 2
pi pi
H(xi , pi ) = + V (r ) (8.30)
2m
Where the Einstein summation convention was used.
We can also write H as:
p·p p
H(xi , pi ) = + V ( xi x i ). (8.31)
2m
20
Example 1: particle in a central force field (cont.)
We can take the components of p relative to any coordinate system.
It is important not to confuse, say, pθ with the θ component of p,
designated as (p)θ .
I pθ is the canonical momentum, conjugate to the coordinate θ;
I (p)θ is the θ component of the momentum vector conjugate to
the Cartesian coordinates.
Whenever a vector is used from here on to represent canonical
momenta it will refer to the momenta conjugate to Cartesian
position coordinates.
21
Example 2: Single particle moving in an electromagnetic
field.
The Lagrangian of the system is:
1
L = T − V = mv 2 − qφ + qA · v (1)
2
where m is the mass of the particle and q it’s electrical charge; φ is
the scalar potential and A is the vector potential. Then, using
Cartesian coordinates:
mx˙i ẋi
L= + qAi ẋi − qφ (8.32)
2
Note that V has a linear term in the generalized velocities, so
H 6= T + V , but it is still the total energy, since the “potential”
energy is determined by φ alone.
22
Example 2: Single particle moving in an electromagnetic field (cont.)
The canonical momenta are:
pi = mẋi + qAi (8.33)
and the Hamiltonian:
(pi − qAi )(pi − qAi )
H= + qφ (8.34)
2m
or
1
H= (p − qA)2 + qφ (8.35)
2m
It is clear that Hamilton’s equations of motion do not treat the
coordinates and momenta in a completely symmetric fashion.
23
Legendre Transformations and the Hamilton Equations of
Motion (cont.)
For a system of n degrees of freedom, we construct a column matrix
η with 2n elements:
ηi = qi , ηi+n = pi ; i ≤ n. (8.36)
and the column matrix ∂H/∂η:
∂H ∂H
= , (8.37)
∂η ∂qi
Let J be the 2n × 2n square matrix composed of four n × n zero and
unit matrices:
0 1
J= (8.38a)
−1 0
and its transpose matrix J̃ :
0 −1
J̃ = (8.38b)
1 0
24
Legendre Transformations and the Hamilton Equations of
Motion (cont.)
So
1 0
J̃J = JJ̃ = 1 = (8.38c)
0 1
and we also have:
J̃ = −J = J−1 , (8.38d)
2
J = −1 (8.38e)
and the determinant is
|J| = +1 (8.38f)
25
Legendre Transformations and the Hamilton Equations of
Motion (cont.)
Now the Hamilton’s equations of motion can be written as:
∂H
η̇ = J (8.39)
∂η
For two coordinate variables, this has the expanded form:
0 0 1 0
q̇1 −ṗ1
q̇2 0 0 0 1 −ṗ2 (8.40)
ṗ1 = −1 0 0 0 q̇1
ṗ2 0 −1 0 0 q̇2
This method of displaying will be referred to as to as Hamilton’s
equations in matrix or symplectic notation.
26
Cyclic Coordinates and Conservation Theorems
A cyclic coordinate qj :
• does not appear explicitly in the Lagrangian;
• its conjugate momentum pj is constant;
• absent from the Hamiltonian.
Comparing of Eq. (8.14) with Eq. (8.16):
∂L ∂H
ṗj = =−
∂qj ∂qj
So if a generalized coordinate doesn’t occur in H, the conjugate
momentum is conserved.
27
Cyclic Coordinates and Conservation Theorems (cont.)
The momentum conservation theorems can thus be transferred to the
Hamiltonian formulation with no more than a substitution of H for L.
Connection between the invariance or symmetry properties of the
physical system and the constants of the motion can also be derived
in terms of the Hamiltonian.
28
Cyclic Coordinates and Conservation Theorems (cont.)
If L is not an explicit function of t, then H is a constant of motion.
Writing the total time derivative of the Hamiltonian:
dH ∂H ∂H ∂H
= q̇i + ṗi + .
dt ∂qi ∂pi ∂t
In consequence of the equations of motion (8.18):
dH ∂H ∂L
= =− (8.41)
dt ∂t ∂t
Thus if t doesn’t appear explicitly in L, it will also not be present in
H, and H will be constant in time.
29
Cyclic Coordinates and Conservation Theorems (cont.)
I The identification of H as a constant of the motion and as the
total energy are two separate matters, and the conditions
sufficient for the one are not enough for the other.
I Change of generalized coordinates cannot alter the Lagrangian
magnitude. On the other hand, this may lead to an entirely
different quantity for the Hamiltonian.
• It may be that for one set of generalized coordinates H is
conserved, but that for another it varies in time.
30
Cyclic Coordinates and Conservation Theorems (cont.)
Case 1: To illustrate this, consider a point of mass m attached to a
spring (force constant k) which is fixed on a massless cart being
moved uniformly by an external device (fig. 8.1):
The Lagrangian of the system is:
mẋ 2 k
L(x, ẋ, t) = T − V = − (x − v0 t)2 (8.42)
2 2
The equation of motion is:
mẍ = −k(x − v0 t) 31
Cyclic Coordinates and Conservation Theorems (cont.)
A way of solving this equation is doing:
x 0 = x − v0 t (8.43)
so
mẍ 0 = −kx 0 . (8.44)
The Hamiltonian is given by:
p2 k
H(x, p, t) = + (x − v0 t)2 (8.45)
2m 2
The Hamiltonian is the total energy of the system, but since it is
explicitly a function of t, it is not conserved!
32
Cyclic Coordinates and Conservation Theorems (cont.)
Formulating the Lagrangian in terms of x’:
x ẋ 02 mv02 kx 02
L(x 0 , ẋ 0 ) = + mẋ 0 v0 + − (8.46)
2 2 2
and also H:
(p 0 − mv0 )2 kx 02 mv02
H 0 (x 0 , p 0 ) = + − . (8.47)
2m 2 2
The last term is constant and it could be dropped without affecting
the resultant equations of motion.
Now H’ is not the total energy of the system, but it is conserved!
33
Cyclic Coordinates and Conservation Theorems (cont.)
Case 2: dumbbell of two masses connected by a spring of constant k:
Dumbbell vibrates while its center of mass has an initial velocity v0 .
I continue with this velocity with uniform translational motion
• Once the motion is started, energy is conserved
• Hamiltonian is the total conserved energy.
I if the mass m2 moves at the constant speed v0
• a periodic force is applied to keep m2 at v0 ;
• Center of mass and m1 oscillate relative to m2 ;
• Hamiltonian is no longer conserved;
• Hamiltonian is not the total energy. 34
Routh's Procedure
The Hamiltonian procedure is especially adapted to the treatment of
problems involving cyclic coordinates.
Considering a situation when some coordinate qn is cyclic. Then in
Lagrangian formulation we have:
L = L(q1, ..., qn−1; q̇1, ...q̇n; t)
that is: we still have to solve a problem of n degrees of freedom. But in
the Hamiltonian formulation, pn is a constant α:
H = L(q1, ..., qn−1; p1, ...pn−1; α; t)
The behavior of the cyclic coordinate itself with time is then found
by integrating the equation of motion
∂H
q̇n =
∂α
35
Routh’s Procedure (cont.)
The advantages of the Hamiltonian formulation in handling cyclic
coordinates may be combined with the Lagrangian conveniences for
noncyclic coordinates by a method devised by Routh.
I Cyclic coordinates: Hamiltonian formalism
I Non-Cyclic coord.: Lagragian formalism
If the cyclic coordinates are qs+ 1, ..., qn , then the function Routhian
may be defined as:
n
X
R(q1 , ..., qn ; q̇1 , ...q̇s ; ps+1 , ...pn ; t) = pi q̇i − L (8.48)
i=s+1
which is equivalent to writing
R(q1 , ..., qn ; q̇1 , ...q̇s ; ps+1 , ...pn ; t) =
Hcycl (ps+1 , ...pn ) − Lnoncycl (q1 , ..., qn ; q̇1 , ...q̇s ). (8.49)
36
Routh’s Procedure (cont.)
For the s non-ignorable coordinates, the following Lagrange
equations are satisfied
d ∂R ∂R
− =0 (8.50)
dt ∂ q̇i ∂qi
while for the n − s ignorable coordinates, Hamilton’s equations apply:
∂R ∂R
= −ṗi = 0, and = q̇i , i = s + 1, ..., n (8.51)
∂qi ∂pi
37
Routh’s Procedure (cont.)
As an example, consider the Kepler problem, that of a single particle
moving in a plane under the influence of a central force f (r ) derived
from V (r ) = −k/r n .The Lagrangian is:
m 2 k
L= (r˙ + r 2 θ̇2 ) + n
2 r
the ignorable coordinate is(θ), so the Routhian is:
pθ2 1 k
R(r , r˙, pθ ) = − mr˙2 − n .
2mr 2 2 r
The Routhian is the equivalent one-dimensional potential V 0 (r )
minus the kinetic energy of radial motion.
38
Routh’s Procedure (cont.)
Applying the Lagrange equation (8.50) to the noncyclic radial
coordinate r:
pθ2 nk
r¨ − 3
+ n+1 = 0. (8.52)
mr r
Applying Hamilton’s equation (8.51) to the cyclic variable θ:
pθ
ṗθ = 0, = θ̇ (8.53)
mr 2
whose solution is:
pθ = mr 2 θ̇ = l = constant
39