Concept:At equilibrium the net force on the bob is zero, so the tension must balance the vector sum of the weight and the electric force.The weight mg acts vertically downward.The electric force qE acts horizontally (since the field is horizontal and the bob is charged).Explanation:Let the string make an angle θ with the vertical in the equilibrium position.Resolve the tension into components:Vertical component: Tcosθ=mg.Horizontal component: Tsinθ=qE.Square and add the two equations:T2(sin2θ+cos2θ)=(mg)2+(qE)2.Since sin2θ+cos2θ=1,T2=m2g2+q2E2.Therefore, T=m2g2+q2E2.Note that mg+qE or mg−qE would only be valid if the two forces acted along the same line, which is not the case here.