Potential Energy of a Single Charge
In the previous chapter, we learnt about specific charge, its location, and its electric field, but here we are considering the potential energy of a charge, in an external field.
Consider an external electric field 'E' produced by an external source, where it can specified or unspecified. But the potential 'V' due to external source has to be specified.Let us consider charge 'q' does not effect the external source producing the electric field, which implies q is very small. A strong source placed at infinity produces a finite electric field 'E'. But we are concerned in finding the potential of a given charge and not of a source producing the external field.
The electric field 'E' and the potential 'V' may vary from point to point. If the potential at infinity is zero, then work done in bringing a charge 'q' from infinity to the point 'p' in the external field is q.V. This work is stored as potential energy of q. If 'p' has a position vector, 'r' relative to some origin, then potential energy of q at r in an external field is= qV(r) where V(r) is the external potential at point 'r'.
Potential energy of a system of two charges in an external field
In this context, we have to consider two charges q1, q2 located at r1 and r2 respectively in an external field E. The work done in bringing charge q1 from infinity to r1 is given by q1 V(r1). Similarly, the work done in bringing q2 to r2, the work done is not only against the external field but also against the field due to q1.
Work done against the external field = q2 V (r2) andWork done against the field due to charge q1
where 'r12' is the distance between charge 'q1' and 'q2'.
By the superposition principle for field, we add the work done on q2 against the two fields.
Potential energy of a dipole
Potential energy of a dipole in a uniform external field
In case of a dipole, the charge q1 = +q and q2 = -q. Let the external field 'E' be along the x-direction and origin be the centre of a dipole, then the potential energy of the dipole is
The potential difference between q1 and q2 equals to the work done in bringing a unit positive charge against the field from q2 to q1 and is given by
V(r1) - V(r2) = - E . 2a cosqNegative sign indicates the decrease in potential in the direction of the field. Thus, potential energy of a dipole in a uniform external field 'E' is given by

V = -q.2a E cosq
V = - p.E
Dipole has minimum potential energy when aligned with the field, and also remember that a dipole in a uniform field experiences a torque (t=p.E).Thus, if the dipole can fritter away its potential energy, the torque will align the dipole in the direction of the external field, and bringing its potential to a minimum.

