x_{n+1} - 2x_{n} + x_{n-1} = - h^{2} x_{n}
where h is step size, x_{n} = x(t=nh) is the value
at time nh. Solve the difference equation exactly and compare its solution
with that of the differential equation. Hint: look for solution
of the form x_{n}=Re{A exp(i nh w)}.
Due to discretization, the energy is not exactly conserved.
Can you construct an exactly conserved quantity which differs from total
energy only by higher orders in h?