information:highlighting, structural:scholar_edition
General coordinates

Using Einstein notation we can consider the divergence in general coordinates, which we write as x, …, x, …, x, where n is the number of dimensions of the domain. Here, the upper index refers to the number of the coordinate or component, so x refers to the second component, and not the quantity x squared. The index variable i is used to refer to an arbitrary component, such as x. The divergence can then be written via the Voss - Weyl formula, as:

where ρ {\displaystyle \rho } is the local coefficient of the volume element and F are the components of F = F i e i {\displaystyle \mathbf {F} =F^{i}\mathbf {e} _{i}} with respect to the local unnormalized covariant basis (sometimes written as e i = ∂ x / ∂ x i {\displaystyle \mathbf {e} _{i}=\partial \mathbf {x} /\partial x^{i}}). The Einstein notation implies summation over i, since it appears as both an upper and lower index.

The volume coefficient ρ is a function of position which depends on the coordinate system. In Cartesian, cylindrical and spherical coordinates, using the same conventions as before, we have ρ = 1, ρ = r and ρ = r sin θ, respectively. The volume can also be expressed as ρ = | det g a b | {\textstyle \rho ={\sqrt {\left|\det g_{ab}\right|}}}, where g is the metric tensor. The determinant appears because it provides the appropriate invariant definition of the volume, given a set of vectors. Since the determinant is a scalar quantity which doesn't depend on the indices, these can be suppressed, writing ρ = | det g | {\textstyle \rho ={\sqrt {\left|\det g\right|}}}. The absolute value is taken in order to handle the general case where the determinant might be negative, such as in pseudo-Riemannian spaces. The reason for the square-root is a bit subtle: it effectively avoids double-counting as one goes from curved to Cartesian coordinates, and back. The volume (the determinant) can also be understood as the Jacobian of the transformation from Cartesian to curvilinear coordinates, which for n = 3 gives ρ = | ∂ (x, y, z) ∂ (x 1, x 2, x 3) | {\textstyle \rho =\left|{\frac {\partial (x,y,z)}{\partial (x^{1},x^{2},x^{3})}}\right|}.

Some conventions expect all local basis elements to be normalized to unit length, as was done in the previous sections. If we write e ^ i {\displaystyle {\hat {\mathbf {e} }}_{i}} for the normalized basis, and F ^ i {\displaystyle {\hat {F}}^{i}} for the components of F with respect to it, we have that

using one of the properties of the metric tensor. By dotting both sides of the last equality with the contravariant element e ^ i {\displaystyle {\hat {\mathbf {e} }}^{i}}, we can conclude that F i = F ^ i / g i i {\textstyle F^{i}={\hat {F}}^{i}/{\sqrt {g_{ii}}}}. After substituting, the formula becomes:

See § In curvilinear coordinates for further discussion.