The forces acting on the sphere are tension in the string T, force of gravity, mg, repulsive electric force, `F_(e)` as shown in the free-body diagram of the sphere. The sphere is in equilibrium. The forces in the horizontal and vertical directions must separately add up to zero
`sumF_(x)=T sin theta-F_(e)=0`...(i)
`sumF_(y)=T cos theta-mg=0`...(ii)
From Eq, (ii) `T=mg//cos theta.` Thus, we can eliminate T from eq (i) to obtain
`F_(e)=mg tan theta` or `(kq^(2))/(r^(2))=mg tan theta` ...(iii)
where `k=(1)/(4 pi epsilon_(0))` and `r=21 sin theta`. Equation (iii) now reduces to
`(1)/(4 pi epsilon_(0))(q^(2))/((2l sin theta)^(2)) =mg tan theta` or `q=sqrt(16pi epsilon_(0)l^(2)mg tan theta sin^(2)theta)`.