16. Max-Min Problems
a. Local Minima, Local Maxima and Saddle Points
2. Functions of \(2\) Variables
We now review the definitions of a local minimum and a local maximum for functions of \(2\) variables.
For a function of \(2\) variables, \(f(x,y)\), a local or relative maximum (resp. local or relative minimum) occurs at a point, \((x,y)=(a,b)\), where the function value is relatively larger (resp. smaller) than those at all . Together, local minima and maxima are called local or relative extrema.
When we say nearby, we actually mean that there is some circle around \((a,b)\) within which \(f(a,b)\) is the largest (resp. smallest) value. We don't care what happens far away from \((a,b)\).
For a function, \(f(x,y)\), of \(2\) variables, extrema occur when the tangent plane is horizontal or the derivatives do not exist. Throughout, we will assume all derivatives exist. So extrema occur when the tangent plane is horizontal, i.e. when both partial derivatives are \(0\), or equivalently, the gradient is \(\vec0\). So we search for extrema by identifying critical points, i.e. points, \((a,b)\), at which the partial derivatives are \(0\): \[ f_x(a,b)=0 \qquad \text{and} \qquad f_y(a,b)=0 \] or equivalently, the gradient is \(\vec0\): \[ \vec\nabla f(a,b)=\vec0 \] We then classify each critical point as a local minimum (at which nearby values are larger), a local maximum (at which nearby values are smaller) or a saddle point (at which some nearby values are larger and some are smaller).
![EgMM2VarLocMinGr](graphics/EgMM2VarLocMinGr.jpg)
![EgMM2VarLocMaxGr](graphics/EgMM2VarLocMaxGr.jpg)
![EgMM2VarSadGr](graphics/EgMM2VarSadGr.jpg)
We distinguish between these three possibilities by looking at the second derivatives:
``Define the discriminant to be: \[ D=f_{xx}f_{yy}-f_{xy}^{\;2} \]
- If \(D(a,b) > 0\) and \(f_{xx}(a,b) > 0\), then the critical point \((a,b)\) is a local minimum.
- If \(D(a,b) > 0\) and \(f_{xx}(a,b) \lt 0\), then the critical point \((a,b)\) is a local maximum.
- If \(D(a,b) \lt 0\) then the critical point \((a,b)\) is a saddle point.
- Otherwise, the TEST FAILS.
Read the examples below and then read this
.
Cases when the test fails
The test fails when \(D(a,b)=0\) or \(D(a,b) > 0\) and \(f_{xx}(a,b)=0\).
However, if \(f_{xx}(a,b)=0\), then \(D=-f_{xy}^{\;2} < 0\). So the case \(D(a,b) > 0\) and \(f_{xx}(a,b)=0\) never occurs.
So the only case where the test fails is when \(D(a,b)=0\).
To justify the second derivative test, we will only look at the case where \(f_{xy}=0\) which is the case in the three examples below. In this case, \(D=f_{xx}f_{yy}\).
If \(D(a,b) > 0\) and \(f_{xx}(a,b) > 0\), then \(f_{yy}(a,b) > 0\) also. So the function is concave up in both the \(x\) and \(y\) directions and we expect that \((a,b)\) is a local minimum.
If \(D(a,b) \gt 0\) and \(f_{xx}(a,b) \lt 0\), then \(f_{yy}(a,b) \lt 0\) also. So the function is concave down in both the \(x\) and \(y\) directions and we expect that \((a,b)\) is a local maximum.
If \(D(a,b) \lt 0\), then \(f_{xx}(a,b)\) and \(f_{yy}(a,b)\) must have opposite signs. So the function is concave up in one direction and concave down in the other direction and so \((a,b)\) is a saddle point.
What is not covered in this justification is what happens in directions other than the \(x\) and \(y\) directions. For example, a function could be concave up along both the \(x\) and \(y\) directions but concave down along the \(45^\circ\) directions as in the figure. If we include the \(-f_{xy}^{\;2}\) term in the definition of \(D\) and \(D > 0\), then this cannot happen. The details are given in the proof.
![saddle4_anim](graphics/saddle4_anim.gif)
Assume the critical point is \((a,b)\) and assume all derivatives are evaluated at \((a,b)\).
Case 1: \(D > 0\) and \(f_{xx} > 0\)
The justification showed that if \(f_{xy}=0\), then the function is
concave up in the \(x\) and \(y\) directions. We now show it is concave
up in
Pick a (unit vector) direction, \(\hat u=\langle p,q\rangle\). To show \(f\) is concave up in the \(\hat u\) direction, we will show the second directional derivative of \(f\) along \(\hat u\) is positive. The first directional derivative is \[ \nabla_{\hat u}f=\hat u\cdot\vec\nabla f=p f_x+q f_y \] and the second directional derivative is: \[\begin{aligned} \nabla_{\hat u}^{\;2} f &=\hat u\cdot\vec\nabla (p f_x+q f_y) \\ &=p (p f_x+q f_y)_x+q (p f_x+q f_y)_y \\ &=p^2 f_{xx}+2pq f_{xy}+q^2 f_{yy} \end{aligned}\] To show this is positive, we first factor out the \(f_{xx}\) (which we already know is positive) and then complete the square on \(p\): \[\begin{aligned} \nabla_{\hat u}^{\;2} f &=f_{xx} \left[p^2+2pq \dfrac{f_{xy}}{f_{xx}} +q^2\dfrac{f_{yy}}{f_{xx}}\right] \\ &=f_{xx} \left[\left(p+q \dfrac{f_{xy}}{f_{xx}}\right)^2 +q^2\left(\dfrac{f_{yy}}{f_{xx}} -\,\dfrac{f_{xy}^{\;2}}{f_{xx}^{\;2}}\right)\right] \\ &=f_{xx} \left[\left(p+q \dfrac{f_{xy}}{f_{xx}}\right)^2 +q^2\dfrac{f_{xx}f_{yy}-f_{xy}^{\;2}}{f_{xx}^{\;2}}\right] \\ &=f_{xx} \left[\left(p+q \dfrac{f_{xy}}{f_{xx}}\right)^2 +q^2\dfrac{D}{f_{xx}^{\;2}}\right] \end{aligned}\] Since \(D > 0\), the quantity in square brackets is positive. Since \(f_{xx} > 0\), we have \(\nabla_{\hat u}^{\;2} f > 0\) and \(f\) is concave up in an arbitrary direction \(\hat u\).
Case 2: \(D > 0\) and \(f_{xx} < 0\)
The above computation still says \[ \nabla_{\hat u}^{\;2} f =f_{xx} \left[\left(p+q \dfrac{f_{xy}}{f_{xx}}\right)^2 +q^2\dfrac{D}{f_{xx}^{\;2}}\right] \] and the quantity in square brackets is still positive, but now \(f_{xx} \lt 0\). Consequently, \(\nabla_{\hat u}^{\;2} f \lt 0\) and \(f\) is concave down in an arbitrary direction \(\hat u\).
Case 3: \(D < 0\)
The above computation still says \[ \nabla_{\hat u}^{\;2} f =f_{xx} \left[\left(p+q \dfrac{f_{xy}}{f_{xx}}\right)^2 +q^2\dfrac{D}{f_{xx}^{\;2}}\right] \] However, the quantity in square brackets may not be posiitve.
To show this is a saddle point, we will show there are two directions \(\hat u_1\) and \(\hat u_2\) in which \(f\) has opposite concavity, i.e. \(\nabla_{\hat u_1}^{\;2} f\) and \(\nabla_{\hat u_1}^{\;2} f\) have opposite signs.
First take \(\hat u_1=\langle p,q\rangle=\langle 1,0\rangle\). Then the above formula says \(\nabla_{\hat u_1}^{\;2} f=f_{xx}\), which should be obvious since \(\hat u_1\) is the \(x\) direction.
Second take \(\hat u_2=\langle p,q\rangle =\left\langle -q\dfrac{f_{xy}}{f_{xx}},q \right\rangle\), i.e. \(p=-q\dfrac{f_{xy}}{f_{xx}}\). (Note: \(q\) can be chosen so \(\hat u\) is still a unit vector.) Then the above formula says \[ \nabla_{\hat u_2}^{\;2} f =f_{xx} \left[(0)^2+q^2\dfrac{D}{f_{xx}^{\;2}}\right] =q^2\dfrac{D}{f_{xx}} =q^2\dfrac{D}{\nabla_{\hat u_1}^{\;2} f} \] Hence: \[ \nabla_{\hat u_1}^{\;2} f\,\nabla_{\hat u_2}^{\;2} f =q^2D \]
Since \(D \lt 0\), we conclude \(\nabla_{\hat u_1}^{\;2} f\) and \(\nabla_{\hat u_2}^{\;2} f\) have opposite signs and \(f\) must have a saddle point.
For better or worse, for functions of two (or more) variables, there is no good generalization of the First Derivative Test. When the Second Derivative Test fails, we just have to say it failed and admit we are unable to easily classify the critical point.
Consider the elliptic paraboloid \[ z=f(x,y)=(x-2)^2+(y-3)^2 \] which opens upward and has an obvious minimum at \((x,y)=(2,3)\). Its partial derivatives are: \[ f_x=2(x-2) \qquad f_y=2(y-3) \] which are \(0\) at the critical point \((x,y)=(2,3)\). The second derivatives are: \[ f_{xx}=2 \qquad f_{yy}=2 \qquad f_{xy}=0 \] So the discriminant is \(D=(2)(2)-(0)^2=4\). Normally, we would need to evaluate \(f_{xx}\) and \(D\) at the critical point but that is unnecessary since they are constants. Since \(D > 0\) and \(f_{xx} > 0\), the Second Derivative Test says this is a local minimum, as expected.
![min](graphics/min.jpg)
Consider the elliptic paraboloid \[ z=f(x,y)=-(x-2)^2-(y-3)^2 \] which opens downward and has an obvious maximum at \((x,y)=(2,3)\). This is the negative of the function in the previous example. So everything changes by a minus sign except \(D\): \[ f_x=-2(x-2) \qquad f_y=-2(y-3) \] which are \(0\) at the critical point \((x,y)=(2,3)\). \[ f_{xx}=-2 \qquad f_{yy}=-2 \qquad f_{xy}=0 \] So \(D=(-2)(-2)-(0)^2=4\). Since \(D \gt 0\) and \(f_{xx} \lt 0\), the Second Derivative Test says this is a local maximum, as expected.
![max](graphics/max.jpg)
Consider the hyperbolic paraboloid \[ z=f(x,y)=(x-2)^2-(y-3)^2 \] which opens upward in the \(x\) direction and downward in the \(y\) direction and has an obvious saddle point at \((x,y)=(2,3)\). Its partial derivatives are: \[ f_x=2(x-2) \qquad f_y=-2(y-3) \] which are \(0\) at the critical point \((x,y)=(2,3)\). The second derivatives are: \[ f_{xx}=2 \qquad f_{yy}=-2 \qquad f_{xy}=0 \] So the discriminant is \(D=(2)(-2)-(0)^2=-4\). Since \(D \lt 0\), the Second Derivative Test says this is a saddle point, as expected.
![saddle](graphics/saddle.jpg)
Now read the above for the Second Derivative Test.
On the next page we look at more realistic applications of the Second Derivative Test.
Heading
Placeholder text: Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum