Energy per Unit Volume in an Electric Field
Electrostatic force is directed normally outwards on the surface of the charged conductor.To increase the amount of charge on conductor or to increase the volume of electric field, an opposite work against force is done that is stored as energy in the electric field.
For simplicity, we consider a spherical charge of radius $$ r $$. The surface charge density on sphere is $$ \sigma $$ as shown in figure 2.21 .
Pressure outwards on the surface of the sphere
$$ P=\frac{\sigma^2}{2\varepsilon _o}.........(1) $$
Thus, force outwards on the spherical surface
$$ F=PA=\frac{\sigma^2}{2\varepsilon _0} \times 4 \pi r^2 ....(2) $$
Work done to press the phere against the force ny the distance dr,
$$ dW=Fdr=\frac{\sigma^2}{2\varepsilon _0}4 \pi r^2dr $$
Decreases in volume of sphere due to compression (or increases in volume of electric field)
$$ dV=4\pi r^2 dr $$
Thus, $$ dW=\frac{\sigma^2}{2\varepsilon _0}dV ...(3) $$
Energy stored in whole system due to electric field
$$ W=U=\int { \frac {\sigma^2 }{2\varepsilon _0 } } dV=\int { \frac {1 }{ 2 } } \varepsilon _0E^2dV...(4) $$
$$ W=U=\frac{1}{2} \varepsilon _0E^2 \int { dV } $$
And energy stored in per unit volume of electric field or energy density
$$ U_V=\frac{dW}{dV}=\frac{\sigma^2}{2 \varepsilon _0}=\frac{1}{2}\varepsilon _0E^2 ...(5) $$
If there is any other medium in place vacuum or air, then
$$U_r=\frac{1}{2}\varepsilon E^2 $$
$$ U_r=\frac{1}{2}\varepsilon _r\varepsilon _0 E^2 $$
The above formulae are obtained by taking the example of spherical shell but these are widely valid.