Use Hessian matrix to establish convexity

59 Views Asked by At

I have the function $$f(x_1,x_2) = 2x_1 + x_1x_2 - 4x_2 - 4x_1^2 - x_2^2$$

with the corresponding Hessian matrix

$$\begin{pmatrix} -8 & 1 \\ 1 & -1 \end{pmatrix}$$

When I plot the function it looks concave, however, I get that $$P(\lambda)=\lambda^2 + 8\lambda - 1 \Rightarrow \lambda = -4 \pm \sqrt{17},$$ which means the Hessian matrix is not negative definite.

Is this correct or am I doing something wrong? I think it's counterintuitive since the function looks concave when I plot it.