Generalizations
The divergence of a vector field can be defined in any number of dimensions. If
in a Euclidean coordinate system where and, define
The appropriate expression is more complicated in curvilinear coordinates.
For any n, the divergence is a linear operator, and it satisfies the "product rule"
for any scalar-valued function .
The divergence can be defined on any manifold of dimension n with a volume form (or density) e.g. a Riemannian or Lorentzian manifold. Generalising the construction of a two form for a vector field on, on such a manifold a vector field X defines a n−1 form obtained by contracting X with . 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 Riemannian or Lorentzian manifold the divergence with respect to the metric volume form can be computed in terms of the Levi Civita connection
where the second expression is the contraction of the vector field valued 1-form with itself and the last expression is the traditional coordinate expression used by physicists.
Divergence can also be generalised to tensors. In Einstein notation, the divergence of a contravariant vector is given by
where is the covariant derivative. Equivalently, some authors define the divergence of any mixed tensor by using the "musical notation #":
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
that is we trace the covariant derivative on the first two covariant indices.
Read more about this topic: Divergence