# How did Newton come up with the formula for gravity? [duplicate]

In high school students are taught the formula that describes the universal gravitational force $F=G\frac{m_1 m_2}{r^2}$. However it is not taught how and why Newton came up with it. Does Newton give a demonstration of the formula?