Energy conservation tells us that the sum
should be a constant for this oscillator (there is no external force adding
energy, and no friction removing it). Check the stability of your
solution by plotting the relative deviation
(E(t) - E(t=0))/E(t=0)
for a large number of cycles.