How does g vary with height and depth?
I have posted this from another student's answer:
You must know that g (gravitational acceleration) = GM/r2,
where
G = Gravitational constant,
M = mass of heavenly body and
r = radius of the heavenly body.
g at height h = GM / (r+h)2 = GM / r2+h2+2rh
g at depth x = GM / (r-x)2 = GM / r2+x2-2rx