In physical terms, the divergence of a threedimensional vector field is the extent to which the vector field flow behaves like a source at a given point. It is a local measure of its "outgoingness"– the extent to which there is more of some quantity exiting an infinitesimal region of space than entering it. If the divergence is nonzero at some point then there must be a source or sink at that position. (Note that we are imagining the vector field to be like the velocity vector field of a fluid (in motion) when we use the terms flow, source and so on.)
More rigorously, the divergence of a vector field F at a point p can be defined as the limit of the net flow of F across the smooth boundary of a threedimensional region V divided by the volume of V as V shrinks to p. Formally,
div
F
(
p
)
=
lim
V
→
{
p
}
∬
S
(
V
)
F
⋅
n
^

V

d
S
where  V  is the volume of V, S(V) is the boundary of V, and the integral is a surface integral with n̂ being the outward unit normal to that surface. The result, div F, is a function of p. From this definition it also becomes obvious that div F can be seen as the source density of the flux of F.
In light of the physical interpretation, a vector field with zero divergence everywhere is called incompressible or solenoidal – in this case, no net flow can occur across any closed surface.
The intuition that the sum of all sources minus the sum of all sinks should give the net flow outwards of a region is made precise by the divergence theorem.
Let x, y, z be a system of Cartesian coordinates in 3dimensional Euclidean space, and let i, j, k be the corresponding basis of unit vectors. The divergence of a continuously differentiable vector field F = Ui + Vj + Wk is defined as the scalarvalued function:
div
F
=
∇
⋅
F
=
(
∂
∂
x
,
∂
∂
y
,
∂
∂
z
)
⋅
(
U
,
V
,
W
)
=
∂
U
∂
x
+
∂
V
∂
y
+
∂
W
∂
z
.
Although expressed in terms of coordinates, the result is invariant under rotations, as the physical interpretation suggests. More generally, the trace of the Jacobian matrix of an Ndimensional vector field F in Ndimensional space is invariant under any invertible linear transformation.
The common notation for the divergence ∇ · F is a convenient mnemonic, where the dot denotes an operation reminiscent of the dot product: take the components of the ∇ operator (see del), apply them to the components of F, 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 secondorder tensor field ε is a firstorder tensor field:
div
→
(
ε
)
=
[
∂
ε
x
x
∂
x
+
∂
ε
y
x
∂
y
+
∂
ε
z
x
∂
z
∂
ε
x
y
∂
x
+
∂
ε
y
y
∂
y
+
∂
ε
z
y
∂
z
∂
ε
x
z
∂
x
+
∂
ε
y
z
∂
y
+
∂
ε
z
z
∂
z
]
For a vector expressed in cylindrical coordinates as
F
=
e
r
F
r
+
e
θ
F
θ
+
e
z
F
z
,
where e_{a} is the unit vector in direction a, the divergence is
div
F
=
∇
⋅
F
=
1
r
∂
∂
r
(
r
F
r
)
+
1
r
∂
F
θ
∂
θ
+
∂
F
z
∂
z
.
In spherical coordinates, with θ the angle with the z axis and φ the rotation around the z axis, the divergence is
div
F
=
∇
⋅
F
=
1
r
2
∂
∂
r
(
r
2
F
r
)
+
1
r
sin
θ
∂
∂
θ
(
sin
θ
F
θ
)
+
1
r
sin
θ
∂
F
φ
∂
φ
.
It can be shown that any stationary flux v(r) that is at least twice continuously differentiable in ℝ^{3} and vanishes sufficiently fast for  r  → ∞ can be decomposed into an irrotational part E(r) and a sourcefree part B(r). 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
E
=
−
∇
Φ
(
r
)
,
with
Φ
(
r
)
=
∫
R
3
d
3
r
′
div
v
(
r
′
)
4
π

r
−
r
′

