Section10.1The Second Derivative Test
This section will develop how to...
We start with a review exercise from first-semester calculus.
Review10.1.1
Let \(f(x) = x^3-3x^2\text{.}\) Find the critical values of \(f\) by solving \(f'(x)=0\text{.}\) Determine if each critical value leads to a local maximum or local minimum by computing the second derivative. State the local maxima/minima of \(f\text{.}\) Sketch the function using the information you discovered.
We now generalize the second derivative test to all dimensions. We've already seen that the second derivative of a function such as \(z=f(x,y)\) is a square matrix. The second derivative test in Calculus I/II relied on understanding if a function was concave up or concave down. We need a way to examine the concavity of \(f\) as we approach a point \((x,y)\) from any of the infinitely many directions. Such a method exists, and leads to an eigenvalue/eigenvector problem. I'm assuming that most of you have never heard the word “eigenvalue.” We could spend an entire semester just studying eigenvectors. We'd need a few weeks to discover what they are from a exercise-based approach. Instead, here is an example of how to find eigenvalues and eigenvectors.
Definition10.1.1
Let \(A\) be a square matrix, so in 2D we have \(A=\begin{pmatrix}a\amp b\\c\amp d
\end{pmatrix}\text{.}\) The identity matrix \(I\) is a square matrix with 1's on the diagonal and zeros everywhere else, so in 2D we have \(I = \begin{pmatrix}1\amp 0\\0\amp 1
\end{pmatrix}\text{.}\) The eigenvalues of \(A\) are the solutions \(\lambda\) to the equation \(|A-\lambda I|=0\text{.}\) Remember that \(|A|\) means, “Compute the determinant of \(A\text{.}\)” So in 2D, we need to find the value \(\lambda\) so that
\begin{align*}
\end{align*}
This definition extends to any square matrix. In 3D, the eigenvalues are the solutions to the equation
\begin{align*}
\end{align*}
An eigenvector of \(A\) corresponding to \(\lambda\) is a nonzero vector \(\vec x\) such that \(A\vec x=\lambda x\text{.}\)
As you continue taking more upper level science courses (in physics, engineering, mathematics, chemistry, and more) you'll soon see that eigenvalues and eigenvectors play a huge role. You'll start to see them in most of your classes. For now, we'll use them without proof to apply the second derivative test. In class, make sure you ask me to show you pictures with each exercise we do, so we can see how eigenvalues and eigenvectors appear in surfaces.
Theorem10.1.2The Second Derivative Test
Let \(f(x,y)\) be a function so that all the second partial derivatives exist and are continuous. The second derivative of \(f\text{,}\) written \(D^2f\) and sometimes called the Hessian of \(f\text{,}\) is a square matrix. Let \(\lambda_1\) be the largest eigenvalue of \(D^2f\text{,}\) and \(\lambda_2\) be the smallest eigenvalue. Then \(\lambda_1\) is the largest possible second derivative obtained in any direction. Similarly, the smallest possible second derivative obtained in any direction is \(\lambda_2\text{.}\) The eigenvectors give the directions in which these extreme second derivatives are obtained. The second derivative test states the following.
\((a,b)\)\(f\text{,}\)\(Df(a,b) = \begin{bmatrix}0\amp 0
\end{bmatrix}\text{.}\)
If all the eigenvalues of \(D^2f(a,b)\) are positive, then in every direction the function is concave upwards at \((a,b)\) which means the function has a local minimum at \((a,b)\text{.}\)
If all the eigenvalues of \(D^2f(a,b)\) are negative, then in every direction the function is concave downwards at \((a,b)\text{.}\) This means the function has a local maximum at \((a,b)\text{.}\)
If the smallest eigenvalue of \(D^2f(a,b)\) is negative, and the largest eigenvalue of \(D^2f(a,b)\) is positive, then in one direction the function is concave upwards, and in another the function is concave downwards. The point \((a,b)\) is called a saddle point.
If the largest or smallest eigenvalue of \(f\) equals 0, then the second derivative tests yields no information.
Consider the function \(f(x,y)=x^2-2x+xy+y^2\text{.}\) The first and second derivatives are
\begin{equation*}
Df(x,y)=\begin{bmatrix}2x-2+y,x+2y
\end{bmatrix}
\text{ and }
D^2f = \begin{bmatrix}2\amp 1 \\1\amp 2
\end{bmatrix} .
\end{equation*}
The first derivative is zero (the zero matrix) when both \(2x-2+y=0\) and \(x+2y=0\text{.}\) We need to solve the system of equations \(2x+y=2\) and \(x+2y=0\text{.}\) Double the second equation, and then subtract it from the first to obtain \(0x-3y=2\text{,}\) or \(y=-2/3\text{.}\) The second equation says that \(x=-2y\text{,}\) or that \(x=4/3\text{.}\) So the only critical point is \((4/3,-2/3)\text{.}\)
We find the eigenvalues of \(D^2 f(4/3,-2/3)\) by solving the equation
\begin{align*}
\end{align*}
In this example, the second derivative is constant, so the point \((4/3,-2/3)\) did not change the matrix. In general, the point will affect your matrix. See Sage to see a graph which shows the eigenvectors in which the largest and smallest second derivatives occur.
Expanding the left hand side gives us {\(4-4\lambda + \lambda^2 -1 = 0\)}. Simplifying and factoring gives us \(\lambda^2-4\lambda +3 = (\lambda-3)(\lambda -1) = 0\text{.}\) This means the eigenvalues are \(\lambda = 1\) and \(\lambda=3\text{.}\) Since both numbers are positive, the function is concave upwards in every direction. The critical point \((4/3,-2/3)\) corresponds to a local minimum of the function. The local minimum is the output \(f(4/3,-2/3) = (4/3)^2-2(4/3)+(4/3)(-2/3)+(-2/3)^2\text{.}\)
A link to the graph of \(f\) is provided on the right. The red vector \((1,1)\) points in the direction in which the second derivative is the largest value 3. The blue vector \((-1,1)\) points in the direction in which the second derivative is the smallest value 1. These vectors are called eigenvectors, and you can learn much more about them, in particular how to find them, in a linear algebra course. For this course, we just need to be able to find eigenvalues.
Exercise10.1.2
Consider the function \(f(x,y)=x^2+4xy+y^2\text{.}\)
See 14.7 for more practice.
(a)
Find the critical points of \(f\) by finding when \(Df(x,y)\) is the zero matrix.
(b)
Find the eigenvalues of \(D^2f\) at any critical points.
(c)
Use the 2nd derivative test to label each critical point as a local maximum, local minimum, or saddle point, and state the value of \(f\) at the critical point.
Exercise10.1.3
Consider the function \(f(x,y)=x^3-3x+y^2-4y\text{.}\)
(a)
Find the critical points of \(f\) by finding when \(Df(x,y)\) is the zero matrix.
(b)
Find the eigenvalues of \(D^2f\) at any critical points.
HintFirst compute \(D^2f\text{.}\) Since there are two critical points, evaluate the second derivative at each point to obtain 2 different matrices. Then find the eigenvalues of each matrix.
(c)
Label each critical point as a local maximum, local minimum, or saddle point, and state the value of \(f\) at the critical point.
Exercise10.1.4
Consider the function \(f(x,y)=x^3 + 3xy +y^3\text{.}\)
(a)
Find the critical points of \(f\) by finding when \(Df(x,y)\) is the zero matrix.
(b)
Find the eigenvalues of \(D^2f\) at any critical points.
(c)
Label each critical point as a local maximum, local minimum, or saddle point, and state the value of \(f\) at the critical point.
You now have the tools needed to find optimal solutions to exercises in any dimension. Here's a silly exercise that demonstrates how we can use this.
Exercise10.1.5
Prof. Woodruff's daughter has asked for a Barbie princess cake. He purchased a metal pan that's roughly in the shape of a paraboloid \(z=f(x,y)=9-x^2-y^2\) for \(z\geq 0\text{.}\) To surprise her, he want to hide a present inside the cake. The present is a bunch of small candy that can pretty much fill a box of any size. He'd like to know how large (biggest volume) of a rectangular box he can fit under the cake, so that when she start cutting the cake, she'll find her surprise present. The box will start at \(z=0\) and the corners of the box (located at \((x,\pm y)\) and \((-x,\pm y)\)) will touch the surface of the cake \(z=9-x^2-y^2\text{.}\)
(a)
What is the function \(V(x,y)\) that we are trying to maximize?
(b)
If you find all the critical points of \(V\text{,}\) you'll discover there are 9. However, only one of these critical points makes sense in the context of this exercise. Find that critical point.
(c)
Use the second derivative test to prove that the critical point yields a maximum volume.
(d)
What are the dimensions of the box? What's the volume of the box?
The only thing left for Prof. Woodruff to now determine how much candy he should buy to fill the box. He'll take care of that.
In this exercise, we'll derive the version of the second derivative test that is found in most multivariate calculus texts. The test given below only works for functions of the form \(f:\mathbb{R}^2\to\mathbb{R}\text{.}\) The eigenvalue test you have been practicing will work with a function of the form \(f:\mathbb{R}^n\to\mathbb{R}\text{,}\) for any natural number \(n\text{.}\)
Exercise10.1.6
Suppose that \(f(x,y)\) has a critical point at \((a,b)\text{.}\)
(a)
Find a general formula for the eigenvalues of \(D^2f(a,b)\text{.}\) Your answer will be in terms of the second partials of \(f\text{.}\)
(b)
Let \(D=f_{xx}f_{yy}-f_{xy}^2\text{.}\)
(c)
The only critical point of \(f(x,y) = x^2+3xy+2y^2\) is at \((0,0)\text{.}\) Does this point correspond to a local maximum, local minimum, or saddle point? Give the eigenvalues (which should come instantly out of part 1). Find \(D\text{,}\) from part 2, to answer the question.