Source: High school physics (Chinese)
Problem Sets:
Problem
An insulating charged sphere A, with charge $q_A = 2.0 \times 10^{-7}$ C, is suspended by a light spring with spring constant $k_s = 15$ N/m. When another charged sphere B is placed below A, the spring's extension increases by an additional $\Delta x = 4.0 \times 10^{-2}$ m. At this point, the distance between the spheres is $r = 0.12$ m.
The additional extension of the spring is caused by the electrostatic force, $F_e$, between spheres A and B. This force must balance the additional spring force, $F_s = k_s \Delta x$.
$$F_e = F_s$$The electrostatic force is given by Coulomb's law: $F_e = k \frac{|q_A q_B|}{r^2}$.
$$k \frac{|q_A q_B|}{r^2} = k_s \Delta x$$Solving for the magnitude of $q_B$:
$$|q_B| = \frac{k_s \Delta x r^2}{k |q_A|}$$Substituting the values:
$$|q_B| = \frac{(15 N/m)(4.0 \times 10^{-2} m)(0.12 m)^2}{(9.0 \times 10^9 N \cdot m^2/C^2)(2.0 \times 10^{-7} C)} = 4.8 \times 10^{-6} C$$Since the spring extension increased, the electrostatic force is downward, meaning it is an attractive force. As $q_A$ is positive, $q_B$ must be negative.