(D) Mass of each star,$M = 2 \times 10^{30} \; kg$.
Radius of each star,$R = 10^{4} \; km = 10^{7} \; m$.
Initial distance between the centers of the stars,$r = 10^{9} \; km = 10^{12} \; m$.
Initial kinetic energy is $0$ as speeds are negligible.
Initial potential energy,$U_{i} = -\frac{GM^{2}}{r}$.
Total initial energy,$E_{i} = -\frac{GM^{2}}{r}$.
At the moment of collision,the distance between the centers is $2R$.
Let the speed of each star be $v$.
Total kinetic energy,$K_{f} = \frac{1}{2}Mv^{2} + \frac{1}{2}Mv^{2} = Mv^{2}$.
Total potential energy,$U_{f} = -\frac{GM^{2}}{2R}$.
Total final energy,$E_{f} = Mv^{2} - \frac{GM^{2}}{2R}$.
By the law of conservation of energy,$E_{i} = E_{f}$:
$-\frac{GM^{2}}{r} = Mv^{2} - \frac{GM^{2}}{2R}$.
$v^{2} = GM \left( \frac{1}{2R} - \frac{1}{r} \right)$.
Since $r \gg 2R$,$\frac{1}{r}$ is negligible compared to $\frac{1}{2R}$.
$v^{2} \approx \frac{GM}{2R} = \frac{6.67 \times 10^{-11} \times 2 \times 10^{30}}{2 \times 10^{7}} = 6.67 \times 10^{12} \; m^{2}/s^{2}$.
$v = \sqrt{6.67 \times 10^{12}} \approx 2.58 \times 10^{6} \; m/s$.