Given the following functions,
$f(x, y, z) = −x^3 + 3xz + 2y − y^2 − 3z^2$
$f(x, y) = 3x^4 + 3x^2y − y^3$
I've been told that you can form the following respective Hessian matrices, such that you can evaluate the LPM's / PM's to classify the stationary points of both functions:
\begin{pmatrix} -6x & 0 & 3\\ 0 & -2 & 0\\ 3 & 0 & -6 \end{pmatrix}
\begin{pmatrix} 36x^2 +6y& 6x \\ 6x & -6y \\ \end{pmatrix}
Could someone explain how these matrices were worked out? I only know how to form a Hessian from the Quadratic form: $ax^2 + by^2 + cz^2 + 2fxy + 2gxz + 2hyz$, and I can't seem to figure out how to do so otherwise. Help is much appreciated.
For the first one: first work out the Jacobian matrix - the matrix of partial derivatives. For each entry, differentiate $f$ with respect to each variable, treating the other two variables as constants. $$Jf(x,y,z)=\begin{pmatrix}f_x & f_y & f_z\end{pmatrix}=\begin{pmatrix}-3x^2+3z&2-2y&3x-6z\end{pmatrix}$$ Then work out the Hessian matrix - the matrix of second partial derivatives. For example, $$f_{xx}=\frac{\partial}{\partial x}(-3x^2+3z)=-6x$$ and $$f_{xy}=\frac{\partial}{\partial y}(-3x^2+3z)=0.$$ Doing this for all entries produces the Hessian matrix $$Hf(x,y,z)=\begin{pmatrix}f_{xx}&f_{xy}&f_{xz}\\f_{yx}&f_{yy}&f_{yz}\\f_{zx}&f_{zy}&f_{zz}\end{pmatrix}=\begin{pmatrix}-6x&0&3\\0&-2&0\\3&0&-6\end{pmatrix}$$