# Compute the Hessian matrix of a function [duplicate]

To compute the gradient of a function, it can be made with matematica using Grad[f[x,y],{x,y}]

Suprisingly, it's not possible to compute the Hessian matrix (something as HessianMatrix[f[x,y],{x,y}], doesn't exist (I check in Wolfram website here, but nothing relevant). Is it possible that mathematica can't compute the Hessian of a function ? And if no (what I guess), how can I do ?

• Here's a link in here: mathematica.stackexchange.com/questions/123403/… Also, very convenient now to just google anything you want in mathematica to find it usually here. That's what I did, I just googled: "Hessian matrix in mathematica" to get to that link. – Dominic Feb 19 at 13:10
• D[f[x, y], {{x, y}, 2}] – cvgmt Feb 19 at 13:20
• @Dominic: Thanks a lot for your message. Indeed, I found this link, but trying to apply it, didn't work with me... I'll see if I can apply it properly. – tiko Feb 19 at 13:21
• Here's another from Mathworld: HessianH[f_, x_List?VectorQ] := D[f, {x, 2}] – Dominic Feb 19 at 13:23
• Presumably, you entered something wrong when testing solution by @Dominic. With HessianH[f_, x_List?VectorQ] := D[f, {x, 2}] then HessianH[f[x, y], {x, y}] == D[f[x, y], {{x, y}, 2}] evaluates to True – Bob Hanlon Feb 19 at 14:11