a
Here, torque \(\tau=p E \sin \theta,\) here \(\theta\) is the anlge between electric field and dipole moment Potential energy of the dipole
\(U = - \int {\tau \,} d\theta \)
\(=-\int_{\pi / 2}^{0} p E\,\sin \theta d \theta=p E[\cos \theta-0]\)
\(=-p E \,\cos \theta\)