Work done in rotating a dipole =ΔU $\text { or } \begin{aligned}
W & =\left(-P E \cos \theta_f\right)-\left(-P E \cos \theta_i\right) \
& =2 P E \quad\left(\because \theta_f=180^{\circ} \text { and } \theta_i=0^{\circ}\right) \
& =\left(2 \times 6 \times 10^{-6} \times 10^6\right) \mathrm{J}=12 \mathrm{~J}
\end{aligned}$