Wolfram Alpha:

```Gravity - Force and Acceleration
--------------------------------
From Newton:

F = mg = -GMbodym/r2

g = GME/rE2 = 9.8 m/s2 for Earth

Now consider inside of body:

g' = GM(r)/r2 where M(r) = (4/3)πr3ρ and ρ = Mbody/{(4/3)πrbody3

Thus,

M(r) = {Mbody/(4/3)πrbody3}(4/3)πr3 = Mbodyr3/rbody3

g' = GMbodyr3/rbody3r2

= GMbodyr/rbody3

= (GMbody/rbody2)(r/rbody)

= g(r/rbody)

Therefore, g ∝ r inside of body. g ∝ 1/r2 outside of body

Gravitational Potential Energy
------------------------------

U = F.d = -GMbodym/r   U = 0 at r = ∞ by convention

Consider the Earth.
x
/
h/
.   .
.      /   .
.    rE /     .
.       /       .
.       +       .
.               .
.             .
.         .
.   .

r = rE + h

U = -GMEm/r   U = 0 at r = ∞

ΔU = -GMEm(1/r - 1/rE)  ... 1.

= -GMEm((rE - r/rrE))

= -GMEmh/rrE

if r ~ rE

ΔU = -GMEmh/rE2

= mgh

If h is large use Eq. 1

Escape Velocity
---------------

(1/2)mve2 = GMm/r

Thus,

ve = √(2GM/r)

Asteroid example:

v = 0 at ∞
/
/
/
A o m       At A: (1/2)mv2 = GMm/r
/
r /                 v = √(2GM/r)
/
v
M+

```