Given data
*The given spring constant is k = 40 N/m
*The given compressed length is x = 0.1 m
*The given mass is m = 0.5 kg
(a)
The formula for the elastic potential energy stored in the spring is given as
Substitute the values in the above expression as
Hence, the elastic potential energy stored in the spring is 0.2 J
(b)
The formula for the speed of the masses is given by the conservation of energy as
Substitute the values in the above expression as
Hence, the speed of the masses as it reaches the length of the spring is v = 0.89 m/s