Expression for electrostatic potential energy of the dipole in a uniform electric field:
Considera dipole placed in the uniform electric field \(\vec E\) placed in the uniform electric field \(\vec E\). A dipole experiences a torque when kept in an uniform electric field E.

This torque rotates the dipole to align it with the direction of the electric field. To rotate the dipole (at constant angular velocity) from its initial angle θ’ to another angle θ against the torque exerted by the electric field, an equal and opposite external torque must be applied on the dipole. The work done by the external torque to rotate the dipole from angle θ’ to θ at constant angular velocity is

This work done is equal to the potential energy difference between the angular positions 0 and 0′.
U(θ) – (Uθ’) = ΔU = -pE cos θ + pE cos θ’.
If the initial angle is = θ’ = 90° and is taken as reference point, then U(θ’) + pE cos 90° = 0. The potential energy stored in the system of dipole kept in the uniform electric field is given by.
U = -pE cos θ = -p-E ……………. (3)
In addition to p and E, the potential energy also depends on the orientation θ of the electric dipole with respect to the external electric field.
The potential energy is maximum when the dipole is aligned anti-parallel (θ = Jt) to the external electric field and minimum when the dipole is aligned parallel (θ = 0) to the external electric field.