In our example, we can calculate the spread-out Sun’s density using the Sun’s total mass for M, and using the equation for the volume of a sphere for V.
\begin{equation}\rho = \frac{M_{Sun}}{\frac{4}{3}\pi r^{3}_{Sun,Earth}}\end{equation}
Here we have used the distance between the Sun and the Earth (which is the radius of our imaginary spread-out Sun), rSun,Earth, in the equation.
To find the value of ρ, the density of the spread out Sun, we use: MSun = 2e30 kg and rSun,Earth = 1.5e11 m. We find:
ρ = 2e30/[(4/3)π(1.5e11)3] = 1.415e-4 kg/m3