From the equations of motion to the canonical commutation relations