d
Potential energy of a dipole $\mathrm{U}=-\mathrm{p} \overrightarrow{\mathrm{E}}$
Interaction energy and two adjecent dipoles
$\mathrm{u}_{1}=\frac{\mathrm{kp}^{2}}{\mathrm{a}^{3}} \uparrow \uparrow, \mathrm{u}_{2}=-\frac{\mathrm{kp}^{2}}{\mathrm{a}^{3}} \uparrow \downarrow$
interaction energy of the two end dipoles
$\mathrm{u}_{3}=\frac{\mathrm{kp}^{2}}{8 \mathrm{a}^{3}} \uparrow \uparrow ; \quad \mathrm{u}_{4}=-\frac{\mathrm{kp}^{2}}{8 \mathrm{a}^{3}} \uparrow \downarrow$
Total interaction energy in $\mathrm{I}$ configuration
$U_{1}=U=2 u_{1}+u_{3}=\frac{17 k p^{2}}{8 a^{3}}$ .........$(i)$
Total interaction energy in $\mathrm{II}$ configuration
$\mathrm{U}_{2}=\mathrm{u}_{1}+\mathrm{u}_{2}+\mathrm{u}_{4}=\frac{-\mathrm{kp}^{2}}{8 \mathrm{a}^{3}}$ ........$(ii)$
Work done electric forces
$=U_{1}-U_{2}=\frac{18}{8} \frac{\mathrm{kp}^{2}}{\mathrm{a}^{3}}=\frac{18}{17} \mathrm{U}$