
$W=-\frac{k}{r^{3}}\left[\frac{3\left(\vec{p}_{1} \cdot \vec{r}\right)\left(\vec{p}_{2} \cdot \vec{r}\right)}{r^{2}}-\vec{p}_{1} \cdot \vec{p}_{2}\right]$
here, $\overrightarrow{p_{1}} \cdot \vec{r}=P_{1} r \cos 0=P_{1} r, \quad \overrightarrow{p_{2}} \cdot \vec{r}=P_{2} r \cos \theta, \quad \overrightarrow{p_{1}} \cdot \overrightarrow{p_{2}}=P_{1} P_{2} \cos \theta$
Now, $W=-\frac{k}{r^{3}}\left[\frac{3\left(P_{1} r\right)\left(P_{2} r \cos \theta\right)}{r^{2}}-P_{1} P_{2} \cos \theta\right]=-\frac{k}{r^{3}}\left[3 P_{1} P_{2} \cos \theta-P_{1} P_{2} \cos \theta\right]=$
$-\frac{2 k P_{1} P_{2} \cos \theta}{r^{3}}$







