Divergence
Template:Short description Template:About

In vector calculus, divergence is a vector operator that operates on a vector field, producing a scalar field giving the quantity of the vector field's source at each point. More technically, the divergence represents the volume density of the outward flux of a vector field from an infinitesimal volume around a given point.
As an example, consider air as it is heated or cooled. The velocity of the air at each point defines a vector field. While air is heated in a region, it expands in all directions, and thus the velocity field points outward from that region. The divergence of the velocity field in that region would thus have a positive value. While the air is cooled and thus contracting, the divergence of the velocity has a negative value.
Physical interpretation of divergence
In physical terms, the divergence of a vector field is the extent to which the vector field flux behaves like a source at a given point. It is a local measure of its "outgoingness" – the extent to which there is more of the field vectors exiting an infinitesimal region of space than entering it. A point at which the flux is outgoing has positive divergence, and is often called a "source" of the field. A point at which the flux is directed inward has negative divergence, and is often called a "sink" of the field. The greater the flux of field through a small surface enclosing a given point, the greater the value of divergence at that point. A point at which there is zero flux through an enclosing surface has zero divergence.
A vector field is often illustrated as a "flow" of something, and divergence is often explained using the example of the velocity field of a fluid, a liquid or gas. If a gas is heated, it will expand. This will cause a net motion of gas particles outward in all directions. Any closed surface in the gas will enclose gas which is expanding, so there will be an outward flux of gas through the surface. So the velocity field will have positive divergence everywhere. Similarly, if the gas is cooled, it will contract. There will be more room for gas particles in any volume, so the external pressure of the fluid will cause a net flow of gas volume inward through any closed surface. Therefore the velocity field has negative divergence everywhere. In contrast in an unheated gas with a constant density, the gas may be moving, but the volume rate of gas flowing into any closed surface must equal the volume rate flowing out, so the net flux of fluid through any closed surface is zero. Thus the gas velocity has zero divergence everywhere. A field which has zero divergence everywhere is called solenoidal.
If the fluid is heated only at one point or small region, or a small tube is introduced which supplies a source of additional fluid at one point, the fluid there will expand, pushing fluid particles around it outward in all directions. This will cause an outward velocity field throughout the fluid, centered on the heated point. Any closed surface enclosing the heated point will have a flux of fluid particles passing out of it, so there is positive divergence at that point. However any closed surface not enclosing the point will have a constant density of fluid inside, so just as many fluid particles are entering as leaving the volume, thus the net flux out of the volume is zero. Therefore the divergence at any other point is zero.
Definition

