(i) The amount of work done in rotating the dipole from \(\theta = \theta_0\) to \(\theta = \theta_1\) by the external torque is:
\[
W = \int_{\theta_0}^{\theta_1} \tau_{\text{ext}} \, d\theta
\]
Since the torque \(\tau_{\text{ext}} = pE \sin \theta\), we can write:
\[
W = \int_{\theta_0}^{\theta_1} pE \sin \theta \, d\theta
\]
The work done is then:
\[
W = pE (\cos \theta_0 - \cos \theta_1)
\]
For \(\theta_0 = \frac{\pi}{2}\) and \(\theta_1 = \theta\), we get:
\[
W = pE \left( \cos \frac{\pi}{2} - \cos \theta \right) = -pE \left( \cos \theta \right)
\]
The potential energy is given by:
\[
U(\theta) = - pE \cos \theta = - \vec{p} \cdot \vec{E}
\]
(1) The potential energy is maximum when:
\[
\vec{p} \text{ is antiparallel to } \vec{E}
\]
Alternatively:
\[
\theta = 180^\circ \quad \text{or} \quad \pi \, \text{radians}
\]
(2) The potential energy is minimum when:
\[
\vec{p} \text{ is parallel to } \vec{E}
\]
Alternatively:
\[
\theta = 0^\circ
\]