which formula is more accurate for finding gravitational potential energy?
From the work done against the gravity force in bringing a mass in from infinity where the potential energy is assigned the value zero, the expression for gravitational potential energy is
This expression is useful for the calculation of escape velocity, energy to remove from orbit, etc. However, for objects near the earth the acceleration of gravity g can be considered to be approximately constant and the expression for potential energy relative to the Earth's surface becomes
where h is the height above the surface and g is the surface value of the acceleration of gravity.