Gravitational Potential Energy (symbol: U and units: J)

In Work, Energy & Power, the calculation of gravitational potential energy (GPE) is determined using the formula, mgh, which assumes that the gravitational field strength g is roughly constant, but a more robust formula is required for varying field strength, say when sending rockets which travel into outer space from the surface of the Earth.

ߡU = ߡPE = mgh or mgߡh
where ߡPE or ߡU is the gravitational potential energy possessed by mass m measured from the reference height h1
g is the gravitational field strength created by source mass M, typically it is the Earth if used on this planet
h or ߡh is the change in the height (h1 - h0 ) of the mass m.
This formula PE = mgh or mgߡh was appropriate because the magnitude of gravitational field strength, g of Earth was assumed to be constant (9.81 m s-2) over this height.
The more robust formula that can account for varying g in the calculation of potential energy is
U = -mG M r
where
U is the PE is the gravitational potential energy possessed by mass m measured from the reference position at infinity
G is the gravitational constant, approximately 6.673×10−11 N·(m/kg)2
M is the source mass that sets up the gravitational field
m is the test mass experiencing the gravitational field setup by M
r is the distance away from the centre of the gravitational field source mass M

in this particular case, U = -m G M r = -(1) 6.67 x 1 0 -11 ( 100) 100 = - 6.67 x 1 0 -11 J
calculate for the case when r = 50 m.

similarly, U = -m G M r = -(1) 6.67 x 1 0 -11 ( 100 ) 50 = - 13.35 x 1 0 -11 J

Note: Gravitational potential energy  is U = -m G M r

a scalar quantity (i.e. it has no direction only magnitude )
has only negative value due to the reference potential equal zero U = 0, position is defined at position r = infinity ∞, and gravity is attractive which means the lowest potential position is at the centre of the source mass M.
U = -infinity ∞, at r = 0, lowest potential energy
U = 0, at r = infinity ∞, highest potential energy

definition of gravitational potential energy, U

The gravitational potential energy (U) of a mass m at a point (due to the gravitational field set up by mass M ) is defined as the work done by an external agent in bringing the mass from infinity to that point r distance away from source mass M..

to further understand the meaning of this definition, let start with the definition for work done on external agent.

W D =   r F  x
substituting the formula for force F and working out the integration, it can be shown.
W D =   r F d r =   r G M m r 2 $dr=$ [ - G m M r ] r  = [ - G m M r - - G m M  ] = - G m M r
notice the formula for this work done by external agent is equal to the U.
W D = U = - G m M r
To understand this definition, we can use the simulation with some imagination.
Imagine the test mass, m is at a distance r = ∞, U = 0
Let imagine a force pointing towards infinity away from source mass M, acting on this test mass m, the potential at this point would be therefore the work done by this external force.
WD=Ufinal-Uinitial=Ur-U
which we get back the same answer of work done by external force is equal to the gravitational potential energy (U).

Model:

https://dl.dropboxusercontent.com/u/44365627/lookangEJSworkspace/export/ejss_model_gravity05/gravity05_Simulation.xhtml

suggested activity

the test mass (green) is at r = 100 m, observe and record the value for U r=100 = -6.67 x10-11 J
click play and pause the model when r = 90 m, record the value of U r=90 = ____________ J
click play and pause the model when r = 80 m, record the value of U r=80 = ____________ J
click play and pause the model when r = 70 m, record the value of U r=70 = ____________ J
click play and pause the model when r = 60 m, record the value of U r=60 = ____________ J
click play and pause the model when r = 50 m, record the value of U r=50 = ____________ J
click play and pause the model when r = 40 m, record the value of U r=40 = ____________ J
click play and pause the model when r = 30 m, record the value of U r=30 = ____________ J
click play and pause the model when r = 20 m, record the value of U r=20 = ____________ J
calculate the change in U from r = 100 to r = 50.
answer is about δ U = - [ 6.67 x 1 0 -11 ( 1 ) ( 100 ) 50 - 6.67 x 1 0 -11 ( 1 ) ( 100 ) 100 ] = - 6.67 x 1 0 -9 J
check the "your model" checkbox and a teal color line appear. for example if the model is ,  U = - G m M r , key in -6.67*1*100/abs(r) and observe the closeness of fit of the orange color line (data collected) versus the teal color line (model proposed).
Suggest with reason why you think the model -6.67*1*100/abs(r) is accurate.
Note that the model has a multiple of x10-11 so there is no need to key it.