\(\displaystyle{V}{\left({r}\right)}=\frac{{1}}{{{4}\pi{\underset{{{0}}}{{\varepsilon}}}}}\times\frac{{Q}}{{r}}\) (a)

\(\displaystyle{r}^{{2}}={R}^{{2}}+{z}^{{2}}\)

\(\displaystyle{r}=\sqrt{{{R}^{{2}}+{z}^{{2}}}}\) (b)

Substitue (b) to (a) to get the potential at the z-axis:

\(\displaystyle{V}{\left({r}\right)}=\frac{{1}}{{{4}\pi{\underset{{{0}}}{{\varepsilon}}}}}\times\frac{{Q}}{{\sqrt{{{R}^{{2}}+{z}^{{2}}}}}}\)

\(\displaystyle{r}^{{2}}={R}^{{2}}+{z}^{{2}}\)

\(\displaystyle{r}=\sqrt{{{R}^{{2}}+{z}^{{2}}}}\) (b)

Substitue (b) to (a) to get the potential at the z-axis:

\(\displaystyle{V}{\left({r}\right)}=\frac{{1}}{{{4}\pi{\underset{{{0}}}{{\varepsilon}}}}}\times\frac{{Q}}{{\sqrt{{{R}^{{2}}+{z}^{{2}}}}}}\)