The following code calculate the Hessian --- with simplification --- for a transcendental function.
fu[x_, y_, z_] := x^α y^β z^γ
hes = D[#1[#2, #3, #4], {{#2, #3, #4}}, {{#2, #3, #4}}] &
hescd = hes[fu, x, y,
z] /. {x_^(α_ - 2) y_^β_ z_^γ_ -> U/x^2,
x_^(α_ - 1) y_^(β_ - 1) z_^γ_ -> U/(x y)};
hescd // MatrixForm
I would like
1) to generalize it for a vector of arbitrary dimension
2) It obviously works for any algebraic function but not for all the transcendental functions for which there is a simplification. How to rewrite it to include directly in hes the simplification?


U? – Chris K Jan 16 '17 at 02:58Uwas supposed to be a stand-in for the entire function. – J. M.'s missing motivation Jan 16 '17 at 17:05