(N/A) Gravitational potential energy is defined as the work done in bringing a body of mass $m$ from an infinite distance to a given point in the gravitational field of another body.
Let the mass of the Earth be $M_E$ and its radius be $R_E$. We want to determine the gravitational potential energy of a mass $m$ at a point $P$ at a distance $r$ from the centre of the Earth $(O)$.
Consider the body of mass $m$ at an arbitrary point $A$ at a distance $x$ from the centre of the Earth $(OP = x)$.
The gravitational force on the body at this point is given by:
$F = \frac{G M_E m}{x^2}$
The work done to move the body by a small displacement $dx$ towards the Earth is:
$dW = F dx = \frac{G M_E m}{x^2} dx$
The total work done to bring the body from infinity to a distance $r$ is:
$W = \int_{\infty}^{r} dW = \int_{\infty}^{r} \frac{G M_E m}{x^2} dx$
$W = G M_E m \int_{\infty}^{r} x^{-2} dx$
$W = G M_E m \left[ -\frac{1}{x} \right]_{\infty}^{r}$
$W = G M_E m \left( -\frac{1}{r} - (-\frac{1}{\infty}) \right)$
Since $\frac{1}{\infty} = 0$,we get:
$W = -\frac{G M_E m}{r}$
Thus,the gravitational potential energy $U$ at distance $r$ is:
$U = -\frac{G M_E m}{r}$