Use and Gauss's law . The divergence theorem and the decay at infinity give
Multiplying by proves that the two expressions for the electrostatic energy agree.
The uniform volume charge density in the thick shell is
Spherical symmetry and the integral form of Gauss's law give
Thus is zero inside, rises continuously through the charged region, reaches at , and then decays as . Taking and integrating gives
The electric potential is continuous, constant inside, decreases smoothly across the charge, and continues as outside.
As , the charge becomes a surface shell. Then
The potential remains continuous, but the normal electric field jumps by across the surface charge density.
The field-energy expression gives
The charge-potential expression gives the same result directly because the entire charge lies where the potential equals :
This is the electrostatic energy of a uniformly charged spherical shell.
Since is proportional to ,
to first order. This is the work required to bring the additional charge from infinity to the potential created by the charge already present.