Thank you for the opportunity to help you with your question!
Density = mass/volume
Volume =V = 4/3Pi R^3
initially density of each world = ρ0, = M/V
after coalesce mass = 2M and radius = 3/4R
volume of combined world (sphere ) = 4/3 x Pi x (3/4 R)^3 = 27/64 V
hence Density = 2M/(27/64V) = 128/27 ρ0 = 4.74 ρ0
Please find the solution enclosed here with .. In case of any doubt please feel free to ask… Do not forget to best my answer… If you are having some other problem please feel free to contact me for quick & quality services..