Divergence

### 12.7.4 Divergence

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

divF= |
∂ 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

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

−2 y+z |  |  |  |  |  |  |  |  |  |