$\newcommand{\mid}{|}$
$\newcommand{\label}[1]{}$
\begin{eqnarray}
W_2&=&\frac{q_1q_2}{4\pi\epsilon_0\mid\bar{r_1}-\bar{r_2}\mid} \label{eq2}\\
W_3&=&\frac{q_1q_3}{4\pi\epsilon_0\mid\bar{r_1}-\bar{r_3}\mid}+\frac{q_2q_3}{
4\pi\epsilon_0\mid\bar{r_3}-\bar{r_2}\mid} \label{eq3}\\
W_4&=&\frac{q_1q_4}{4\pi\epsilon_0\mid\bar{r_1}-\bar{r_4}\mid}+\frac{q_2q_4}{
4\pi\epsilon_0\mid\bar{r_2}-\bar{r_4}\mid}+\frac{q_3q_4}{4\pi\epsilon_0\mid\bar{r_3
}-\bar{r_4}\mid} \label{eq4}\\
W_k&=&\frac{q_k}{4\pi\epsilon_0}\Sigma_{i=1}^{k-1}\frac{q_i}{\mid\bar{r_i}-\bar{
r_k}\mid} \label{eq5}\\
W&=&W_1+W_2+W_3+\ldots+W_n\\ \label{eq6}
&=&\frac{1}{4\pi\epsilon_0}\sum_{k=1}^n\sum_{i=1}^{k-1}\frac{q_iq_k}{
\mid\bar{r_i}-\bar{r_k}\mid} \label{eq7}.
\end{eqnarray}
For a point at unit distance from the origin and lying on the old axis $0{X_1}$, we have \begin{equation} x=\left[\begin{array}{c}1\\0\\0\end{array}\right] \text{ and } \acute{x}= \left[\begin{array}{c} l_1\\m_1\\n_1\end{array}\right] % \end{equation} % \begin{equation} \Longrightarrow \left[\begin{array}{c}l_1\\m_1\\n_1 \end{array}\right]=R\left[\begin{array}{c}1\\0\\0 \end{array}\right]. \end{equation}