Chapter 17. Critical points
§17.1 [TEXT] Critical points in 18.01
First, a comparison to 18.01. Way back when you had a differentiable single-variable function , and you were trying to minimize it, you used the following terms:
| 18.01 term | Meaning |
|---|---|
| Global minimum | Minimum of the function across the entire region you’re considering |
| Local minimum | A point at which is smaller than any nearby points in a small neighborhood |
| Critical point | A point where |
Each row includes all the ones above it, but not vice-versa. Here’s a picture of an example showing these for a random function . From left to right in Figure 36, there are four critical points:
- A local maximum (that isn’t a global maximum), drawn in blue.
- A local minimum (that isn’t a global minimum), drawn in green.
- A critical inflection point — neither a local minimum nor a local maximum. Drawn in orange.
- A global maximum, drawn in purple.
Note there’s no global minimum at all, since the function goes to in both directions as or .
§17.2 [TEXT] Critical points in 18.02
In 18.02, when we consider the only change we make is:
As soon as I say this I need to carry over the analogous warnings from 18.01:
Keep in mind that each of the implications
is true only one way, not conversely. So a local minimum may not be a global minimum; and a point with gradient zero might not be a minimum, even locally. You should still find all the critical points, just be aware a lot of them may not actually be min’s or max’s.
- There may not be any global minimum or maximum at all, like we just saw.
The best example of a saddle point to keep in your head is the origin for the function
Why is this a saddle point? We have , and the gradient is zero too, since
The problem is that the small changes in and clash in sign. Specifically, if we go a little bit to either the left or right in the -direction, then will increase a little bit, e.g.
But the term does the opposite: if we go a little bit up or down in the -direction, then will decrease a little bit.
So the issue is the clashing signs of small changes in and directions. This causes to neither be a local minimum nor local maximum.
There’s actually nothing special about and in particular; I only used those to make arithmetic easier. You can see Figure 37 for values of at other nearby points.
The name “saddle point” comes from the following picture: if one looks at the surface
then near you have something that looks like a horse saddle. It curves upwards along the -direction, but downwards along the -direction.
We’ll get to the recipe for distinguishing between saddle points and local minimums and maximums in a moment; like in 18.01, there is something called the second derivative test. First, one digression and a few examples of finding critical points.
§17.3 [SIDENOTE] Saddle points are way more common than critical inflection points
At first glance, you might be tempted to think that a saddle point is the 18.02 version of the critical inflection point. However, that analogy is actually not so good for your instincts, and saddle points feel quite different from 18.01 critical inflection points. Let me explain why.
In 18.01, it was possible for a critical point to be neither a local minimum or maximum, and we called these critical inflection points. However, in 18.01 this was actually really rare. To put this in perspective, suppose we considered a random 18.01 function of the form
where each square was a random integer between and inclusive. Of the approximately functions of this shape, you will find that while there are plenty of critical points, the chance of finding a critical inflection point is something like — far worse than the lottery. (Of course, if you know where to look, you can find them: has a critical inflection point at the origin, for example.)
In 18.02 this is no longer true. If we picked a random function of a similar form
where we fill each square with a number from to then you’ll suddenly see saddle points everywhere. For example, when I ran this simulation times, among the critical points that showed up, I ended up with about
- 24.6% local minimums
- 25.3% local maximums
- 50.1% saddle points.
And the true limits (if one replaces with and takes the limit as ) are what you would guess from the above: 25%, 25%, 50%. (If you want to see the code, it’s in the Appendix, Chapter 56.)
Why is the 18.02 situation so different? It comes down to this: in 18.02, you can have two clashing directions. For the two experiments I’ve run here, consider the picture in Figure 38. Here is a critical point, and we consider walking away from it in one of two directions. I’ll draw a blue arrow if increases, and a red arrow if decreases.
In the 18.01 experiment, we saw that two arrows pointing opposite directions almost always have the same color. So in 18.01, when we could only walk in one direction, that meant almost every point was either a local minimum or a local maximum. But the picture for 18.02 is totally different because there’s nothing that forces the north/south pair to have the same sign as the east/west pair. For a “random” function, if you believe the colors are equally likely, then half the time the arrows don’t match colors and you end up with a saddle point.
This whole section was for two-variable functions , so it’s already a simplification. If you ran an analogous three-variable experiment defined similarly for polynomials :
- 12.5% local minimums
- 12.5% local maximums
- 75.0% saddle points.
If we return to the world of any two-variable function, the truth is even more complicated than this. In this sidenote I only talked about functions that looked like where and were polynomials. The and parts of the function were completely unconnected, so we only looked in the four directions north/south/east/west. But most two-variable functions have some more dependence between and , like or or similar. Then you actually need to think about more directions than just north/south/east/west.
For example, Poonen’s lecture notes (see question 9.22) show a weird monkey saddle: the point is a critical point of
where the values of nearby split into six regions, alternating negative and positive, in contrast to Figure 37 where there were only four zones on the circle. (See also Wikipedia for monkey saddle.) Poonen also invites the reader to come up with an octopus saddle (which sounds like it needs sixteen regions, eight down ones for each leg of the octopus).
§17.4 [RECIPE] Finding critical points
For finding critical points, on paper you can just follow the definition:
To find the critical points of
- Compute the gradient .
- Set it equal to the zero vector and solve the resulting system of equations in variables.
The thing that might be tricky is that you have to solve a system of equations. Depending on how difficult your function is to work with, that might require some creativity in order to get the algebra right. We’ll show some examples where the algebra is really simple, and examples where the algebra is much more involved.
Solution. The gradient is
In order for this to equal , we need to solve the three-variable system of equations
which is so easy that it’s almost insulting: . The only critical point is .
Solution. This example is a lot more annoying than the previous one, despite having fewer variables, because casework is forced upon you. You need to solve four systems of linear equations, not just one, as you’ll see.
We expand
So
Hence, the resulting system of equations to solve is
The bad news is that these are quadratic equations. Fortunately, they come in factored form, so we can rewrite them as OR statements:
So actually there are cases to consider, and we have to manually tackle all four. These cases fit into the following table; we solve all four systems of equations.
| Top eqn. gives | Top eqn. gives | |
| Bottom eqn. gives | ||
| Bottom eqn. gives |
So we get there are four critical points, one for each case: , , and .
§17.5 [TEXT] General advice for solving systems of equations
In the last example with , we saw the solving a system of equations is not necessarily an easy task. In general, solving a system of generic equations, even when the number of variables equals the number of unknowns, can be disproportionately difficult in the number of variables.
It’s easy to generate examples of systems that can’t be solved by hand. But it’s also possible to generate examples of systems that look innocent, and can be solved by hand in a nice way, but for which finding that nice way is extremely challenging.
One example of such a system of equations is to solve over the system
There is a way to solve it by hand, but it’s quite hard to come up with, even for the best high school students in the world. (The source of the problem is the USA Team Selection Test 2009.)
This means that you need to put away your chef hat for a moment and put on your problem-solving cap: The good news is that it’s all high-school algebra: no calculus involved, no derivatives, etc. The bad news is that it’s tricky. You really have to think.
When solving a system of equations, treat it like a self-contained algebra puzzle. That means you cannot just blindly follow a recipe, but need to actually think.
Possible strategy in some situations: try to isolate one variable in terms of others. For example, if you see , one strategy is to rewrite it as and then use that substitution to kill all the ’s for your system. This reduces the number of variables by , at the cost of some work.
If there’s symmetry in the system of equations, see if you can exploit it to save work.
Try to factor things when you spot factors. For example, if you see , write it as , then either or .
If you are taking square roots of both sides: that is, if , you conclude , not .
Be careful in making sure you don’t miss cases if you start getting OR statements. In the last example, there were cases. You can easily imagine careless students accidentally forgetting a case.
See if you can “guess” some obvious solutions to start (e.g. all-zero). If so, note them down so you know that they should show up later.
I also need one warning: be really careful about division by zero. For example, in the example from last section, careless students might try to divide by and to get
But this is wrong, because and could be zero too! If you make this mistake you’re only getting to one of the four critical points. This is important enough I’ll box it:
I’m going to give two examples, each with three variables, to show these ideas in the tip I just mentioned. Fair warning: these are deliberately a bit trickier, to give some space to show ideas. Don’t worry if you can’t do these two yourself. The exam ones will probably tone down this algebra step a bit.
Compute all the critical points of the function
Solution. We first compute the gradient:
The critical points occur when , which gives us the system of equations (after dividing by ):
We’d like to divide out by the variables, but this would be division by zero. Indeed, note is a solution!
- If , then it follows from the last equation, then from the second.
- By symmetry, if any of the three variables is zero, then all three are.
Now let’s suppose all the variables are nonzero. Then we can write the first equation safely as and use that to get rid of in the second equation:
Similarly, we get and .
So in fact , because we can safely take cube roots of real numbers. And any triple with works fine.
In conclusion, every point of the form is a critical point — an infinite family of critical points!
Compute all the critical points of the function
Solution. The gradient is given by
That looks scary, but it turns out the first two equations factor. Cleaning things up, we get:
In the first equation, we have cases on and .
First case: If , then both the first and second equation are true and give no further information. So we turn to the last equation, which for says
This is a linear equation in that we can isolate:
Again, before dividing by , we check the cases:
- If , we get an obvious contradiction .
- So we can assume and .
Hence, for any real number , we get a critical point
Now assume . Then we can safely divide by in the first two equations to get
Our strategy now is to write everything in terms of . The first equation tells us , so the second equation says
We have one more equation, so we make the two substitutions everywhere and expand:
Hence, we get one more critical point .
In conclusion, the answer is
§17.6 [RECIPE] The second derivative test for two-variable functions
Earlier we classified critical points by looking at nearby points. Technically speaking, we did not give a precise definition of “nearby”, just using small numbers like or to make a point. So in 18.02, the exam will want a more systematic theorem for classifying critical points as local minimum, local maximum, or saddle point.
I thought for a bit about trying to explain why the second derivative test works, but ultimately I decided to not include it in these notes. Here’s some excuses why:
The issue is that getting the “right” understanding of this would require me to talk about quadratic forms. However, in the prerequisite parts Alfa and Bravo of these notes, we only did linear algebra, and didn’t cover quadratic forms in this context at all. I hesitate to introduce an entire chapter on quadratic forms (which are much less intuitive than linear functions) and then tie that to eigenvalues of a matrix just to justify a single result not reused later. (Poonen has some hints on quadratic forms in section 9 of his notes if you want to look there though.)
The other downside is that even if quadratic forms are done correctly, the second derivative test doesn’t work in all cases anyway, if the changes of the function near the critical point are sub-quadratic (e.g. degree three). And multivariable Taylor series are not on-syllabus for 18.02.
So to get this section over with quickly, I’ll just give the result. I’m sorry this will seem to come out of nowhere.
Suppose has a critical point at . We want to tell whether it’s a local minimum, local maximum, or saddle point. Assume has a continuous second derivative near .
Let , , . These are the partial derivatives of the partial derivatives of (yes, I’m sorry), evaluated at . If you prefer gradients, you could write this instead as
If , output the answer based on the following chart:
- If , output “saddle point”.
- If and , output “local minimum”.
- If and , output “local maximum”.
If , the second derivative test is inconclusive. Any of the above answers are possible, including weird/rare saddle points like the monkey saddle. You have to use a different method instead.
The quantity is sometimes called the Hessian determinant; it’s the determinant of the matrix .
It is indeed a theorem that if is differentiable twice continuously, then . That is, if you take a well-behaved function and differentiate with respect to then differentiate with respect to , you get the same answer as if you differentiate with respect to and respect to . You’ll see this in the literature written sometimes as
Use the second derivative test to classify the critical point of the function
Solution. Start by computing the partial derivatives:
We now do partial differentiation a second time on each of these. Depending on your notation, you can write this as either
or
Again, the repeated is either or ; for well-behaved functions, you always get the same answer for and .
At the origin, we get
Since , we output the answer “saddle point”.
Solution. Start by computing the gradient:
Solve the system of equations and to get just . Hence this is the only critical point.
We now compute the second derivatives:
These are all constant functions in this example; anyway, we have , , , and , so output “saddle point”.