Subtleties about divergence
Picture of divergence as expansion
We have shown in a previous reading about the divergence that the divergence measures expansion or compression of a vector field. We ended that section with the example where we immersed a sphere into a vector field that had positive divergence everyone. No matter where one moves the sphere (with the sliders), more fluid flows out of the sphere than into the sphere, indicating the fluid is expanding.
The vector field pictured was
| F(x,y,z) = (x,y,z). | (1) |
div F(x,y,z) = x + y + z = 1 + 1 + 1 = 3, |
Can a picture be misleading?
As one becomes more sophisticated in mathematical thinking, one discovers that pictures can sometimes be misleading. (One reason mathematicians demand mathematical proof is to ensure they aren’t fooling themselves into jumping to conclusions based on incomplete information, such as the information gained solely by exploring pictures.) With regard to divergence, one might wonder if an outward flow, such as pictured above, always means that the divergence of the vector field is positive?
Here’s a picture of a different vector field showing fluid flowing outward from the origin. However, it differs from the above vector field in that the arrows get shorter the further they are from the origin. Is the divergence of this vector field positive? In other words, is the fluid expanding as it may look like from the picture?
To answer this question, we have to compute the divergence. This vector field is
F(x,y,z) = , | (2) |
, where x = (x,y,z).) In this way, the vector field gets smaller as one
moves away from the origin.
We calculate the divergence of F:
| div F(x,y,z) | = ![]() + ![]() + ![]() ![]() | ||
= + + ![]() | |||
= = 0 |
Hence, as long as we are not at the origin, the divergence is zero and the flow is neither expanding nor contracting.
How can we reconcile this with the picture? If the sphere is at the origin, clearly the flow is out of the sphere. But the divergence is not defined at the origin, so we have to ignore that point. If you move the sphere away from the origin, it is not clear if there is more fluid flowing into the sphere or more fluid flowing out. On one hand, the flow out of the sphere is slower than the flow into the sphere, as the arrows are getting shorter. On the other hand, because the flow is radiating outward, the fluid is flowing out of the sphere across more than half of its surface. For this particular vector field, I balanced those two effects (by carefully choosing how quickly the vector field shrinks as one moves away from the origin) so that the net flow into the sphere is exactly equal to the net flow out of the sphere. Hence, if we stay away from the origin, the fluid is neither expanding nor compressing and the divergence is zero.
Dependence on dimension
Here’s one more subtlety just for fun. To make the divergence zero in the above example, I balanced the outward flow of the vector field by shrinking the vector field as one moves away from the origin. Hence, the flow out of the sphere was equal to the flow into the sphere and there was no expansion or compression.
What happens if I take the two-dimensional version of the vector field from equation (2)? The 2D vector field is
F(x,y) = , |
We calculate the divergence of F:
| div F(x,y) | = ![]() + ![]() ![]() | ||
= + ![]() | |||
= = < 0 |
In this case, away from the origin, the divergence is negative. The fluid is compressing even though it is flowing outward.
Why did the dimension make a difference? One can see the difference from the calculations, but what is the difference in the geometric picture? As in the three-dimensional case, the fluid flows into the circle faster than it flows out of the circle, as the arrows are getting shorter. And, as in the three-dimensional case, because the flow is radiating outward, the fluid is flowing out of the circle over more than half the boundary of the circle. But, because we are only in two dimensions, the effect from the boundary is smaller. I chose the vector field to balance the two effects and make the divergence zero in three dimensions. But, this makes the divergence of the two-dimensional analogue be negative.
You can check that the divergence of the vector field
F(x,y) = ![]() |
F(x,y,z) = ![]() |
F(x) = ![]() |
is div F(x) = (3 - p)∕∥x∥p in three dimensions and is div F(x) = (2 - p)∕∥x∥p in two dimensions. So you need p = 3 to have zero divergence in three dimensions and p = 2 to have zero divergence in two dimensions.





+ 
+ 

+
+ 
= 0

+ 

+ 
=


