A simple pendulum of length l and mass m is attached to a massless spring with elastic constant k. The attachment point moves only in a vertical direction.
a) Write down the Lagrangian of the system;
b) Obtain the Lagrange's equations of motion;
c) Define the generalized momenta for the system;
d) Obtain the Hamiltonian for the system;
e) Write down the canonical (Hamilton's) equations of motion;
f) Show that the Lagrange's and canonical equations of motion are equivalent to each other.