**Required math: vectors, calculus**

**Required physics: electrostatics**

Reference: Griffiths, David J. (2007) Introduction to Electrodynamics, 3rd Edition; Prentice Hall – Problems 2.32, 2.33.

We’ve seen that, for discrete point charges, the work required to assemble a collection of charges is

where is the potential at the location of charge due to all the other charges (excluding ).

For a continuous charge density we can write this as an integral over the volume containing the charges:

Note, however, that there is a subtle distinction between the discrete and continuous formulas. In the discrete formula, the potential term in the sum *excludes* the charge , but in the integral form, the potential is the complete potential due to the entire charge distribution. In the continuous case, we don’t talk about point charges (unless we write the density as a sum of delta functions), so in that sense the continuous formula is more accurate. However, if point charges such as electrons do truly exist, then we can’t either build them or take them apart, so it seems fair enough to exclude the energies involved in doing so. However, as we’ve seen in the post on discrete charges, the energy associated with a point charge is actually infinite, so it’s dodgy to just ignore it. This problem plagues both classical and quantum electrodynamics, but most books just ignore it.

The integral formula can be expressed in terms of the electric field by using a bit of vector calculus. We know from Gauss’s law for electrostatics that

so we can write the work as

A theorem from vector calculus says

In the last line, we used the relation .

Therefore, the work becomes

We can now use the divergence theorem on the first term, and convert it from a volume integral to a surface integral if we select some surface that encloses all the charge (we’re assuming that we’re dealing with realistic systems so that all the charge is at a finite distance, and not with things like infinite planes of charge). That is, we can say

Since all we require is that the surface encloses all the charges, we can let the surface tend to infinity. In that case, since the charges are all at finite distances, and we are taking the potential to be zero at infinity, and the electric field falls off as , the surface integral will go to zero at infinity. The volume integral is always positive (since we’re integrating the square of the field, which is always positive), so what happens is that as we include more volume, the surface integral decreases and the volume integral increases in such a way as to keep the total work constant. That is, we get

where the integral now covers all space. Note the distinction between 2 and 10: in the first case, we need to integrate only over that volume where ; in the second case we need to integrate over *all* space, since in general the electric field is always non-zero over any finite distance, even for a localized charge distribution.

As an example, we can work out the energy stored in a uniformly charged solid sphere of radius and charge . We’ll do it four different ways to show how each of the above methods works.

**Example 1. **We can use 2. We found the potential of the sphere earlier (Example 1 in this post). The charge density in terms of the total charge is

and the potential inside the sphere (all we need here, since we need to integrate only over that volume where ) is

Therefore, we get

**Example 2. **Same problem, but now we use 10. We worked out the field earlier (Example 2 in this post). In this case, we will need the field for both inside and outside the sphere, since we must integrate over all space. We have, for inside:

and for outside:

The energy is then

**Example 3. **This time we use the formula 9, so the integral is split between a volume integral and a surface integral. If we use a surface of radius , then the volume component can be worked out using the same integrals as in Example 2, but changing the limit on the second integral.

Note that as , this integral tends to the total energy as worked out in the previous two examples: .

The surface integral uses the potential and field at a distance . This time we need the potential outside the sphere, which is

The field at is

Both of these are constants over the bounding sphere, so we get

The total energy is

**Example 4. **Finally, we can build up the solid sphere by adding successive layers of charge of thickness . We have, when the sphere has intermediate radius :

This amount of charge is brought from infinity and added to a spherical volume of charge and radius . We know from above that the potential of such a sphere at its outer boundary is

so the amount of work needed to add this charge to the sphere is

We can then integrate this to find the total work:

## Trackbacks

[…] Work and energy – continuous charge « Physics tutorials […]

[…] we saw that the energy of a static charge distribution could be written in terms of the electric […]

[…] seen that the energy stored in an electric field […]

[…] seen earlier that the energy stored in electric and magnetic fields […]