User:Mark.j.cal/sandbox

Derivation of the test
We shall simultaneously consider the two variable and multivariable cases. Let $f(x)$ be a function of $n$ variables, with continuous second order partial derivatives, $x_{0}$ a critical point of  $f$, and  $H$ the Hessian matrix of  $f$ evaluated at $x_{0}$.

Let $$q_H(\mathbf x)$$ be the quadratic form \mathbf x ^T H \mathbf x. In the two variable case this is given by q(x,y) = ax^2+2bxy+cy^2. Then by Taylor's theorem,

$$f(\mathbf x)\approx f(\mathbf x_0)+ \nabla f(\mathbf x_0)(\mathbf{x-x_0})+\frac{1}{2}f_H(\mathbf{x-x_0})$$.

Since $$\mathbf x_0$$ is a critical point, $$\nabla f(\mathbf x_0)$$ is zero, and we have

$$f(\mathbf x)- f(\mathbf x_0) \approx \frac{1}{2}f_H(\mathbf{x-x_0})$$.

This is positive for all x near x_0 if $$q_H(\mathbf{x-x_0})$$ is positive, indicating that all points near x_0 are and x_0 is a minimum. q_H is positive for all x\neq0 iff H is a positive definite matrix, that is, all of its eigenvalues are strictly positive.

In the two variable case, completing the square on q_H we can obtain

q_H(x,y)=a(x+\frac{b}{a}y)^2+(c-\frac{b^2}{a})y^2

Which is positive when a>0 and c-\frac{b^2}{a}>0. This is case (1) above. Since the determinant of a matrix is the product of the eigenvalues, we must have ac-b^2>0. This criterion is also met by both eigenvalues being negative, and so is not sufficient to determine that H is positive definite, so we must also check the trace Tr(H)=a+c>0, which is the sum of the eigenvalues.

Conversely, x_0 is a maximum if q_H is negative for all x, which occurs when H is negative definite This corresponds to a<0, c-b^2/a<0 (or ac-b^2>0, since a is negative). In this case H must be negative definite, implying that det(H)=ac-b^2>0 and a+c<0

In the case that the critical point is a saddle point, q_H takes on both positive and negative values, and corresponds to H being an indefinite matrix, having both strictly positive and strictly negative eigenvalues. In the two variable case we will have one positive and one negative eigenvalue. This implies that det(H)=ac-b^2<0.

Finally, in the case that H is positive or negative semi-definite, i.e. it has at least one zero eigenvalue, the test is inconclusive. In the two variable case this corresponds to one or both of the eigenvalues being zero, and the matrix H being singular.