Along the axis (say the x-axis) the perpendicular components of the E-field due to charges spread around the ring cancel each other out. There is just as much charge on one side of the ring and the other.
The net E-field (on the axis) is along the axis, outwards from the ring if the charge Q is positive and towards the ring in the charge Q is negative.
The charge density l on the ring is just the total charge Q on the ring divided by its circumference 2p R.
Treating the differential charge dq as a point charge the differential electric field at a distance x from the center of the ring (the origin) is given by
Since the sum of the y-components cancel out, the magnitude of the electric field is equal to the sum of the x-components of the E-field. We can express this as an integral over the differential arc length ds,