where M (r) is the mass within a radius r and ρ (r) is the stellar density at radius r ; G represents the gravitational constant and R the total radius of the star. Assuming a constant density throughout the star, this integration yields the formula