## `linalg::hessian` -- Hessian matrix of a scalar function

#### Introduction

`linalg::hessian``(f, x)` computes the Hesse matrix (the Hessian) of the scalar function f(x) in Cartesian coordinates, i.e., the square matrix of second partial derivatives of f(x).

#### Call(s)

`linalg::hessian(f,x)`

#### Parameters

`f` | - | an arithmetical expression (the scalar function)
`x` | - | a list of (indexed) identifiers

#### Returns

a matrix of the domain `Dom::Matrix()`.

#### Related Functions

`diff`, `linalg::grad`, `linalg::jacobian`

#### Example 1

The Hessian of the function f(x,y,z)=x*y + 2*x*z is the following matrix:

    >> delete x, y, z:
       linalg::hessian(x*y + 2*z*x, [x, y, z])

                                   +-         -+
                                   |  0, 1, 2  |
                                   |           |
                                   |  1, 0, 0  |
                                   |           |
                                   |  2, 0, 0  |
                                   +-         -+

#### Background

- For a function f: X -> R, X a subset of R^n the n x n matrix

      Hf(x):=
              +-                                                            -+
              |  diff(f(x),x1,x1)   diff(f(x),x2,x1)  ...  diff(f(x),xp,x1)  |
              |                                                              |
              |  diff(f(x),x1,x2)   diff(f(x),x2,x2)  ...  diff(f(x),xp,x2)  |
      Hf(x):= |                                                              |
              |        :                   :                       :         |
              |                                                              |
              |  diff(f(x),x1,xp)   diff(f(x),x2,xp)  ...  diff(f(x),xp,xp)  |
              +-                                                            -+

  is called the Hesse matrix of f.

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000