Sponsored links: Algebra eBooks
 

Related

How to create Hessian matrix without Hessian function

The Hessian matrix is the square matrix of second-order partial derivatives of a function.

How to construct hessian matrix in maxima?

Given the function:

f(ax2 + bxy)

in maxima:

f(x,y):=(a*x^2 + b*x*y);

In Calculator

if all second partial derivatives of f exist, then the Hessian matrix of f is the matrix:

Hf(x)i,j = δ2f(x)
δxiδxj

H(f) = [ 2   2  ]
 δδxf21δδx1fδx2

H(f) = ⌊   δ2f   -δ2f-  ... --δ2f- ⌋
|   δx221   δx1δ2x2      δx12δxn |
||  δδx2δfx1   δδxf22   ... δxδ2fδxn ||
||    ..      ..    ..     ..  ||
⌈   δ.2f    δ.2f     .   δ2.f  ⌉
   δxnδx1  δxnδx2  ...   δx2n-

Second partial derivatives

xx = δ2f(ax2+2bxy)
    δx

xy = δ2f(ax2+bxy)
    δxy

yx= 2   2
δf(aδxy+xbxy)

yy = δ2f(ax2+bxy)
   δy2

In maxima

xx:diff(diff(f(x,y),x),x);

xy:diff(diff(f(x,y),x),y);

yx:diff(diff(f(x,y),y),x);

yy:diff(diff(f(x,y),y),y);

In Calculator

Hessian matrix of a function f(a*x^2 + b*x*y) is:

[         ]
  xx  xy
  yx   yy

[       ]
  2a  b
   b  0

In Maxima:

hesM:matrix([xx,xy],[yx,yy]);

In Calculator

Verification in maxima:

Maxima function hessian

hessian((a*x^2 + b*x*y),[x,y]);

In Calculator

Diference of maxima function Hessian and our example.

hesM-hessian((a*x^2 + b*x*y),[x,y]);

This Example in Calculator

Articles

How to create Hessian matrix

How to create Nullspace (Kernel) matrix

Related Help

Hessian

Matrix

Diff