The divergence of different vector fields. The divergence of vectors from point (x,y) equals the sum of the partial derivative-with-respect-to-x of thex-component and the partial derivative-with-respect-to-y of they-component at that point:
Invector calculus,divergence is avector operator that operates on avector field, producing ascalar field giving the rate that the vector field alters the volume in an infinitesimal neighborhood of each point. (In 2D this "volume" refers to area.) More precisely, the divergence at a point is the rate that the flow of the vector field modifies a volume about the pointin the limit, as a small volume shrinks down to the point.
As an example, consider air as it is heated or cooled. Thevelocity 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.
In physical terms, the divergence of a vector field is the extent to which the vector fieldflux behaves like asource or a sink at a given point. It is a local measure of its "outgoingness" – the extent to which there are more of the field vectors exiting from 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.
The divergence of a vector field is often illustrated using the simple example of thevelocity field of a fluid, a liquid or gas. A moving gas has avelocity, a speed and direction at each point, which can be represented by avector, so the velocity of the gas forms avector field. 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 a gas at a constant temperature and pressure, the net flux of gas out of any closed surface is zero. The gas may be moving, but the volume rate of gas flowing into any closed surface must equal the volume rate flowing out, so thenet flux is zero. Thus the gas velocity has zero divergence everywhere. A field which has zero divergence everywhere is calledsolenoidal.
If the gas is heated only at one point or small region, or a small tube is introduced which supplies a source of additional gas at one point, the gas there will expand, pushing fluid particles around it outward in all directions. This will cause an outward velocity field throughout the gas, centered on the heated point. Any closed surface enclosing the heated point will have a flux of gas particles passing out of it, so there is positive divergence at that point. However any closed surfacenot enclosing the point will have a constant density of gas 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.
The divergence at a pointx is the limit of the ratio of the flux through the surfaceSi(red arrows) to the volume for any sequence of closed regionsV1,V2,V3, … enclosingx that approaches zero volume:
The divergence of a vector fieldF(x) at a pointx0 is defined as thelimit of the ratio of thesurface integral ofF out of the closed surface of a volumeV enclosingx0 to the volume ofV, asV shrinks to zero
where|V| is the volume ofV,S(V) is the boundary ofV, and is the outwardunit normal to that surface. It can be shown that the above limit always converges to the same value for any sequence of volumes that containx0 and approach zero volume. The result,divF, is a scalar function ofx.
Since this definition is coordinate-free, it shows that the divergence is the same in anycoordinate system. However the above definition 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 calledsolenoidal – in which case any closed surface has no net flux across it. This is the same as saying that the (flow of the) vector field preserves volume: The volume of any region does not change after it has been transported by the flow for any period of time.
Although expressed in terms of coordinates, the result is invariant underrotations, as the physical interpretation suggests. This is because the trace of theJacobian matrix of anN-dimensional vector fieldF inN-dimensional space is invariant under any invertible linear transformation[clarification needed].
The common notation for the divergence (∇ ·F) is a convenient mnemonic, where the dot denotes an operation reminiscent of thedot product: take the components of the∇ operator (seedel), apply them to the corresponding components ofF, and sum the results. Because applying an operator is different from multiplying the components, this is considered anabuse of notation.
For a vector expressed inlocal unitcylindrical coordinates aswhereea is the unit vector in directiona, the divergence is[1]
The use of local coordinates is vital for the validity of the expression. If we considerx the position vector and the functionsr(x),θ(x), andz(x), which assign the correspondingglobal cylindrical coordinate to a vector, in general,, and. In particular, if we consider the identity functionF(x) =x, we find that:
Inspherical coordinates, withθ the angle with thez axis andφ the rotation around thez axis, andF again written in local unit coordinates, the divergence is[2]
If tensor is symmetricAij =Aji then. Because of this, often in the literature the two definitions (and symbolsdiv and) are used interchangeably (especially in mechanics equations where tensor symmetry is assumed).
UsingEinstein notation we can consider the divergence ingeneral coordinates, which we write asx1, …,xi, …,xn, wheren is the number of dimensions of the domain. Here, the upper index refers to the number of the coordinate or component, sox2 refers to the second component, and not the quantityx squared. The index variablei is used to refer to an arbitrary component, such asxi. TheVoss-Weyl formula,[8] which allows the divergence to be determined using simply partial coordinate derivatives, is as follows:
where is the local coefficient of thevolume element andFi are the components of with respect to the localunnormalizedcovariant basis (sometimes written as). The Einstein notation implies summation overi, 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ρ = 1,ρ =r andρ =r2 sinθ, respectively. The volume can also be expressed as, wheregab is themetric tensor. Thedeterminant appears because it provides the appropriate invariant definition of the volume, given a set of vectors. Since the determinant is a scalar quantity which doesn't depend on the indices, these can be suppressed, writing. The absolute value is taken in order to handle the general case where the determinant might be negative, such as in pseudo-Riemannian spaces. The reason for the square-root is a bit subtle: it effectively avoids double-counting as one goes from curved to Cartesian coordinates, and back. The volume (the determinant) can also be understood as theJacobian of the transformation from Cartesian to curvilinear coordinates, which forn = 3 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 ofF with respect to it, we have thatusing 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:
The following properties can all be derived from the ordinary differentiation rules ofcalculus. Most importantly, the divergence is alinear operator, i.e.,
for all vector fieldsF andG and allreal numbersa andb.
There is aproduct rule of the following type: ifφ is a scalar-valued function andF is a vector field, then
or in more suggestive notation
Another product rule for thecross product of two vector fieldsF andG in three dimensions involves thecurl and reads as follows:
The divergence of thecurl of any vector field (in three dimensions) is equal to zero:
If a vector fieldF with zero divergence is defined on a ball inR3, then there exists some vector fieldG on the ball withF = curlG. For regions inR3 more topologically complicated than this, the latter statement might be false (seePoincaré lemma). The degree offailure of the truth of the statement, measured by thehomology of thechain complex
serves as a nice quantification of the complicatedness of the underlying regionU. These are the beginnings and main motivations ofde Rham cohomology.
It can be shown that any stationary fluxv(r) that is twice continuously differentiable inR3 and vanishes sufficiently fast for|r| → ∞ can be decomposed uniquely into anirrotational partE(r) and asource-free partB(r). Moreover, these parts are explicitly determined by the respectivesource densities (see above) andcirculation densities (see the articleCurl):
For the irrotational part one has
with
The source-free part,B, can be similarly written: one only has to replace thescalar potentialΦ(r) by avector potentialA(r) and the terms−∇Φ by+∇ ×A, and the source densitydivvby the circulation density∇ ×v.
This "decomposition theorem" is a by-product of the stationary case ofelectrodynamics. It is a special case of the more generalHelmholtz decomposition, which works in dimensions greater than three as well.
One can express the divergence as a particular case of theexterior derivative, which takes a2-form to a 3-form inR3. 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ρ = 1dx ∧dy ∧dz moving with local velocityF. Its exterior derivativedj is then given by
Thus, the divergence of the vector fieldF can be expressed as:
Here the superscript♭ is one of the twomusical isomorphisms, and⋆ is theHodge star operator. When the divergence is written in this way, the operator is referred to as thecodifferential. 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.
The appropriate expression is more complicated incurvilinear coordinates. The divergence of a vector field extends naturally to anydifferentiable manifold of dimensionn that has avolume form (ordensity)μ, e.g. aRiemannian orLorentzian manifold. Generalising the construction of atwo-form for a vector field onR3, on such a manifold a vector fieldX defines an(n − 1)-formj =iXμ obtained by contractingX withμ. The divergence is then the function defined by
The divergence can be defined in terms of theLie derivative as
This means that the divergence measures the rate of expansion of a unit of volume (avolume element) as it flows with the vector field.
where the second expression is the contraction of the vector field valued 1-form∇X with itself and the last expression is the traditional coordinate expression fromRicci calculus.
An equivalent expression without using a connection is
whereg is themetric and denotes the partial derivative with respect to coordinatexa. The square-root of the (absolute value of thedeterminant of the) metric appears because the divergence must be written with the correct conception of thevolume. In curvilinear coordinates, the basis vectors are no longer orthonormal; the determinant encodes the correct idea of volume in this case. It appears twice, here, once, so that the can be transformed into "flat space" (where coordinates are actually orthonormal), and once again so that is also transformed into "flat space", so that finally, the "ordinary" divergence can be written with the "ordinary" concept of volume in flat space (i.e. unit volume,i.e. one,i.e. not written down). The square-root appears in the denominator, because the derivative transforms in the opposite way (contravariantly) to the vector (which iscovariant). This idea of getting to a "flat coordinate system" where local computations can be done in a conventional way is called avielbein. A different way to see this is to note that the divergence is thecodifferential in disguise. That is, the divergence corresponds to the expression with thedifferential and theHodge star. The Hodge star, by its construction, causes thevolume form to appear in all of the right places.
where∇μ denotes thecovariant derivative. In this general setting, the correct formulation of the divergence is to recognize that it is acodifferential; the appropriate properties follow from there.
Equivalently, some authors define the divergence of amixed tensor by using themusical isomorphism♯: ifT is a(p,q)-tensor (p for the contravariant vector andq for the covariant one), then we define thedivergence ofT to be the(p,q − 1)-tensor
that is, we take the trace over thefirst two covariant indices of the covariant derivative.[a]The symbol refers to themusical isomorphism.
^ The choice of "first" covariant index of a tensor is intrinsic and depends on the ordering of the terms of the Cartesian product of vector spaces on which the tensor is given as a multilinear mapV × V × ... × V →R. But equally well defined choices for the divergence could be made by using other indices. Consequently, it is more natural to specify the divergence ofT with respect to a specified index. There are however two important special cases where this choice is essentially irrelevant: with a totally symmetric contravariant tensor, when every choice is equivalent, and with a totally antisymmetric contravariant tensor (a.k.a. ak-vector), when the choice affects only the sign.
^Tasos C. Papanastasiou; Georgios C. Georgiou; Andreas N. Alexandrou (2000).Viscous Fluid Flow(PDF). CRC Press. p. 66,68.ISBN0-8493-1606-5.Archived(PDF) from the original on 2020-02-20.
Edwards, C. H. (1994).Advanced Calculus of Several Variables. Mineola, NY: Dover.ISBN0-486-68336-2.
Gurtin, Morton (1981).An Introduction to Continuum Mechanics. Academic Press.ISBN0-12-309750-9.
Korn, Theresa M.; Korn, Granino Arthur (January 2000).Mathematical Handbook for Scientists and Engineers: Definitions, Theorems, and Formulas for Reference and Review. New York: Dover Publications. pp. 157–160.ISBN0-486-41147-8.