
Software: 
To find the maxima and minima of f(x) we solve f ’(x)=0 We can obviously apply the Newton method, like we did to find roots. By analogy, if a maximum or a minimum is close to x_{0}, then a better approximation is found by:
f ’(x_{0}) The specified interval is explored for changes in the sign of f ’(x) to obtain an initial approximation, and the method is applied to obtain a sequence of approximations: x_{0}, x_{1}, x_{2}, ... , x_{n}. The x_{n }is assumed correct if it differs from the previous value in the sequence by less than the specified error. The way in which the sign of f ’(x) changes indicates whether it is a maximum or a minimum: If f ’(x) goes from  to + then the point is a minimum, and if it goes from + to  it is a maximum. MAXIMA AND MINIMA OF MULTIVARIABLE FUNCTIONS Suppose that, instead of a onevariable function we have a function of several variables and we wish to find its relative extrema. We can do this using a generalization of the Newton method. To illustrate, let's say we want to find the relative maxima and minima of F(x,y,z). A necessary (though not sufficient) condition for point (a,b,c) to be an extremum is that all three equations F_{x} = 0 ; F_{y} = 0 ; F_{z} = 0 (I) be satisfied, where
¶F
¶F
¶F Assume (x_{0 } ,y_{0},z_{0}) is close to an extremum. Now expand all three equations into their Taylor series. Neglecting terms of order higher than the first, we get: F_{xx}*(xx_{0}) + F_{xy}*(yy_{0}) + F_{xz}*(zz_{0}) =  F_{x}(x_{0},y_{0},z_{0}) F_{yx}*(xx_{0}) + F_{yy}*(yy_{0}) + F_{yz}*(zz_{0}) =  F_{y}(x_{0},y_{0},z_{0}) F_{zx}*(xx_{0}) + F_{zy}*(yy_{0}) + F_{zz}*(zz_{0}) =  F_{z}(x_{0},y_{0},z_{0})
where
F_{x},
F_{y}_{ }
and
F_{z} are as defined above, but evaluated at
(x_{0},y_{0},z_{0}), and Similarly for F_{yx}, F_{yy}, F_{yz}, F_{zx}, F_{zy} and F_{zz}. If we solve this last set of linear equations for (xx_{0}), (yy_{0}) and (zz_{0}), we obtain corrections on the initial approximation, that is, if the solutions to the system are D_{x}, D_{y} and D_{z}, where xx_{0}=D_{x}; yy_{0}=D_{y} ; zz_{0}=D_{z} then a closer approximation to the extremum is x_{1}=x_{0}+D_{x }; y_{1}=y_{0}+D_{y} ; z_{1}=z_{0}+D_{z} We now use x_{1}, y_{1 } and z_{1} as initial approximations and again set a system of linear equations then solve it to obtain x_{2}, y_{2}, and z_{2}. This process is continued until all the variables in the current approximation in the sequence differ from the values of the previous approximation by less than the specified error. Points satisfying (I) above are called stationary, critical or singular points. They may be points of local maximum or minimum, or neither (saddle points). To identify a stationary point as a local minimum or a local maximum, we set up the matrix of second partial derivatives and establish whether it is positive or negative definite or neither. This is a generalization of concavity to higher dimensions. If you recall, a onevariable function has a minimum at a certain point if it’s graph at that point is concave upward (positive second derivative), and a maximum if it is concave downward (negative second derivative). Let's
illustrate using a 4variable case. Suppose the function is F(x,y,z,t).
The matrix of second partials we need to consider is the symmetric matrix: which
is called the HESSIAN MATRIX of F, where
¶²F ¶²F
¶²F
¶²F
¶²F
¶²F
¶²F
¶²F
¶²F
¶²F
¶²F
¶²F all evaluated at the stationary point. Since
we’re assuming the function and all of its 1st and 2nd order partial derivatives
are continuous at the point we’re testing, the matrix is obviously symmetric
since
F_{xy }
=
F_{yx},
F_{xz }
=
F_{zx}, etc. [A] is positive or negative definite if the
product is positive or negative, respectively, for all nontrivial [x y z t]. Clearly, we can't test that product for all possible [x y z t], but there are other equivalent tests. One is to check the signs of the eigenvalues: if they are all positive or all negative, the matrix is positive or negative definite, respectively. Another test is to compute the determinants A_{1}, A_{2}, A_{3} and A_{4} of these principal submatrices: A_{1} = det[F_{xx}] A_{2}
= detéF_{xx}
F_{xy}ù A_{4}
= detéF_{xx}
F_{xy} F_{xz}
F_{xt}ù all of which are evaluated at the stationary point. If the point is a minimum then [A] is positive definite: A_{i} > 0 for i = 1, 2, 3, 4 (all i) If the point is a maximum then [A] is negative definite:
A_{i} <
0 for i = 1, 3 (i odd) The
matrix may also be positive or negative semidefinite, or indefinite. 

Copyright © 20012010 Numerical Mathematics. All rights reserved.
