As one particle is moved from \(r = d\) to \(r = d/2\text{,}\) the electric potential difference at the new location is given by
\begin{equation*}
\Delta V = \frac{kq}{r_f} - \frac{kq}{r_i} = \frac{kq}{d/2} - \frac{kq}{d} = \frac{kq}{d}\text{.}
\end{equation*}
The change in electric potential energy is given by
\begin{equation*}
\Delta U_E = q \Delta V\text{.}
\end{equation*}
Plugging in what was found for our electric potential difference, we find that the change in electric potential energy for the system of two point charges is
\begin{equation*}
\Delta U_E = \frac{kq^2}{d}
\end{equation*}
Does this make sense? We know that two like charges want to repel. Here we have two oppositely charged particles that want to push each other away. If we push one charge closer to the other, the magnitude of the electric force is going to get larger. So it requires more energy to push that charge inwards, towards the other charge. We should expect that the potential energy is larger as we move these two charges closer to each other.