Step 1: Understanding the Concept
The potential energy of a dipole in a field is \(U=-pE\cos\theta\). The work done by an external agent is \(W=U_{f}-U_{i}\).
Step 2: Initial and Final Energy
Initially the dipole lies along the field, \(\theta=0^{\circ}\), so \(U_{i}=-pE\). After rotating by \(90^{\circ}\), \(U_{f}=-pE\cos90^{\circ}=0\).
Step 3: Calculation
\(W=0-(-pE)=pE\).
Final Answer:
The work done is pE.
\[ \boxed{\text{(A) }\mathrm{pE}} \]