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) Obtain the Hamiltonian for the system;
b) Write down the canonical (Hamilton's) equations of motion;