Section 6.8 in Matter and Interactions (4th edition)
Gravitational Potential Energy
You have read about the gravitational potential energy associated with a system consisting of an object and the Earth. This form of the gravitational potential energy turns about to be the approximate form of the potential energy for two objects that interact gravitationally. The gravitational potential energy is a powerful tool for modeling the motion of objects that interact through the gravitational force. It will help you to predict and explain the motion of large, massive objects such as planets, moons, and comets. In these notes, you will read about the general form of the gravitational potential energy.
Lecture Video
(Near Earth) Gravitational Potential Energy
Earlier, you read how the gravitational potential energy (J) for a system consisting of two objects (the Earth and something on the surface of the Earth) is given by,
$$\Delta U_{grav} = +mg\Delta y$$
where the separation distance ($\Delta y$) is measured from the surface of the Earth. In this previous calculation, you assumed that the gravitational force was a constant ($\vec{F}_{grav} = \langle 0,-mg,0\rangle$) over the distances that you were considering. This is an approximation, but it's not a bad one for the most part.
However, you will relax this condition now, because as you have read, that the gravitational force between two objects with mass is not a constant vector.
Newtonian Gravitational Potential Energy
In general, the gravitational force exerted on a object of mass $m_1$ due to an object of mass $m_2$ is non-constant,
$$\vec{F}_{grav} = -G\dfrac{m_1m_2}{r^2}\hat{r} \neq\:\mathrm{constant}$$
So for this force, what is the gravitational potential energy?
Solve the One-Dimensional Problem First
Remember that the potential energy change is the negative change in the internal work ($\Delta U = -W_{int}$). So, you can calculate what the work done by the gravitational force would be and use that to determine that change in potential energy in going from location 1 to location 2,
$$U_{grav} = - W_{F_{grav}} \longrightarrow \Delta U_{grav} = -\int_1^2 \vec{F}_{grav}\cdot d\vec{r}$$
where we will first solve the one-dimensional problem.
$$W_F = \int_1^2\vec{F}\cdot d\vec{r} \underbrace{=}_{(1D)} \int_{x_1}^{x_2}F(x)\:dx$$
Consider a mass $M$ at the origin and a mass $m$ at position $x$, as shown in the figure below.
You can compute the work done by the gravitational force as the mass moves from $x=x_1$ to $x=\infty$.
The force on the little mass at any location $x$ is given by
$$F_{grav}(x) = -G\dfrac{Mm}{x^2}$$
where the minus indicates the force points to the left. Because the displacement ($dx$) is to the right, the work done by the gravitational force in this case is negative ($W_{grav} < 0$). This serves as a check for you as you do the calculation; the work that is calculated better be negative.
$$W_{grav} = \int_{x_1}^{\infty} F(x)\:dx = -\int_{x_1}^{\infty}G\dfrac{Mm}{x^2}\:dx = G\dfrac{Mm}{x}\Big|_{x_1}^{\infty} = -G\dfrac{Mm}{x_1}$$
This potential energy is definitely negative because $x_1$ is a positive value. You can now determine the potential energy change,
$$\Delta U_{grav} = -W_{grav} = +G\dfrac{Mm}{x_1}$$ $$\Delta U_{grav} = \underbrace{U(x=\infty)}_{0} - U(x_1) = +G\dfrac{Mm}{x_1}$$ $$U(x_1) = -G\dfrac{Mm}{x_1}$$
General form of the gravitational potential energy
Thus, in general, if we measure the radial distance from an object the gravitational potential energy varies inversely with the distance,
$$U(r) = -G\dfrac{Mm}{r}$$
First, notice that as the distance gets very large the potential energy goes to zero ($U\rightarrow 0$ as $r\rightarrow \infty$).
Second, notice that this is a slight notational change. The distance $r$ is the radial distance from the origin (or the object for which we consider to be at the origin). This value of $r$ is always positive.
As you will read, plotting the potential energy will help you make sense of it.