Given a function \(f: \real^d \to \real\), its Hessian matrix, or Hessian, is the square matrix of second-order partial derivatives

\[\H(\x) = \nabla^2 f(\x)\]

with elements given by

\[H_{ij}(\x) = \frac{\partial^2 f(\x)}{\partial x_i \partial x_j}.\]

In virtually all situations, it is only meaningful to construct Hessian matrices in cases where \(f\) is continuously differentiable to second order, in which case the Hessian is a symmetric matrix by the symmetry of second derivatives.