**Definition:**
Divergence is a differential operator. The divergence of a vector field **f** in **R**^{n} is denoted by div **f** or **∇**.**f**, and it is a scalar field defined by

**∇**.**f** = ∂f_{i}/∂x_{i}

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 ∂/∂x_{i} then the definition is the scalar product of **∇** with **f**, which explains the notation **∇**.**f**.

**Interpretation:**

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

f_{x}(dx, 0, 0)dydz + f_{y}(0, dy, 0)dzdx + f_{z}(0, 0, dz)dxdy - f_{x}(0, 0, 0)dydz - f_{y}(0, 0, 0)dzdx - f_{z}(0, 0, 0)dxdy = (∂f_{x}/∂x + ∂f_{y}/∂y + ∂f_{z}/∂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.

**Equations:**

The following identities hold for scalar fields k, vector fields **f**, **g**:

**∇**.(k**f**) = (**∇**k).**f** + k(**∇**.**f**)

**∇**.(**∇** x **f**) = 0

**∇**.(**∇**k) = ∇^{2}k

**∇**.(**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 f_{r})/∂r + r ^{-1}∂f_{θ}/∂θ + ∂f_{z}/∂z

**∇**.**f** = r ^{-2}∂(r^{2}f_{r})/∂r + (r sinθ)^{-1}∂(sinθ f_{θ})/∂θ + (r sinθ)^{-1}∂f_{φ}/∂φ

**Generalisations:**

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 T_{ij...k} with respect to the index i is the contraction of its gradient with that index, i.e.

div_{i} T_{ij...k} = ∂T_{ij...k}/∂x_{i}

written in summation convention.

In the more general context of a tensor field T^{i...j}_{m...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

div_{i} T^{i...k}_{m...n} = T^{i...k}_{m...n ; i}