Dipole moment of each molecules $= 10^{–29} C m $

As 1 mole of the substance contains $6 \times 10^{23}$ molecules,

Total dipole moment of all the molecules, $p = 6 × 10^{23} × 10^{–29}\; C m = 6 × 10^{–6} Cm$

Initial potential energy, $U_i = –pE \cos \theta = –6 × 10^{–6} \times 10^6 cos 0^{\circ} = –6 J$

Final potential energy (when $\theta = 60^{\circ}), U_f = –6 × 10^{–6} × 10^{6} \cos 60^{\circ} = –3 J$

Change in potential energy $= –3 J – (–6J) = 3 J$

So, there is loss in potential energy. This must be the energy released by the substance in the form of heat in aligning its dipoles.