So I was trying to think of a reasonable relationship between gravitational potential and gravitational field strength. However, I'm not sure whether this is correct:
$g=\frac{GM}{r^2}$ where $g$ is the gravitational field strength at a point which is $r$ meters away from a point mass.
$\phi = -\frac{GM}{r}$ where $\phi$ is the gravitational potential at a point which is also $r$ meters away from a point mass.
Now, since the gravitational potential is defined as:
Gravitational potential at a point in a gravitational field is defined as the work done per unit mass in bringing a small test mass from infinity to the point.
So therefore:
$\phi=\frac{GM}{r^2}\times(\infty-r)$
$\phi = \infty - \frac{GMr}{r^2}$
$\phi = \infty - \frac{GM}{r}$
Here, I noticed that this is not equal to the formula $\phi = -\frac{GM}{r}$.
Can someone please explain to me why this is the case? Or is this way of deriving the formula for gravitational potential completely wrong?