Div

Div[{f1,,fn},{x1,,xn}]
gives the divergence .

Div[{f1,,fn},{x1,,xn},chart]
gives the divergence in the coordinates chart.

DetailsDetails

  • Div[f,x] can be input as . The character can be typed as EscdelEsc or \[Del], and the character is an ordinary period. The list of variables is entered as a subscript.
  • An empty template can be entered as Escdel.Esc, and Tab 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 , then x must have length , and the resulting divergence is an array of dimensions .
  • In Div[f,{x1,,xn},chart], if f is an array, then it must have dimensions . 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 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.

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Divergence of a vector field in Cartesian coordinates:

In[1]:=
Click for copyable input
Out[1]=

Divergence of a vector field in cylindrical coordinates:

In[1]:=
Click for copyable input
Out[1]=

Divergence in two-dimensional polar coordinates:

In[1]:=
Click for copyable input
Out[1]=

Use EscdelEsc to enter andCtrl+- to enter the list of subscripted variables:

In[1]:=
Click for copyable input
Out[1]=

Use Escdel.Esc to enter the template , fill in the variables, press Tab, and fill in the function:

In[2]:=
Click for copyable input
Out[2]=
Introduced in 2012
(9.0)
| Updated in 2014
(10.0)