# Gradient (grad)

Gradient of an expression: the list of its partial derivatives.

## How to write it

### grad(f, variables)

**f**

The expression or function to work on. Takes an expression.

**variables**

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

## Examples

- $\displaystyle \nabla_{x, y} (x^{2}+y^{2}) = \left[ 2 x, 2 y \right]$

  `grad(x^2 + y^2, [x, y])`

  In the solver, `grad(x^2 + y^2, [x, y])` gives `[2x, 2y]`.

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

## Related functions

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

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

  Divergence of a vector field.
- [integrate](https://hilberon.com/library/integrate)

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

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

  Jacobian matrix of a list of expressions: their 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.

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