Divergence is a differential operator. The divergence of a vector field f in Rn is denoted by div f or ∇.f, and it is a scalar field defined by
∇.f = ∂fi/∂xi
Summation convention is used, so the repeated index i implies summation over i = 1, 2, ..., n. If we consider ∇ to be the vector with components ∂/∂xi then the definition is the scalar product of ∇ with f, which explains the notation ∇.f.
If we consider a small cube (in three dimensions, for simplicity) with opposite vertices (0, 0, 0), (dx, dy, dz) the surface integral of f over the surface of the cube (with outward normal) is to linear order
fx(dx, 0, 0)dydz + fy(0, dy, 0)dzdx + fz(0, 0, dz)dxdy - fx(0, 0, 0)dydz - fy(0, 0, 0)dzdx - fz(0, 0, 0)dxdy = (∂fx/∂x + ∂fy/∂y + ∂fz/∂z)dxdydz = (∇.f)dxdydz
So for a small cube the flux of f across its surface equals its volume times the divergence of f. The divergence theorem is the formalisation of this statement.
We can give this a physical interpretation by considering the consider the velocity field of a fluid flow. If the fluid is incompressible there can be no net flux across any surface, so the velocity field is divergence free.
Another example is the relationship between charge density q and current density j in electromagnetism. By conservation of charge the change in charge density at a point must correspond to the net flux of current through a small surface containing it, which we can express mathematically as ∂q/∂t + ∇.j = 0.
A field f with ∇.f ≡ 0 is called solenoidal.
The following identities hold for scalar fields k, vector fields f, g:
∇.(kf) = (∇k).f + k(∇.f)
∇.(∇ x f) = 0
∇.(∇k) = ∇2k
∇.(f x g) = (∇ x f).g + f.(∇ x g)
The definition given only works in cartesian coordinate frames, and the expression for the divergence does not take the same simple form in curvilinear coordinate systems. In cylindrical coordinates (r, θ, z) and spherical coordinates (r, θ, φ) the respective expressions are
∇.f = r -1∂(r fr)/∂r + r -1∂fθ/∂θ + ∂fz/∂z
∇.f = r -2∂(r2fr)/∂r + (r sinθ)-1∂(sinθ fθ)/∂θ + (r sinθ)-1∂fφ/∂φ
It is possible to generalise divergence to a differential operator acting on tensor fields rather than vector fields. The divergence of a rank r tensor is a tensor of rank r-1.
The divergence cartesian tensor Tij...k with respect to the index i is the contraction of its gradient with that index, i.e.
divi Tij...k = ∂Tij...k/∂xi
written in summation convention.
In the more general context of a tensor field Ti...jm...n in an affinely connected space the divergence with respect to a contravariant index i is the contraction of its covariant derivative with i, written
divi Ti...km...n = Ti...km...n ; i