Mass of each star is given as
Radius of each star is given as
Distance between the stars is given as
Initial potential energy of the system will begiven as,
So, Total kinetic energy of the stars will be
where is the speed at which the stars collide.
r=2R is the distance between the centres of the stars when they collide.
Hence, the final potential energy of two stars when they are close to each other wll be
Thus, the total energy of the two stars just before collision can be calculated as
(1)