Electric and gravitational forces are both conservative forces, that is the total mechanical energy of the system is conserved. For example, when you through a body upward, the body reaches its maximum height and gains maximum potential energy and falls back converting that potential energy back into kinetic energy and the total mechanical energy (kinetic energy plus potential energy) at each point on its path is constant or conserved.

In Figure 1 a test charge $q_0$ moves in the direction of force which means the force and the displacement are in the same direction and therefore the work done by the electric field $\vec{E}$ is positive.

The electric force on the test charge $q_0$ is $\vec F=q_0\vec E$ which is similar to the case for the gravitational force $\vec F=m\vec g$. Since the work done is positive and $y_1 > y_2$ the work done along a displacement from $y_1$ to $y_2$ is

\[W = {q_0}E{y_1} - {q_0}E{y_2} = q_0 E(y_1 - y_2) = -q_0 E(y_2 -y_1)\]

You can also define work done as the initial potential energy minus the final potential energy which is the same as the negative of the change in potential energy. This is a bit confusing but you should note that work done is positive if the force and displacement both are in the same direction and negative if they are in the opposite direction.

We consider a system of a test charge $q_0$ and point charge $q$ as shown in Figure 2. Now consider that the charge $q_0$ moves from position $r_a$ to $r_b$. The work done on the charge by the electric field $\vec E$ through a small displacement $dr=dl\cos \alpha $ in the direction of electric field is

\[dW = \vec F.d\vec l = {q_0}\vec E.d\vec l = {q_0}Edl\cos \alpha = {q_0}Edr\]

The total work done by the electric field is calculated by the integration of the small work done $dW$ from $r_a$ to $r_b$.

\[\begin{align*} W &= \int_{{r_a}}^{{r_b}} {dW} = {q_0}\int_{{r_a}}^{{r_b}} {Edr} \\ &= kq{q_0}\int_{{r_a}}^{{r_b}} {\frac{1}{{{r^2}}}dr} = kq{q_0}\left( {\frac{1}{{{r_a}}} - \frac{1}{{{r_b}}}} \right)\\ {\rm{or,}}\quad W &= \frac{{kq{q_0}}}{{{r_a}}} - \frac{{kq{q_0}}}{{{r_b}}} \tag{1} \label{1} \end{align*}\]

The work done is independent of the nature of path but depends only on the initial position $\vec r_a$ and the final position $\vec r_b$. If the charge moves from a position to anywhere and comes back to the same position, the work done is zero. The work done is the initial potential energy $U_1$ minus the final potential energy $U_2$ (that is, the negative of the change in potential energy). So, comparing $W=U_1 - U_2$ and Eq.\eqref{1}, the potential energy of the charge $q_0$ and $q$ at a distance $r$ is

\[U = k\frac{{q{q_0}}}{r} \tag{2} \label{2}\]

Note that potential energy is the shared property of the system. So we don't say the potential energy of a specific charge but we say the potential energy of the system of both charges or the combination of both charges.

The potential energy of the system of $q$ and $q_0$ at infinite separation is zero. And the work done is the initial potential energy at a distance $r$ minus the final potential energy.

\[W=\frac{q{{q}_{0}}}{4\pi {{\epsilon }_{0}}r}-0\]

From this expression you can understand that the work is done along a displacement from the initial position at $r$ to the final position at infinity. If the charges have the same sign, we can interpret the potential energy at a distance $r$ as the total work done by an external force to bring the test charge $q_0$ from infinity (position of lower potential energy) to the position at the distance $r$ (position of higher potential energy) against the electric force. If the charges $q$ and $q_0$ have opposite sign, the potential energy can be interpreted as the amount of work done required to push the charge from the position at the distance $r$ (position of lower potential energy = more negative) to the infinity (position of higher potential energy which at infinity is zero).

The potential energy of a test charge $q_0$ at a point $p$ (see Figure 3) and collection of charges $q_1$, $q_2$, $q_3$, $q_4$ etc. at distance $r_1$, $r_2$, $r_3$ and $r_4$ respectively from the test charge is the algebraic sum of the potential energies due to individual charges (as Eq.\eqref{2} suggests).

\[\begin{align*} {U_{{\rm{total}}}} &= k{q_0}\left( {\frac{{{q_1}}}{{{r_1}}} + \frac{{{q_2}}}{{{r_2}}} + \frac{{{q_3}}}{{{r_3}}} + \frac{{{q_4}}}{{{r_4}}}} \right)\\ {\rm{or,}}\quad {U_{{\rm{total}}}} &= k{q_0}\sum\limits_{n = 1}^n {\frac{{{q_n}}}{{{r_n}}}} \tag{3} \label{3} \end{align*}\]

Any static charge distribution can be considered as the collection of point charges and the above equation shows us the potential energy of a test charge and a static charge distribution. So, *the force exerted by the electric field of any static charge distribution is conservative*.

## Electric Potential

Electric potential is the electric potential energy per unit charge. We know the potential energy of test charge $q_0$ and point charge $q$ from Eq.\eqref{2} and therefore the electric potential is

\[V = \frac{{\left( {k\frac{{q{q_0}}}{r}} \right)}}{{{q_0}}} = k\frac{q}{r} \tag{4}\]

The above equation shows that the electric potential is independent of $q_0$. The SI unit of electric potential or simply potential is J/C or *volt* written as V.

Now the electric potential due to the collection of charges $q_1$, $q_2$, $q_3$, $q_4$ etc. at a point say $p$ at distance $r_1$, $r_2$, $r_3$ and $r_4$ respectively is the sum of the potentials due to individual charges.

\[\begin{align*} {V_{{\rm{total}}}} &= k\left( {\frac{{{q_1}}}{{{r_1}}} + \frac{{{q_2}}}{{{r_2}}} + \frac{{{q_3}}}{{{r_3}}} + \frac{{{q_4}}}{{{r_4}}}} \right)\\ {\rm{or,}}\quad {V_{{\rm{total}}}} &= k\sum\limits_{n = 1}^n {\frac{{{q_n}}}{{{r_n}}}} \tag{5} \end{align*}\]

If the electric charge is uniformly distributed over a surface or throughout a volume, we can make a small element of charge $dq$ and determine the electric potential at any point inside the electric field. The total electric potential due to the surface or volume of charge is the sum of electric potentials due to all element charges.

\[V = k\int {\frac{{dq}}{r}} \tag{6}\]

## Potential Difference

In Figure 2 the work done by the electric force from point $a$ to point $b$ is the potential energy at $a$, $U_a$ minus the potential energy at $b$, $U_b$.

\[{W_{{\rm{ab}}}} = {U_a} - {U_b} = \frac{{kq{q_0}}}{{{r_a}}} - \frac{{kq{q_0}}}{{{r_b}}}\]

In terms of *per unit* basis the work done per unit charge from point $a$ to $b$ is $W_\text{ab}$ divided by $q_0$

\[\frac{{{W_{{\rm{ab}}}}}}{{{q_0}}} = k\frac{q}{{{r_a}}} - k\frac{q}{{{r_b}}} = {V_a} - {V_b}\]

So the work done by the electric force per unit charge from the initial position at $a$ to the final position at $b$ is the electric potential at $a$ minus the electric potential at $b$. The difference $V_a - V_b$ is called the potential difference of point $a$ with respect to point $b$ which is the work done but in *per unit* basis. If the potential of point $a$ with respect to point $b$ is $V_{ab}$,

\[{V_{ab}} = k\frac{q}{{{r_a}}} - k\frac{q}{{{r_b}}} = {V_a} - {V_b}\tag{7} \label{7}\]