(N/A) Consider the Earth to be a sphere of radius $R_E$ and mass $M_E$ with uniform density $\rho$.
Let a point mass $m$ be situated at a point $P$ at a distance $r$ from the centre,where $r = R_E - d$.
According to the shell theorem,for a point inside the Earth,the gravitational force is exerted only by the mass of the sphere of radius $r$,denoted by $M_r$. The shells outside this radius exert no net gravitational force on the mass $m$.
The mass of the inner sphere is $M_r = \rho \cdot \frac{4}{3} \pi r^3$.
Since the density is uniform,$\rho = \frac{M_E}{\frac{4}{3} \pi R_E^3}$.
Substituting $\rho$ into the expression for $M_r$,we get $M_r = M_E \left( \frac{r^3}{R_E^3} \right)$.
The gravitational force on mass $m$ at distance $r$ is $F = \frac{G M_r m}{r^2}$.
Substituting $M_r$,we get $F = \frac{G m}{r^2} \cdot M_E \frac{r^3}{R_E^3} = \frac{G M_E m r}{R_E^3}$.
The acceleration due to gravity $g(r)$ is given by $g(r) = \frac{F}{m} = \frac{G M_E r}{R_E^3}$.
Substituting $r = R_E - d$,we get $g(d) = \frac{G M_E (R_E - d)}{R_E^3} = \frac{G M_E}{R_E^2} \left( 1 - \frac{d}{R_E} \right)$.
Since $g = \frac{G M_E}{R_E^2}$ is the acceleration due to gravity at the surface,the expression becomes $g(d) = g \left( 1 - \frac{d}{R_E} \right)$.