In the figure a thin plastic nonconducting rod forms a semic
Solution
We will keep the solution in terms of the variable until the last step. That helps to avoid calculation related mistakes.
Plus, we can also solve the problem for the two halves independently and the put them together. So we would treat each of the halves as quadrants of charge with radius R and charge q evenly distributed but opposite in signs.
For the positive half:
Here, due to symmetry we can say that the electric field due to this half will point radially away from the charge distribution.
Let us consider a small charge dq at an angle with the diameter.
dE = (2q/R)Rd / R^2
The component along the radial direction would be dE cos(45 - )
Also, we can integrate dE for angle from 0 to 45 and multiply the result by 2 to get the electric field.
that is
dEr = (2q/R^2)cos(45 - )d
Integrating the above we get:
dEr = -2(2q/R^2) [0 - 1/2] = 22q/R^2
Now, this will be pointing radially away from the positively charged half.
Further, the magnitude of the field due to the negatively charged half would be same as above however, it will be pointing radially inwards for this part.
Hence the net electric field will lie alongside the diameter and the magnitude will be the sum of components of the fields along the diameter for the two halves of the distribution.
Hence Enet = 4q/R^2

