
Given, Natural length of spring =2 m
Initial compression in spring (xi)=1 m
Final compression in spring (xf)=(2−x)m
Using energy conservation
$\begin{aligned}
& \mathrm{K}{\mathrm{i}}+\mathrm{U}{\mathrm{i}}=\mathrm{K}{\mathrm{f}}+\mathrm{U}{\mathrm{f}} \
& 0+\frac{1}{2} \mathrm{Kx}{\mathrm{i}}^2=\frac{1}{2} \mathrm{mv}^2+\frac{1}{2} \mathrm{Kx}{\mathrm{f}}^2 \
& \frac{1}{2} \mathrm{mv}^2=\frac{1}{2} \mathrm{~K}\left(\mathrm{x}{\mathrm{i}}^2-\mathrm{x}{\mathrm{f}}^2\right) \
& \frac{1}{2} \times 2 \times \mathrm{v}^2=\frac{1}{2} \times 200 \times\left(1^2-(2-\mathrm{x})^2\right) \
& \mathrm{v}^2=100\left[1-(2-\mathrm{x})^2\right] \
& \mathrm{v}=10\left[1-(2-\mathrm{x})^2\right]^{1 / 2}
\end{aligned}$