If G is Universal gravitational constant and R is the radius of the earth, then acceleration due to gravity g and the mean density of earth D are related by the equation :
Suppose,
Mass of earth is M, radius of earth is R.
Density of earth is, D = M/[(4/3)Ï€R3]
=> M = (4/3)Ï€R3D
Now, g = GM/R2
=> g = G × (4/3)πR3D × (1/R2)
=> g = G × (4/3)πRD
=> g = (4/3)Ï€GRD