From this experiment, Coulomb was able to write a mathematical expression for the electrostatic force between two charged bodies carrying charges of q1 and q2 placed at a distance of r from each other. That mathematical expression was, indeed, comparable to the gravitation law. That is, the force between the two bodies is proportional to the product of their charges (q1 X q2) and inversely proportional to the square of the distance between them (1/r2). Introducing a proportionality constant of k, Coulomb's law can be written as: q1 X q2 F = kr2. What this law says is that the force between two charged bodies drops off rapidly as they are separated from each other. When the distance between them is doubled, the force is reduced to one-fourth of its original value. When the distance is tripled, the force is reduced to one-ninth.
Coulomb's law applies whether the two bodies in question have similar or opposite charges. The only difference is one of sign. If a positive value of F is taken as a force of attraction, then a negative value of F must be a force of repulsion.
Given the close relationship between magnetism and electricity, it is hardly surprising that Coulomb discovered a similar law for magnetic force a few years later. The law of magnetic force says that it, too, is an inverse square law. In other words: p1 X p2 F = kr2 where p1 and p2 are the strengths of the magnetic poles, r is the distance between them, and k is a proportionality constant.