An Example of a Time Dependent Hamiltonian and Lagrangian

Deriving the Hamiltonian and Lagrangian for a time dependent system is not much more complicated than for the time independent case. The pendulum of massand lengthbelow is made to oscillate at A with the distance OA given by

The potential energy is given by

The kinetic energy is given by

Hence

The Lagrangian is

Wheremay be ignored since it is a function ofonly and ignoring it returns the same Lagrangian equation of motion.

We can now find the Hamiltonian by expressing the Lagrangian in terms ofandto obtain

Then