Divergence: divergence

### 6.21.4 Divergence: divergence

Recall that the divergence of a vector field F=[F1,…,Fn] with variables [x1,…,xn] is

÷ F = |
∂ F1
x1
| + ⋯ + |
∂ Fn
xn

The divergence command computes the divergence of a vector field.

- divergence takes two arguments:
  - F, a vector field given as a list [F1,…,Fn] of expressions.
  - vars, a list of the variable names.
- divergence(F,vars) returns the divergence of the vector field F.

Example.
Input:

divergence([x*z,-y^2,2*x^y],[x,y,z])

Output:

−2 y+z