An object of mass m initially at a distance r1 from the Earth's center, is displaced to r2. Since the object moves in Earth's gravitational field, its potential energy changes from U1 to U2. The change in the potential energy is equal to the work done by the gravitational force to displace the object. Here, the work done equals the negative integral of magnitudes of gravitational force and displacement. On substituting for gravitational force and integrating within the limits of r1 and r2, U2 minus U1 equals gravitational constant times the product of the two masses multiplied by one over r1 minus one over r2. Considering the distance r2 as infinity, where the Earth's gravitational field is negligible, the potential energy U2 equals zero. Therefore, the gravitational potential energy for any two masses separated by a distance r is expressed as minus G times the product of two masses, divided by r. Typically, the potential energy increases as the masses move farther apart. Its maximum value is zero for masses at an infinite distance from each other.