See 1.2.4 of Griffiths.
The divergence of a vector field is is a scalar function of position and is defined to be
at any point in space, where is a differential volume that surrounds the point. The numerator is a flux, so the physical interpretation is that it is proportional to the net flux into or out of a vanishingly small volume.
In general, this formula will not be used to compute divergence. However, it is important to understand its meaning by using it at least once, which is done in the following example.
Note that Griffiths does not state the definition given above. Instead, in Chapter 1.2.4, he uses the formula and states that the divergence is “a measure of how much the vector spreads out (diverges) from the point in question”. One needs to be very careful with this definition as it does not always work as expected. The vector fields and field lines for and appear to be diverging everwhere. However, for these two , is zero everwhere except at the origin.
There are two vector functions for each coordinate system that you should know the divergence for.
Cartesian
for and for – the divergence is zero for all except as where it approaches infinity.
– the divergence is constant for all
Cylindrical
– the divergence is constant for all
– the divergence is zero for all except as where it approaches infinity.
Spherical
– the divergence is constant for all
– the divergence is zero for all except as where it approaches infinity.
If
1. Compute that applies for any point .
2. Evaluate when
Answer
A side view of a cube centered on the origin with sides of length , , and is shown in the following figure.
1. Only two of the six sides contribute to the flux . The right face at contributes and the left face at contributes . The differential volume is . As a result,
This simplifies to
which is the definition of the derivative of . We conclude that
2. When , , so . The geometrical interpretation of this result is that for a small volume the flux in equals the flux out, which should be clear from the diagram and then flow analogy of field lines.
If , , and all exist, then we do not need to evaluate a surface integral and take a limit to compute . In this case, in cartesian coordinates, it can be shown that
where the definition
was used. If as in the previous problem, we get , which is the same result found using the definition of involving a limit in the previous example.
In general, we will compute divergences using the formula instead of the equation that defines .
Caution: It is easy to mix up the gradient and divergence. The gradient involves applying the vector operator to a scalar function , so the result is a vector:
The divergence involves dotting the vector operator with a vector function , so the result is a scalar:
If , compute using .
Answer:
Here and so
which is the same result found in the previous example using the definition of
If , compute using .
Answer:
To compute
we need to first write fully in cartesian coordinates. From Vectors, , , and , so
and thus , , and . To finish the problem, evaluate
The result should be .
An easier way to solve this is to use the vector operator written in cylindrical coordinates. The equation is given on the second–to–last page of Griffiths and is
For , and and so the last two terms are zero and the first term is straight–forward to calculate:
Sketch the vector field and then compute using in two ways:
1. using the equation for fully in cartesian coordinates, and
2. using the equation for fully in spherical coordinates.
Outside of a solid and long cylinder of radius with a uniform linear charge density of , the field is
inside, it is
Compute using any coordinate system and plot it versus .
Answer
In cylindrical coordinates,
Inside and outside the sphere, so we need only to evaluate
Outside, so that
Note that this equation is only valid for as it is for this problem; if , the result is .
Inside, so that
The plot is constant for and zero for .
Sketch the vector field and then show that
if
and
if .
You may do this using any coordinate system.
Outside of a solid sphere of radius with uniformly distributed charge , the field is
inside, it is
Compute using any coordinate system and plot it versus .
Answer:
In spherical coordinates
Here we have inside and outside of the sphere.
Inside, , so
Using , and , this can be written as
Outside, , so
The plot is a horizontal line of amplitude for and zero for . (If I ask you to plot something, I expect to see a plot even if in the solutions I sometimes don’t provide a plot.)
See also 1.3.4 of Griffiths.
The divergence theorem is
This is a key vector calculus theorem that is used to derive Gauss’s law. The interpretation is that if we add up all of the divergences within a volume , we will get the same result if we compute the flux through the closed surface that encloses the volume.
Sketch the vector field and then verify the divergence theorem using for a sphere of radius centered on the origin.
Answer
In spherical coordinates,
Here and . As a result, the second and third terms are zero and the first term evaluates as
A differential volume for a sphere centered on the origin is . The volume integral is then
A differential element of area on a sphere of radius centered on the origin is
This element has a normal vector of , so
and so
The integral over a closed surface is
Therefore,
Sketch the vector field and then verify the divergence theorem using for a sphere of radius centered on the origin.
Outside of a solid sphere of radius with uniformly distributed charge , the field is
inside, it is
Verify the divergence theorem using
the volume and
the volume (note that this volume has two surfaces).
Sketch the vector field and a sphere of radius centered on .
Then use the divergence theorem to find the flux through the sphere. If you choose to evaluate a surface integral rather than a volume integral, keep in mind that the normal to this sphere is not simply because it is not centered on the origin.