The potential energy of a dipole in an electric field is given by: \[ U = - \mathbf{p} \cdot \mathbf{E} = - pE \cos \theta \]. The initial energy, when the dipole aligns with the field (\(\theta = 0^\circ\)), is \( U_i = - pE \). When the dipole is oriented opposite to the field (\(\theta = 180^\circ\)), the final energy is \( U_f = pE \). The work done to rotate the dipole is the difference between the final and initial energies: \[ W = U_f - U_i = pE - (-pE) = 2pE \]. Substituting the given values: \[ W = 2 \times (6 \times 10^{-6}) \times (10^6) \] \[ W = 12 \times 10^{-3} = 6 \times 10^{-3} \, \text{J} \].