Electric charge is distributed uniformly around a thin ring of radius a, with total charge Q. Find the potential at a point P on the ring axis at a distance x from the centre of the ring.
Linear charge density:
$$\lambda = \frac{Q}{2 \pi a}$$
A small element of charge is the product of the linear charge density and the small arc length:
$$dQ = \lambda a \, d \theta$$
$$\begin{aligned} dV &= \frac{dQ}{4 \pi \epsilon_{0} r} \\ &= \frac{\lambda a \, d \theta}{4 \pi \epsilon_{0} \sqrt{a^{2} + x^{2}}} \end{aligned}$$
$$\begin{aligned} V &= \frac{\lambda a}{4 \pi \epsilon_{0} \sqrt{a^{2} + x^{2}}} \int\limits_{0}^{2 \pi} \, d \theta \\ &= \frac{Q}{4 \pi \epsilon_{0} \sqrt{a^{2} + x^{2}}} \end{aligned}$$
We’re done!
We can check the answer above as we have derived the electric field of a ring of charge. We recall that $E_{x} = \, – \frac{\partial V}{\partial x}$
$$\begin{aligned} E_{x} &= \, – \frac{\partial V}{\partial x} \\ &= \frac{x Q}{4 \pi \epsilon_{0} (a^{2} + x^{2})^{\frac{3}{2}}} \end{aligned}$$
The expression for electric field of a ring of charge is the same as the one that was derived.