(b) Let velocities of these masses at $r$ distance from each other be $v_{1}$ and $v_{2}$ respectively
By conservation of momentum
$m_{1}v_{1} - m_{2}v_{2} = 0$
$\Rightarrow m_{1}v_{1} = m_{2}v_{2}$ …(i)
By conservation of energy
Change in $P.E. =$ change in $K.E.$
$\frac{Gm_{1}m_{2}}{r} = \frac{1}{2}m_{1}v_{1}^{2} + \frac{1}{2}m_{2}v_{2}^{2}$
$\Rightarrow \frac{m_{1}^{2}v_{1}^{2}}{m_{1}} + \frac{m_{2}^{2}v_{2}^{2}}{m_{2}} = \frac{2Gm_{1}m_{2}}{r}$ …(ii)
On solving equation (i) and (ii)
$v_{1} = \sqrt{\frac{2Gm_{2}^{2}}{r(m_{1} + m_{2})}}$ and $v_{2} = \sqrt{\frac{2Gm_{1}^{2}}{r(m_{1} + m_{2})}}$
$\therefore v_{app} = \left| v_{1} \right| + \left| v_{2} \right| = \sqrt{\frac{2G}{r}(m_{1} + m_{2})}$