In "Electricity and magnetism" by Benjamin Crowell page 39 there is this:
Recall that the gravitational energy of two gravitationally interacting spheres is given by $PE = -Gm_1m_2/r$ where $r$ is the center-to-center distance.
Is this true? I think comes from the force by distance equation for energy where the force is $F_g = -Gm_1m_2/r^2$ and the distance is $r$ but that implies that the force is constant over the whole range of motion. We can only make such assumptions if the distance between the objects is a lot larger than the range of motion but here they are equal.
I can not just let this slide because we are supposed to make analogy from this about electromagnetic interactions which are referenced numerous times in the rest of the book and it makes appearances in example questions. Am I missing something?