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
![U_p=(1)/(2)kx^2](https://img.qammunity.org/2023/formulas/physics/college/1g6in2m0lfd602mgmwyvc48i1aopk1vck3.png)
Substitute the values in the above expression as
![\begin{gathered} U_p=(1)/(2)(40)(0.1)^2 \\ =0.2\text{ J} \end{gathered}](https://img.qammunity.org/2023/formulas/physics/college/jbc6hoih5mae06usc98y3jts3ni3hlll2i.png)
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
![\begin{gathered} U_p=U_k \\ (1)/(2)kx^2=(1)/(2)mv^2 \\ v=x\sqrt[]{(k)/(m)} \end{gathered}](https://img.qammunity.org/2023/formulas/physics/college/hecussg0sds36p6ys02lce8r6wfnthbair.png)
Substitute the values in the above expression as
![\begin{gathered} v=(0.1)\sqrt[]{(40)/(0.5)} \\ =0.89\text{ m/s} \end{gathered}](https://img.qammunity.org/2023/formulas/physics/college/g6hnkm13zjxaue1h5h5dqh1wv4p15jcs2c.png)
Hence, the speed of the masses as it reaches the length of the spring is v = 0.89 m/s