The energy stored in an electrostatic field is
integrated over all of space (or any volume containing the field). The integrand is the electrostatic energy density:
The energy is not localized on the charges, it’s stored in the field that fills space. Charges aren’t independent “things that have potential energy”; they couple through the field that lives between them, and the energy is literally in that field.
Derivation via capacitor
Charge up a capacitor of capacitance from to , transferring total charge . At an intermediate state with charge on the plates, the voltage is . Transferring an additional requires work :
Using :
For a parallel-plate capacitor, substitute and :
The volume is (the volume between the plates) and the energy density is .
Generalization
The expression derived for parallel plates turns out to be universally valid: it gives the local energy density wherever there’s an electric field, in any dielectric or vacuum, regardless of how the field was set up.
Justification: build up any charge distribution by bringing in infinitesimal charges from infinity; track the total work done; rewrite as a field integral using Gauss’s law and the divergence theorem. The result always reduces to integrated over all space.
In a multi-conductor system
For a system of conductors at potentials carrying charges , the total electrostatic energy is
For a two-conductor capacitor (, , ), this reproduces .
Why the factor of 1/2
The factor catches a lot of students. To assemble the configuration you bring charges in gradually, and early charges don’t see the full final field, only what’s been assembled so far. The “average voltage encountered” is half the final voltage. So work done is , not .
A common wrong intuition: “because force distance.” The right intuition is: the field grows linearly as you add charge, and you integrate force-against-field as the field builds.
Comparison with magnetic energy
The magnetic analog:
For an inductor: . The in Magnetic energy has the same origin, the field builds gradually as you ramp the current.
In an electromagnetic wave, both densities are present and equal on time-average:
Half the wave’s energy is in the electric field, half in the magnetic. The Poynting vector describes the flow of this total energy density.