hessian



maxima-bounces at math.utexas.edu wrote on 11/21/2006 11:04:51 AM:

> Hello,
> 
> I don't know how to use the "hessian" function (to get the matrix of 
> second partial derivatives of a function). Do I have to load some 
> package ? Does anybody have any example of its use ?


The hessian function is documented, but I don't know where it is. The 
hessian function is listed under the linearalgebra package, but it
seems that there is no hessian function in linearalgebra. Until
that problem is fixed, try:

hessian(f,v) := if listp(v) then funmake('matrix, makelist(diff(makelist(
diff(f,vi),vi,v),vj),vj,v)) else funmake('hessian,[f,v]);


(%i37) hessian(f,v) := if listp(v) then funmake('matrix, 
makelist(diff(makelist(diff(f,vi),vi,v),vj),vj,v))
  else  funmake('hessian,[f,v])$

(%i38) hessian(a*x^2 + b*x*y + c*y^2,[x,y]);
(%o38) matrix([2*a,b],[b,2*c])


Barton