TITLE: The Test of Second Partials
#
!em do you remember how to check for the presence of a local max or local min at a point where the derivative is zero?
It went like this: if f'(a) = 0 then you need to check the sign of f"(a).
If f"(a) < 0 then it is a local max, if f"(a)>0 it is a local min,
and if f"(a)=0, then there is an inflection point at a.
This was in calc1, in calc3 the situation is similar but unfortunately
more complicated here is the proposition,

!b2 Theorem:
*Let f(x,y) be a function with continuous second order
partial derivatives at the point (a,b). If the gradient at (a,b)
is zero, i.e. both partials w.r.t. x and w.r.t. y are zero at (a,b)
then there could be a local max, a local min, a saddle point or we
can't tell, depending on the sign of the matrix of second partials
of f at (a,b). If the sign is positive there is a local min,
if negative there is a local max and if it is zero there is
a saddle point, otherwise we can't tell.*

In order to understand the statement above we need to define
what we mean by the sign of a matrix. Let's do this
for a 2 by 2 matrix,
> A := matrix(2,2,[fxx,fxy,fyx,fyy]);
[fxx fxy]
A := [ ]
[fyx fyy]
# we say that A is positive (or positive definite) if,
> vector([a,b]) &* evalm(A) &* matrix(2,1,[a,b]) > 0;
[fxx fxy] [a]
0 < [a, b] &* [ ] &* [ ]
[fyx fyy] [b]
# and the inequality is true for all possible values of a and b as long
as they are not both zero. Notice that this simplifies to,
> collect(evalm(vector([a,b]) &* evalm(A) &* matrix(2,1,[a,b]))[1],[a,b]) > 0;
2 2
0 < fxx a + (fyx + fxy) b a + b fyy
# if the matrix A is symmetric (i.e. when fyx = fxy) this simplifies even more
to,
> subs(fyx=fxy,");
2 2
0 < fxx a + 2 fxy b a + b fyy
# Now notice that by factorizing out fxx and completing the square we get
the rigth hand side of the above inequality to be:
> fxx*( (a + (fxy/fxx)*b)^2 - ((fxy/fxx)*b)^2 + (fyy/fxx)*b^2);
/ 2 2 2\
|/ fxy b\2 fxy b fyy b |
fxx ||a + -----| - ------- + ------|
|\ fxx / 2 fxx |
\ fxx /
# and the two last terms can be re-order as,
> R := fxx*( (a + (fxy/fxx)*b)^2 + (1/fxx^2)*(fxx*fyy-fxy^2)*b^2);
/ 2 2\
|/ fxy b\2 (fxx fyy - fxy ) b |
R := fxx ||a + -----| + -------------------|
|\ fxx / 2 |
\ fxx /
# so if we call DET the determinant of the matrix A (see above) when fxy=fyx,
> DET := fxx*fyy - fxy^2;
2
DET := fxx fyy - fxy
# we can now see that the sign of R is controlled by the sign of fxx,
provided that DET > 0. This will be useful later.
>