The potential energy of an electric dipole in an electric field is defined as the work done in bringing the dipole from infinity to its present position in the electric field.
Suppose the dipole is brought from infinity and placed at orientation θ with the direction of electric field. The work done in this process may be supposed to be done in two parts.
(i) The work done (W1) in bringing the dipole perpendicular to electric field from infinity.
(ii) Work done (W2) in rotating the dipole such that it finally makes an angle θ from the direction of electric field.
Let us suppose that the electric dipole is brought from infinity in the region of a uniform electric field such that its dipole moment \(\overrightarrow P\) always remains perpendicular to electric field. The electric forces an charges +q and – q are qE and qE, along the field direction and opposite to field direction respectively.

As charges +q and –q traverse equal distance under equal and opposite forces; therefore, net work done in bringing the dipole in the region of electric field perpendicular to field-direction will be zero, i.e., W1= 0.
Now the dipole is rotated and brought to orientation making an angle θ with the field direction (i.e., θ0 = 90° and θ1 = θ°), therefore, work done


\(\therefore\) Total work done in bringing the electric dipole from infinity, i.e.,
Electric potential energy of electric dipole

For rotating dipole from position of unstable equilbrium (θ0 = 180°) to the stable equilbrium (θ = 0°)
