(I think my question will be somewhat related to this one: Deriving gravitational potential energy using vectors .)
I know the change in the potential energy associated with a conservative force, $\vec{F}$, moving along any path between A and B is given by: $$\Delta U = - \int_{\vec{r_A}} ^{\vec{r_B}} \vec{F} \cdot d\vec{r}$$
So when we're thinking about the force of gravity, $$\vec{F_G} = - \frac{GMm}{r^2}\hat{r}$$ where I've chosen $\vec{F_G}$ to be the graviational force exerted on the mass, $m$ by $M$ and $\vec{r}$ to be the position of the COM of $m$ relative to $M$'s COM.
So I get: $$\Delta U_G = - \int_{\vec{r_A}} ^{\vec{r_B}} \left(- \frac{GMm}{r^2}\hat{r}\right) \cdot d\vec{r} = \int_{\vec{r_A}} ^{\vec{r_B}} \left(\frac{GMm}{r^2}\hat{r}\right) \cdot d\vec{r}$$
Now, how would I go about evaluating this line integral to get: $$\Delta U_G = \left(-\frac{GMm}{r_B}\right) - \left(-\frac{GMm}{r_A}\right)$$