As we know that electrostatic force is a conservative force
so we can say by the condition of conservative force
[tex]F_c = -\frac{dU}{dr}[/tex]
here we can rearrange the above equation as
[tex]dU = - F_c.dr[/tex]
now integrate both sides
[tex]\int dU = - \int F_c . dr[/tex]
Now we know by the definition of work done by a force is given by
[tex]W = \int F.dr[/tex]
now work done by conservative force is given as
[tex]W_c = \int F_c . dr[/tex]
Now from above work done by electric field to move charge from one point to other is given as
[tex]W_{EF} = \int F_{e}.dr = - \int dU[/tex]
so here work done is given as
[tex]W_{EF} = U_i - U_f[/tex]
so change in potential energy is given by work done