Student/VectorCalculus/Hessian - Maple Help

Home : Support : Online Help : Student/VectorCalculus/Hessian

Student[VectorCalculus]

 Hessian
 compute the Hessian Matrix of a function from R^n to R

 Calling Sequence Hessian(f, v, det, opts) Hessian(f, v=p, det, opts)

Parameters

 f - algebraic expression v - list(name); specify the variables of differentiation p - (optional) list(algebraic); point at which the Hessian is evaluated det - (optional) equation of the form determinant=b, where b is either true or false; specify whether to return both the computed Hessian Matrix and its determinant

Description

 • The Hessian(f, v) command computes the Hessian Matrix of the function f with respect to the variables in v. This is the Matrix with an (i,j)th entry of $\frac{{\partial }^{2}}{\partial {v}_{i}\partial {v}_{j}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}f$.
 • If the point p is supplied, the computed Hessian will be evaluated at that point. The dimension of the point must equal the number of variables in v.
 • If the right side of det is true, an expression sequence containing the Hessian Matrix and its determinant, in that order, is returned. If the right side of det is false, the Hessian Matrix is returned. If this parameter is the word determinant, it is interpreted as determinant=true. If the det parameter is not specified, it defaults to determinant=false.
 • If any options are given in opts, they will be passed on to the construction of the returned Matrix. For details on available options, see Matrix.

Examples

 > $\mathrm{with}\left(\mathrm{Student}\left[\mathrm{VectorCalculus}\right]\right):$
 > $\mathrm{Hessian}\left(\mathrm{cos}\left(xy\right),\left[x,y\right]\right)$
 $\left[\begin{array}{cc}{-}{{y}}^{{2}}{}{\mathrm{cos}}{}\left({x}{}{y}\right)& {-}{\mathrm{sin}}{}\left({x}{}{y}\right){-}{y}{}{x}{}{\mathrm{cos}}{}\left({x}{}{y}\right)\\ {-}{\mathrm{sin}}{}\left({x}{}{y}\right){-}{y}{}{x}{}{\mathrm{cos}}{}\left({x}{}{y}\right)& {-}{{x}}^{{2}}{}{\mathrm{cos}}{}\left({x}{}{y}\right)\end{array}\right]$ (1)
 > $H≔\mathrm{Hessian}\left(\frac{1}{{x}^{2}+{y}^{2}+{z}^{2}},\left[x,y,z\right]\right)$
 ${H}{≔}\left[\begin{array}{ccc}\frac{{8}{}{{x}}^{{2}}}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}\right)}^{{3}}}{-}\frac{{2}}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}\right)}^{{2}}}& \frac{{8}{}{x}{}{y}}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}\right)}^{{3}}}& \frac{{8}{}{x}{}{z}}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}\right)}^{{3}}}\\ \frac{{8}{}{x}{}{y}}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}\right)}^{{3}}}& \frac{{8}{}{{y}}^{{2}}}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}\right)}^{{3}}}{-}\frac{{2}}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}\right)}^{{2}}}& \frac{{8}{}{y}{}{z}}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}\right)}^{{3}}}\\ \frac{{8}{}{x}{}{z}}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}\right)}^{{3}}}& \frac{{8}{}{y}{}{z}}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}\right)}^{{3}}}& \frac{{8}{}{{z}}^{{2}}}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}\right)}^{{3}}}{-}\frac{{2}}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}\right)}^{{2}}}\end{array}\right]$ (2)
 > $\mathrm{eval}\left(H,\left[x=0.3,y=0.7,z=0.1\right]\right)$
 $\left[\begin{array}{ccc}{-2.239761612}& {8.179998928}& {1.168571275}\\ {8.179998928}& {13.34118873}& {2.726666310}\\ {1.168571275}& {2.726666310}& {-5.355951680}\end{array}\right]$ (3)
 > $\mathrm{Hessian}\left({x}^{2}+{y}^{2},\left[x,y\right],\mathrm{shape}=\mathrm{symmetric}\right)$
 $\left[\begin{array}{cc}{2}& {0}\\ {0}& {2}\end{array}\right]$ (4)
 > $H,d≔\mathrm{Hessian}\left({x}^{2}+y\mathrm{exp}\left(x\right),\left[x,y\right]=\left[1,-1\right],\mathrm{determinant}\right)$
 ${H}{,}{d}{≔}\left[\begin{array}{cc}{2}{-}{ⅇ}& {ⅇ}\\ {ⅇ}& {0}\end{array}\right]{,}{-}{\left({ⅇ}\right)}^{{2}}$ (5)

Compatibility

 • The p parameter was introduced in Maple 16.
 • The determinant option was introduced in Maple 16.
 • For more information on Maple 16 changes, see Updates in Maple 16.