
148 Applied calculus of variations for engineers
Differentiating and applying Lagrange’s equation we obtain
˙p
i
=
d
dt
p
i
=
d
dt
∂L
∂ ˙q
i
=
∂L
∂q
i
.
Hence the total differential of the Lagrangian becomes
dL =
∂L
∂t
dt +
n
i=1
(˙p
i
dq
i
+ p
i
d ˙q
i
).
Exploiting that
d(p
i
˙q
i
)=dp
i
˙q
i
+ p
i
d ˙q
i
,
and reordering yields
d(
n
i=1
p
i
˙q
i
− L)=−
∂L
∂t
dt −
n
i=1
(˙p
i
dq
i
− ˙q
i
dp
i
).
The left-hand side term is called the Hamiltonian
H =
n
i=1
(p
i
˙q
i
− L)=f(p
i
,q
i
,t),
which is now only a function of the new and old generalized displacement
variables and time. Its total differential is
dH =
∂H
∂t
dt +
n
i=1
(
∂H
∂p
i
dp
i
+
∂H
∂q
i
dq
i
).
Matching terms between the dH and dL differentials produces the relationship
∂H
∂t
= −
∂L
∂t