# Gravitational potential negative sign confusion

Gravitational potential is negative because the reference point, at infinity, the g.p is defined to be zero. In my first derivation for work done by gravity to bring a mass from r to infinity, the results turns out to be negative, which makes sense and follows the definition as the object is moving in the opposite direction of gravity and gravity is doing negative work.

In my second derivation, I would expect the work done to be positive as the direction of gravity and direction of object is the same. From the maths point of view, it makes sense as I am swapping the limits and sign together, but I am confused about what it actually implies.

This is a mathematical issue. The reason you get the same sign from both calculations is that you've corrected for the flipped limits in the latter version. Just like when I correct the below with a minus sign:

\begin{align}\int_a^b\mathrm dr&=-\int_b^a\mathrm dr\\ b-a&=-(a-b)\\ b-a&=b-a\end{align}

Calculating the left-hand-side and right-hand-side now gives equal, same-sign results. Flipping the limits would have given an opposite sign, but by adding the minus sign manually, this is cancelled out, so the results are the same.

Basically, what I have done with this correction is flipping the coordinate axis so that the sign when integrating from $$a$$ to $$b$$ is the same as when integrating from $$b$$ to $$a$$ (backwards). With a flipped coordinate axis, the result should also be interpreted according to this new coordinate axis. The negative result from your latter calcultation is thus with respect to the opposite direction as the negative result from your former calculation.

In your first derivation, gravity alone would not be moving the object from r to $$\infty$$. Something else inputs energy $$\frac{GMm}{r}$$ and gravity subtracts it.

In your second derivation, gravity alone can move the object from $$\infty$$ to r. Gravity adds energy to the object so that the kinetic energy is positive. F is in the $$-\hat{r}$$ direction, $$ds = \hat{r}dr$$, so you integrate $$-\frac{GMm}{r^{2}}$$ from $$\infty$$ to $$r$$.

You can either think of the path as chunks of $$ds = -\hat{r}dr$$ starting from $$r$$ and going to $$\infty$$, or you can think of the path as chunks of $$ds = \hat{r}dr$$ but with the limits reversed. Pretty tricky, to be honest.

You can see here for a more careful treatment