This is my answer to a question that was asked on math.SE, by someone who needed clarification on the limit-integral definition of the divergence operator. There is a lot to talk about, so I thought I would post a complete version of it here.
Let's put it this way. Suppose you have defined the divergence as a differential operator: that is, for a general function \mathbf f : A \to \mathbb R^n, where A is a subset of \mathbb R^n, and for \mathbf x_0 \in A \setminus \partial A at which \mathbf f is differentiable, let the divergence of \mathbf f at \mathbf x_0 be defined as the real number \operatorname{div} \mathbf f (\mathbf x_0) := \operatorname{tr} \mathsf D^1\mathbf f(\mathbf x_0) = \sum_{i=1}^n \frac{\partial f_i}{\partial x_i}(\mathbf x_0), \tag1 where \mathsf D^1\mathbf f(\mathbf x_0) is the Jacobian matrix of \mathbf f at \mathbf x_0 and \operatorname{tr} indicates the trace operator.
Then the following theorem holds: