Answer
See the detailed answer below.
Work Step by Step
We know that the potential at any point is the superposition of the potentials due to all charges.
So the potential at point $\rm p$ due to the $dq$, in the figure below, is given by
$$dV=\dfrac{1}{(4\pi \epsilon_0)}\dfrac{dq}{r}$$
where $r$, from the geometry of the figure below, is given by $\sqrt{x^2+z^2}$
$$dV=\dfrac{1}{(4\pi \epsilon_0)}\dfrac{dq}{\sqrt{x^2+z^2}}\tag 1$$
Let's assume that the linear charge density of this rod is $\lambda$ which is given by
$$\lambda=\dfrac{Q}{L}=\dfrac{dq}{dx}$$
where $dq$ is the charge of the small black segment in the figure below and $dx$ is its length.
Thus,
$$dq=\dfrac{Qdx}{L}\tag 2$$
Plug $dq$ from (2) into (1),
$$dV=\dfrac{Q}{(4\pi \epsilon_0)L}\dfrac{dx}{\sqrt{x^2+z^2}} $$
So the net electric potential at point $\rm p$ is given by
$$V_{\rm p}=\int dV=\int_{-L/2}^{L/2}\dfrac{Q}{(4\pi \epsilon_0)L}\dfrac{dx}{\sqrt{x^2+z^2}} $$
$$V_{\rm p} =\dfrac{Q}{(4\pi \epsilon_0)L}\int_{-L/2}^{L/2}\dfrac{dx}{\sqrt{x^2+z^2}} $$
Due to the symmetry, we can integrate from $0$ to $L/2$ and multiply by 2.
$$V_{\rm p} =\dfrac{2Q}{(4\pi \epsilon_0)L}\int_{0}^{L/2}\dfrac{dx}{\sqrt{x^2+z^2}}$$
$$V_{\rm p} =\dfrac{2Q}{(4\pi \epsilon_0)L}\ln(x+\sqrt{x^2+z^2})\bigg|_{0}^{L/2} $$
$$V_{\rm p} =\dfrac{2Q}{(4\pi \epsilon_0)L}\ln\left[\dfrac{\frac{L}{2}+\sqrt{\left(\frac{L}{2}\right)^2+z^2}}{0+\sqrt{0^2+z^2}}\right]$$
$$V_{\rm p} =\dfrac{2Q}{(4\pi \epsilon_0)L}\ln\left[\dfrac{\frac{L}{2}+\sqrt{\left(\frac{L}{2}\right)^2+z^2}}{z}\right]$$
$$\boxed{V_{\rm p} =\dfrac{2Q}{(4\pi \epsilon_0)L}\;\ln\left[ \frac{L}{2z}+\sqrt{\left(\frac{L}{2z}\right)^2+1} \right]}$$