The field of a ring and of an arc

On the axis of a ring of charge every piece is the same distance away, so only the axial components survive and the integral is a single multiplication, while at the centre of a semicircular arc the sideways components cancel and the rest integrate over the angle.

From AP Physics C: Electricity and Magnetism.