7. Extrema

Partial derivatives of second order

We can also calculate further on, namely calculate second order derivatives. In the case of f(x,y,z)=2xy+z^2-y^2z+x^3, the first order derivatives are: \frac{\partial f}{\partial x}(x,y,z)=2y+3x^2, \frac{\partial f}{\partial y}(x,y,z)=2x-2yz, \frac{\partial f}{\partial z}(x,y,z)=2z-y^2, so the second order derivatives are \frac{\partial^2 f}{\partial x\partial y}(x,y,z)=\frac{\partial \frac{\partial f}{\partial x}}{\partial y}(x,y,z). In our case: \frac{\partial^2 f}{\partial x^2}(x,y,z)=6x, \frac{\partial^2 f}{\partial x\partial y}(x,y,z)=2, \frac{\partial^2 f}{\partial x\partial z}(x,y,z)=0, \frac{\partial^2 f}{\partial y^2}(x,y,z)=-2z, \frac{\partial^2 f}{\partial y\partial z}(x,y,z)=-2y and \frac{\partial^2 f}{\partial z^2}(x,y,z)=2.

Notice that (if a function is fine enough), the order of differentiation is not relevant.


Similarly as in the one-dimensional case we can find local maxima and minima by analysing derivatives. The necessary condition (for fine enough functions) is that the first partial derivatives equal zero. But this condition is not enough and we have to look into the second derivatives also in the point with zero first derivatives.

Second derivatives can be viewed as a so called differential of a function in a given point. A differential of f (assume that it is a function of two variables), is df_{(x,y)}(h_1,h_2)=\frac{\partial^2 f}{\partial x^2} h_1^2+2\frac{\partial^2 f}{\partial x\partial y} h_1 h_2+ \frac{\partial^2 f}{\partial y^2} h_2^2. If this differential gives only positive values for any h_1,h_2 (except when both h_1,h_2 equal zero), there is a local minimum in (x,y). If it gives always negative values, we get a maximum. If it allows negative and positive values depending on h_1,h_2, there is no extreme in this point.

Let us check this using function x^3+x^2+y^2. First derivatives: \partial f/\partial x=3x^2+2x, \partial f/\partial y=2y, are equal zero for y=0 and x=0 or x=-2/3. Let us calculate second derivatives: \partial^2 f/\partial x^2=6x+2, \partial^2 f/\partial x\partial y=0, \partial^2 f/\partial y^2=2, so the differential in (0,0) is: df_{(0,0)}(h_1,h_2)=2h_1^2+2h_2^2+0h_1h_2, and is always positive, so we have a minimum here. For (-2/3,0), we get df_{(-2/3,0)}(h_1,h_2)=-2h_1^2+2h_2^2+0h_1h_2, which gives -2 for h_1=1, h_2=0 and 2 for h_1=0, h_2=1, so it is not an extremum.

Supremum and infimum on a compact set

If a function is continuous and defined on a compact set, it achieves its supremum and infimum. The candidates are: local extrema (we can consider a larger set of all points in which the first order partial derivatives are zero) and the boundary of the set (the values there can be described also by a function, of one variable).

E.g. let f(x,y)=x^2+y^2-x and let us consider set D which is a square with vertices (\pm 1,\pm 1).
The partial derivatives are 2x-1 and 2y, which equal zero for (1/2,0). At this point the value is 1/4-1/2=-1/2. Edges are: x=-1, so f(y)=y^2+2, extremum for y=0 equal to 2, x=1, so f(y)=y^2, extremum for y=0 equal to 0, y=-1, so f(y)=x^2-x+1, extremum for x=1/2 equal to 3/4, x=1, so f(y)=x^2-x+1, extremum for x=1/2 equal to 3/4, and the values at vertices (1,1),(1,-1),(-1,1) and (1,1) are respectively 1, 1, 3, 3. Thus, \sup_{(x,y)\in D} f(x,y)=3 and \inf_{(x,y)\in D} f(x,y)=-1/2.