
just after collision of $\mathrm{B}$ with $\mathrm{A}$ the speed of combined mass is $\frac{\mathrm{v}}{2}$
For spring to just attain natural length the combined mass must rise up by $:$
$\mathrm{x}_{0}=\frac{\mathrm{mg}}{\mathrm{k}}$ (see figure) and comes to rest.
Now, applying conservation of energy
$\frac{1}{2}(2 m)\left(\frac{v}{2}\right)^{2}+\frac{1}{2} k\left(x_{0}^{2}\right)=(2 m) g x_{0}$
$\& x_{0}=\frac{mg}{k}$
se get, $\mathrm{v}=\mathrm{g} \sqrt{\frac{6 \mathrm{m}}{\mathrm{k}}}$
Alternate solving by $SHM:$
In $\mathrm{SHM} \vee=\omega \sqrt{\mathrm{A}^{2}-\mathrm{x}^{2}}$
we can write, $\frac{\mathrm{v}}{2}=\sqrt{\frac{\mathrm{k}}{2 \mathrm{m}}} \sqrt{\left(\frac{2 \mathrm{mg}}{\mathrm{k}}\right)^{2}-\left(\frac{\mathrm{mg}}{\mathrm{k}}\right)^{2}}$
$v=g \sqrt{\frac{6 m}{k}}$

Then the values of $A$ (in $m$) and $T$ (in $sec$) are :


| $A (mm \,\,s^{-2}$) |
$16$ |
$8$ |
$0$ |
$- 8$ |
$- 16$ |
|
$x\;(mm)$ |
$- 4$ |
$- 2$ |
$0$ |
$2$ |
$4$ |