# Divergence of a vector field (div)

Divergence of a vector field.

## How to write it

### div(field, variables)

**field**

The components of the field. Takes a list.

**variables**

The variables, in brackets. Takes a list of variables.

## Examples

- $\displaystyle \operatorname{div}(\left[ x, y, z \right], \left[ x, y, z \right]) = 3$

  `div([x, y, z], [x, y, z])`

  In the solver, `div([x, y, z], [x, y, z])` gives `3`.

  [Open in the solver](https://hilberon.com/?q=div%28%5Bx%2C%20y%2C%20z%5D%2C%20%5Bx%2C%20y%2C%20z%5D%29)

## Related functions

- [grad](https://hilberon.com/library/grad)

  Gradient of an expression: the list of its partial derivatives.
- [diff](https://hilberon.com/library/diff)

  Derivative of an expression with respect to one or more variables.
- [hessian](https://hilberon.com/library/hessian)

  Hessian matrix of an expression: its second partial derivatives.
- [derivative](https://hilberon.com/library/derivative)

  The derivative operator: derivative(n) is of order n, derivative(0, 1) is the partial in the second argument.
- [integrate](https://hilberon.com/library/integrate)

  Antiderivative of an expression, or its definite integral over a range.
- [curl](https://hilberon.com/library/curl)

  Curl of a vector field in three variables.

---
Source: https://hilberon.com/library/div
