The calculation of gravitational potential energy is very easy for small heights, as it is given by the formula Ep=mgh, which is a measure of the work carried out by the field on a body at a height equal to h. The problem is a bit more complicated when the distances are greater because we cannot use a constant value for the acceleration of gravity as a valid approximation.