The divergence of a vector field Template:Math at a point Template:Math is defined as the limit of the ratio of the surface integral of Template:Math out of the surface of a closed volume Template:Math enclosing Template:Math to the volume of Template:Math, as Template:Math shrinks to zero
where Template:Math is the volume of Template:Math, Template:Math is the boundary of Template:Math, and Template:Math is the outward unit normal to that surface. It can be shown that the above limit always converges to the same value for any sequence of volumes that contain Template:Math and approach zero volume. The result, Template:Math, is a scalar function of Template:Math.
Since this definition is coordinate-free, it shows that the divergence is the same in any coordinate system. However it is not often used practically to calculate divergence; when the vector field is given in a coordinate system the coordinate definitions below are much simpler to use.
A vector field with zero divergence everywhere is called solenoidal – in which case any closed surface has no net flux across it.
Definition in coordinates
Cartesian coordinates
In three-dimensional Cartesian coordinates, the divergence of a continuously differentiable vector field is defined as the scalar-valued function:
Although expressed in terms of coordinates, the result is invariant under rotations, as the physical interpretation suggests. This is because the trace of the Jacobian matrix of an Template:Math-dimensional vector field Template:Math in Template:Math-dimensional space is invariant under any invertible linear transformation.
The common notation for the divergence Template:Math is a convenient mnemonic, where the dot denotes an operation reminiscent of the dot product: take the components of the Template:Math operator (see del), apply them to the corresponding components of Template:Math, and sum the results. Because applying an operator is different from multiplying the components, this is considered an abuse of notation.
The divergence of a continuously differentiable second-order tensor field Template:Math defined as:
is a first-order tensor field:Template:Sfn
Cylindrical coordinates
For a vector expressed in local unit cylindrical coordinates as
where Template:Math is the unit vector in direction Template:Math, the divergence isTemplate:Refn
The use of local coordinates is vital for the validity of the expression. If we consider Template:Math the position vector and the functions , , and , which assign the corresponding global cylindrical coordinate to a vector, in general , , and . In particular, if we consider the identity function , we find that:
- .
Spherical coordinates
In spherical coordinates, with Template:Math the angle with the Template:Math axis and Template:Math the rotation around the Template:Math axis, and again written in local unit coordinates, the divergence isTemplate:Refn
General coordinates
Using Einstein notation we can consider the divergence in general coordinates, which we write as Template:Math, where Template:Mvar is the number of dimensions of the domain. Here, the upper index refers to the number of the coordinate or component, so Template:Math refers to the second component, and not the quantity Template:Math squared. The index variable Template:Math is used to refer to an arbitrary element, such as Template:Math. The divergence can then be written via the Voss- Weyl formula[1], as:
where is the local coefficient of the volume element and Template:Math are the components of Template:Math with respect to the local unnormalized covariant basis (sometimes written as ). The Einstein notation implies summation over Template:Math, since it appears as both an upper and lower index.
The volume coefficient is a function of position which depends on the coordinate system. In Cartesian, cylindrical and spherical coordinates, using the same conventions as before, we have , and , respectively. It can also be expressed as , where is the metric tensor. Since the determinant is a scalar quantity which doesn't depend on the indices, we can suppress them and simply write . Another expression comes from computing the determinant of the Jacobian for transforming from Cartesian coordinates, which for Template:Math gives
Some conventions expect all local basis elements to be normalized to unit length, as was done in the previous sections. If we write for the normalized basis, and for the components of Template:Math with respect to it, we have that
using one of the properties of the metric tensor. By dotting both sides of the last equality with the contravariant element , we can conclude that . After substituting, the formula becomes:
- .
See Template:Section link for further discussion.
Decomposition theorem
Template:Main It can be shown that any stationary flux Template:Math that is at least twice continuously differentiable in Template:Math and vanishes sufficiently fast for Template:Math can be decomposed into an irrotational part Template:Math and a source-free part Template:Math. Moreover, these parts are explicitly determined by the respective source densities (see above) and circulation densities (see the article Curl):
For the irrotational part one has
with
The source-free part, Template:Math, can be similarly written: one only has to replace the scalar potential Template:Math by a vector potential Template:Math and the terms Template:Math by Template:Math, and the source density Template:Math by the circulation density Template:Math.
This "decomposition theorem" is a by-product of the stationary case of electrodynamics. It is a special case of the more general Helmholtz decomposition which works in dimensions greater than three as well.
Properties
The following properties can all be derived from the ordinary differentiation rules of calculus. Most importantly, the divergence is a linear operator, i.e.,
for all vector fields Template:Math and Template:Math and all real numbers Template:Math and Template:Math.
There is a product rule of the following type: if Template:Mvar is a scalar-valued function and Template:Math is a vector field, then
or in more suggestive notation
Another product rule for the cross product of two vector fields Template:Math and Template:Math in three dimensions involves the curl and reads as follows:
or
The Laplacian of a scalar field is the divergence of the field's gradient:
The divergence of the curl of any vector field (in three dimensions) is equal to zero:
If a vector field Template:Math with zero divergence is defined on a ball in Template:Math, then there exists some vector field Template:Math on the ball with Template:Math. For regions in Template:Math more topologically complicated than this, the latter statement might be false (see Poincaré lemma). The degree of failure of the truth of the statement, measured by the homology of the chain complex
serves as a nice quantification of the complicatedness of the underlying region Template:Math. These are the beginnings and main motivations of de Rham cohomology.
Relation with the exterior derivative
One can express the divergence as a particular case of the exterior derivative, which takes a 2-form to a 3-form in Template:Math. Define the current two-form as
It measures the amount of "stuff" flowing through a surface per unit time in a "stuff fluid" of density Template:Math moving with local velocity Template:Math. Its exterior derivative Template:Math is then given by
Thus, the divergence of the vector field Template:Math can be expressed as:
Here the superscript Template:Music is one of the two musical isomorphisms, and Template:Math is the Hodge star operator. Working with the current two-form and the exterior derivative is usually easier than working with the vector field and divergence, because unlike the divergence, the exterior derivative commutes with a change of (curvilinear) coordinate system.
Generalizations
The divergence of a vector field can be defined in any number of dimensions. If
in a Euclidean coordinate system with coordinates Template:Math, define
The appropriate expression is more complicated in curvilinear coordinates.
In the case of one dimension, Template:Math reduces to a regular function, and the divergence reduces to the derivative.
For any Template:Math, the divergence is a linear operator, and it satisfies the "product rule"
for any scalar-valued function Template:Mvar.
The divergence of a vector field extends naturally to any differentiable manifold of dimension Template:Math that has a volume form (or density) Template:Mvar, e.g. a Riemannian or Lorentzian manifold. Generalising the construction of a two-form for a vector field on Template:Math, on such a manifold a vector field Template:Math defines an Template:Math-form Template:Math obtained by contracting Template:Math with Template:Mvar. The divergence is then the function defined by
Standard formulas for the Lie derivative allow us to reformulate this as
This means that the divergence measures the rate of expansion of a volume element as we let it flow with the vector field.
On a pseudo-Riemannian manifold, the divergence with respect to the metric volume form can be computed in terms of the Levi-Civita connection Template:Math:
where the second expression is the contraction of the vector field valued 1-form Template:Math with itself and the last expression is the traditional coordinate expression from Ricci calculus.
An equivalent expression without using connection is
where Template:Mvar is the metric and Template:Math denotes the partial derivative with respect to coordinate Template:Math.
Divergence can also be generalised to tensors. In Einstein notation, the divergence of a contravariant vector Template:Mvar is given by
where Template:Math denotes the covariant derivative.
Equivalently, some authors define the divergence of a mixed tensor by using the musical isomorphism Template:Music: if Template:Math is a Template:Math-tensor (Template:Math for the contravariant vector and Template:Math for the covariant one), then we define the divergence of Template:Mvar to be the Template:Math-tensor
that is, we take the trace over the first two covariant indices of the covariant derivativeTemplate:Efn