Energy in a spring system

A block connected to a horizontal spring sits on a frictionless table. The block is moved to compress the spring, and the system is released from rest. What happens to the energy initially stored in the spring? What is the maximum speed of the block?

The initial energy is Ui = ½ kxi2

The block reaches maximum speed when the spring reaches its equilibrium length - that's the point where all the energy stored in the spring is converted to kinetic energy.

To find the speed use the master energy equation, where the initial position is the point where the block is released and the final position is the equilibrium position:

Ui + Ki + Wnc = Uf + Kf

Ki = 0 because the object starts from rest.
Wnc = 0 because there is no friction.
Uf = 0 because at the equilibrium position x = 0.

Ui = Kf

½ kxi2 = ½ mvf2
vf = xi (
k
m
)½

The mass keeps going, and the kinetic energy is transformed back into potential energy. This continues, with the total energy remaining constant and the energy going back and forth between potential and kinetic.