Let a body P of mass m be situated at a depth h below the earth's surface.
The gravitational force of attraction on a body inside a spherical shell is always zero. Therefore, the body P experiences gravitational attraction only due to the inner solid sphere. The mass of this sphere is
M′=volume×density=43π(Re−h)3ρ
where ρ is mean density of the earth. Therefore, according to Newton's law of gravitation, the force of attraction on the body P is
GM′m(Re−h)2=G43π(Re−h)3ρm(Re−h)2
=43πG(Re−h)ρm
This force must be equal to the weight of the body mg′, where g′ is the acceleration due to gravity at a depth h below the surface of the earth. Thus,
mg′=43πG(Re−h)ρm....(i)
Similarly, if a body be at the surface of the earth (h=0) where acceleration due to gravity is g, then
mg=43πGReρm....(ii)
Dividing eq.(i) by (ii) we have
⇒g′g=Re−hRe
⇒g′=g(1−hRe)