# Hessian matrix (hessian)

Hessian matrix of an expression: its second partial derivatives.

## How to write it

### hessian(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 H_{x, y} (x^{2}+y^{2}) = \begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix}$

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

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

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

## Related functions

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

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

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

  Jacobian matrix of a list of expressions: their partial derivatives.
- [div](https://hilberon.com/library/div)

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

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

  Derivative of an expression with respect to one or more variables.

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