$$\require{cancel}$$
We can refer to figure $$\text{V.1}$$. The potential at $$\text{P}$$ from the element $$δM$$ is $$-\frac{GδM}{\left( a^2 + z^2 \right)^{1/2}}$$. This is the same for all such elements around the circumference of the ring, and the total potential is just the scalar sum of the contributions from all the elements. Therefore the total potential on the axis of the ring is:
$ψ = - \frac{GM}{\left(a^2 + z^2 \right)^{1/2}}. \label{5.8.9} \tag{5.8.9}$
The $$z$$-component of the field (its only component) is $$−d/dz$$ of this, which results in $$g = -\frac{GMz}{\left( a^2 + z^2 \right)^{3/2}}.$$ This is the same as Equation 5.4.1 except for sign. When we derived Equation 5.4.1 we were concerned only with the magnitude of the field. Here $$−dψ/dz$$ gives the $$z$$-component of the field, and the minus sign correctly indicates that the field is directed in the negative $$z$$-direction. Indeed, since potential, being a scalar quantity, is easier to work out than field, the easiest way to calculate a field is first to calculate the potential and then differentiate it. On the other hand, sometimes it is easy to calculate a field from Gauss’s theorem, and then calculate the potential by integration. It is nice to have so many easy ways of doing physics!