xn+1 - 2xn + xn-1 = - h2 xn
where h is step size, xn = 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 xn=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?