The lagrangian is L = m/2 xdot^2 - 1/2 k x^2.