Electric potential energy in a uniform field
Consider a pair of parallel metal plates setting up a uniform, downward electric field with magnitude E.
$$\begin{aligned} W_{a \rightarrow b} &= Fd \\ &= q_{0} Ed \\ &= q_{0} E (y_{a} – y_{b}) \end{aligned}$$
Note that $W_{a \rightarrow b}$ is the work done by the electric field on the point charge, which is positive in this case.
There is another way to calculate work done from the potential energy:
$$\begin{aligned} W_{a \rightarrow b} &= \, -\Delta U \\ &= \, -(U_{b}-U_{a}) \end{aligned}$$
Hence,
$$U = q_{0} E y$$
where U is the electric potential energy and y is the distance travelled.
For every electric field due to a static charge distribution, the force exerted by that field is conservative.
Electric Potential Energy Of Two Point Charge
Consider a source charge with charge +q and a point charge $q_{0}$ at point a. Point a and b is a distance $r_{a}$ and $r_{b}$ away from the source charge respectively. Point charge $q_{0}$ is then moved from point a to point b, under the influence of a positive point charge q.
Each $\vec{F}$ experienced by the point charge along the way can be decomposed into radial component and tangential component. But the tangential component is 0 as $\vec{F}$ is outwards radially. Force only in a radial direction:
$$F = \int\limits_{r_{a}}^{r_{b}} k \frac{q q_{0}}{r^{2}} \, dr$$
Since the force exerted by a static charge distribution is conservative, the path does not matter. (path independent)
Hence, the total work done in moving the point charge from a to b = force X distance.
$$\begin{aligned} W_{a \rightarrow b} &= \, – (U_{b} – U_{a}) \\ &= \int\limits_{a}^{b} \vec{F}.d\vec{l} \\ &= \int\limits_{a}^{b} F \, \text{cos} \, \phi \, dl \end{aligned}$$
Note that since the force is only in a radial direction, the above equation changes to:
$$\begin{aligned} W_{a \rightarrow b} &= \int\limits_{r_{a}}^{r_{b}} \frac{1}{4 \pi \epsilon_{0}} \frac{q q_{0}}{r^{2}} \, dr \\ &= \, – \frac{1}{4 \pi \epsilon_{0}} \left. \frac{qq_{0}}{r} \right|_{r_{a}}^{r_{b}} \\ &= \frac{qq_{0}}{4 \pi \epsilon_{0}} \left( \frac{1}{r_{a}} – \frac{1}{r_{b}} \right) \end{aligned}$$
From this, we can obtain the electric potential energy of the two point charges separated by a distance r:
$$U = \frac{1}{4 \pi \epsilon_{0}} \frac{qq_{0}}{r}$$
From this we can see that:
$$U \, (r = \infty) = 0$$
Next: Electric Potential Energy With Several Point Charges
Previous: Electric Field Of Two Oppositely Charged Infinite Sheets