A thin glass rod is bent into a semicircle of radius r. A charge +Q is uniformly distributed along the upper half, and a charge -Q is uniformly distributed along the lower half, as shown in figure. The electric field E at P, the center of the semicircle, is:
Take PO as the x-axis and PA as the y-axis. Consider two elements EF and E'F' of width dθ at angular distance θ above and below PO, respectively.
The magnitude of the field at P due to either element is
dE=14πε0rdθ×Q/(πr/2)r2=Q2π2ε0r2dθ
Resolving the fields, we find that the components along PO sum up to zero, and hence the resultant field is along PA.
Therefore, field at P due to pair of elements is 2 E sin θ
E=∫π/202Esinθ
=2∫π/20Q2π2ε0r2sinθdθ=Qπ2ε0r2