.
The sourcefree part, B, can be similarly written: one only has to replace the scalar potential Φ(r) by a vector potential A(r) and the terms −∇Φ by +∇ × A, and the source density div v by the circulation density ∇ × v.
This "decomposition theorem" is a byproduct 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.
The following properties can all be derived from the ordinary differentiation rules of calculus. Most importantly, the divergence is a linear operator, i.e.
div
(
a
F
+
b
G
)
=
a
div
F
+
b
div
G
for all vector fields F and G and all real numbers a and b.
There is a product rule of the following type: if φ is a scalarvalued function and F is a vector field, then
div
(
φ
F
)
=
grad
φ
⋅
F
+
φ
div
F
,
or in more suggestive notation
∇
⋅
(
φ
F
)
=
(
∇
φ
)
⋅
F
+
φ
(
∇
⋅
F
)
.
Another product rule for the cross product of two vector fields F and G in three dimensions involves the curl and reads as follows:
div
(
F
×
G
)
=
curl
F
⋅
G
−
F
⋅
curl
G
,
or
∇
⋅
(
F
×
G
)
=
(
∇
×
F
)
⋅
G
−
F
⋅
(
∇
×
G
)
.
The Laplacian of a scalar field is the divergence of the field's gradient:
div
(
∇
φ
)
=
Δ
φ
.
The divergence of the curl of any vector field (in three dimensions) is equal to zero:
∇
⋅
(
∇
×
F
)
=
0
If a vector field F with zero divergence is defined on a ball in ℝ^{3}, then there exists some vector field G on the ball with F = curl G. For regions in ℝ^{3} 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
{scalar fields on
U } → {vector fields on
U } → {vector fields on
U } → {scalar fields on
U }
(where the first map is the gradient, the second is the curl, the third is the divergence) serves as a nice quantification of the complicatedness of the underlying region U. These are the beginnings and main motivations of de Rham cohomology.
One can express the divergence as a particular case of the exterior derivative, which takes a 2form to a 3form in ℝ^{3}. Define the current twoform as
j
=
F
1
d
y
∧
d
z
+
F
2
d
z
∧
d
x
+
F
3
d
x
∧
d
y
.
It measures the amount of "stuff" flowing through a surface per unit time in a "stuff fluid" of density ρ = 1 dx ∧ dy ∧ dz moving with local velocity F. Its exterior derivative dj is then given by
d
j
=
(
∂
F
1
∂
x
+
∂
F
2
∂
y
+
∂
F
3
∂
z
)
d
x
∧
d
y
∧
d
z
=
(
∇
⋅
F
)
ρ
.
Thus, the divergence of the vector field F can be expressed as:
∇
⋅
F
=
⋆
d
⋆
(
F
♭
)
.
Here the superscript ♭ is one of the two musical isomorphisms, and ★ is the Hodge dual. Working with the current twoform 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 divergence of a vector field can be defined in any number of dimensions. If
F
=
(
F
1
,
F
2
,
…
F
n
)
,
in a Euclidean coordinate system where x = (x_{1}, x_{2},... x_{n}) and dx = (dx_{1}, dx_{2},... dx_{n}), define
div
F
=
∇
⋅
F
=
∂
F
1
∂
x
1
+
∂
F
2
∂
x
2
+
⋯
+
∂
F
n
∂
x
n
.
The appropriate expression is more complicated in curvilinear coordinates.
In the case of one dimension, F reduces to a regular function, and the divergence reduces to the derivative.
For any n, the divergence is a linear operator, and it satisfies the "product rule"
∇
⋅
(
φ
F
)
=
(
∇
φ
)
⋅
F
+
φ
(
∇
⋅
F
)
for any scalarvalued function φ.
The divergence of a vector field extends naturally to any differentiable manifold of dimension n with a volume form (or density) μ, e.g. a Riemannian or Lorentzian manifold. Generalising the construction of a twoform for a vector field on ℝ^{3}, on such a manifold a vector field X defines an (n − 1)form j = i_{X} μ obtained by contracting X with μ. The divergence is then the function defined by
d
j
=
div
(
X
)
μ
.
Standard formulas for the Lie derivative allow us to reformulate this as
L
X
μ
=
div
(
X
)
μ
.
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 pseudoRiemannian manifold, the divergence with respect to the metric volume form can be computed in terms of the LeviCivita connection ∇:
div
X
=
∇
⋅
X
=
X
a
;
a
,
where the second expression is the contraction of the vector field valued 1form ∇X with itself and the last expression is the traditional coordinate expression from Ricci calculus.
An equivalent expression without using connection is
div
(
X
)
=
1
det
g
∂
a
(
det
g
X
a
)
,
where g is the metric and ∂a denotes partial derivative with respect to coordinate x^{a}.
Divergence can also be generalised to tensors. In Einstein notation, the divergence of a contravariant vector F^{μ} is given by
∇
⋅
F
=
∇
μ
F
μ
,
where ∇_{μ} denotes the covariant derivative.
Equivalently, some authors define the divergence of a mixed tensor by using the musical isomorphism ♯: if T is a (p, q)tensor (p for the contravariant vector and q for the covariant one), then we define the divergence of T to be the (p, q − 1)tensor
(
div
T
)
(
Y
1
,
…
Y
q
−
1
)
=
trace
(
X
↦
♯
(
∇
T
)
(
X
,
⋅
,
Y
1
,
…
Y
q
−
1
)
)
that is we trace the covariant derivative on the first two covariant indices.