How is $r^2$ derived in the law of gravity? I read a very interesting paper named "The true story of Newtonian gravity"(1) and started to wonder about the law of gravity and one aspect of it, namely $r^2$ in $F_{g}=G\frac{{m_1}{m_2}}{{r^2}}$.
My question is how Kepler, Newton and Cavendish derived the $r^2$ term? Did they just accept the predecessors thinking or did they somehow experimentally or by mathematics come to that conclusion?
I'm sorry if i missed something in the paper, but it got me thinking.
(1) Hecht, E. (2021). The true story of Newtonian gravity. American Journal of Physics, 89(7), 683–692. https://doi.org/10.1119/10.0003535
 A: I can't answer this from a pure historical perspective, but newton had the benefit of the observational data that Brahe had built up, along with Kepler's laws, which were good generalizations of Brahe's observational data of the motion of the planets, and I believe, were worked out by Kepler in a purely inductive way.
Once you know the paths of the planets, you then can compute the acceleration of those paths by just taking two time derivatives.  Then, you just have to multiply by m to get the force.  Then, knowing that, it's just a matter of turning around and solving the two body problem explicitly for the inverse square force, which would then predict that the orbits had to be ellipses, and all of the rest that you know.
Note that I make this sound simple, but remember that Newton had to work out calculus, the entire framework of Newtonian mechanics first, and THEN, he also had to have the insight to realize that you could apply insights from terrestrial mechanics to the motions of the planets, which was not the general belief at the time.
