# Need help with second derivative test

In an optimization problem with restrictions, when I have already found the critical points of a function and I have to classify those points (they can either be maxima or minima or saddle points), do I have to analyze the hessian matrix of the objective function or the hessian matrix of the lagrangian function?

• You have to analyze the Hessian of the Lagrangian evaluated at pairs $(x,\lambda)$, $x$ critical point, $\lambda$ Lagrange multiplier. – daw Jul 7 '14 at 16:31
• The critical points that I deal with are conformed by two variables; according to what you say the hessian that I have to construct is a 3x3 matrix with the third element of each row being a second degree derivative with respect to λ, did I get it right? – Werther Jul 7 '14 at 17:03
• It is the matrix in the answer below. – daw Jul 7 '14 at 18:41

In the case of two variables it is simple. Let your Lagrangian be $$\mathcal{L}=f(x,y) + \lambda(g(x,y)-c)$$ You construct the following matrix (the bordered Hessian) for the critical Lagrange point: $$H=\left[\begin{array}{ccc} 0 & g_x & g_y \\ g_x & f_{xx}+\lambda g_{xx} & f_{xy}+\lambda g_{xy} \\ g_y & f_{yx}+\lambda g_{yx} & f_{yy}+\lambda g_{yy} \end{array}\right]$$ If $\det H>0$ then it is a maximum, if $\det H<0$ then it is a minimum.