# Div

Div[{f1,,fn},{x1,,xn}]

gives the divergence .

Div[{f1,,fn},{x1,,xn},chart]

gives the divergence in the coordinates chart.

# Details

• Div[f,x] can be input as x.f. The character can be typed as del or \[Del], and the character . is an ordinary period. The list of variables x is entered as a subscript.
• An empty template . can be entered as del., and moves the cursor from the subscript to the main body.
• All quantities that do not explicitly depend on the variables given are taken to have zero partial derivative.
• In Div[f,x], if f is an array of dimensions {n1,,nk-1,nk}, then x must have length nk, and the resulting divergence is an array of dimensions {n1,,nk-1}.
• In Div[f,{x1,,xn},chart], if f is an array, then it must have dimensions {n,,n}. The components of f are interpreted as being in the orthonormal basis associated with chart.
• Coordinate charts in the third argument of Div can be specified as triples {coordsys,metric,dim} in the same way as in the first argument of CoordinateChartData. The short form in which dim is omitted may be used.
• Div works with SparseArray and StructuredArray objects.

# Examples

open allclose all

## Basic Examples(4)

Divergence of a vector field in Cartesian coordinates:

 In[1]:=
 Out[1]=

Divergence of a vector field in cylindrical coordinates:

 In[1]:=
 Out[1]=

Divergence in two-dimensional polar coordinates:

 In[1]:=
 Out[1]=

Use del to enter and to enter the list of subscripted variables:

 In[1]:=
 Out[1]=

Use del. to enter the template ., fill in the variables, press , and fill in the function:

 In[2]:=
 Out[2]=