Well, if we apply Gauss' law
is the flux of the electric field E through the surface S. In this case, as the direction of the field is always normal to the sphere's surface we can write ΦS
=ES, so we get:
As the electric field is F/q we have, at last (q2
is the charge we put in the electric field generated by the charge q1
A more straightforward way to get the inverse square law would be to derive your expression (using r as the independent variable), as E is also dV/dr (where my V is your E, the electric potential):
(the "-" only means that the direction of the force vector is opposite to the increase in the electric potential)
Hope it's all clear now... what you did is also a common way to verify Gauss' law with an easy example...