If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Saddle points

Just because the tangent plane to a multivariable function is flat, it doesn't mean that point is a local minimum or a local maximum. There is a third possibility, new to multivariable calculus, called a "saddle point". Created by Grant Sanderson.

Want to join the conversation?

  • piceratops tree style avatar for user Petra Ahnell
    You said this is new for multivariable calculus - but isn't there something called inflection point in one dimension that is the equivalent of a saddle point? The tangent is flat but it's neither a maxima nor a minima.
    (37 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user Alexander Wu
      That is a very insightful observation. However, you need some clarifications.

      First, not all inflection points are "saddle points." Only inflection points that are flat, where the slope is zero, can be confused with relative extrema. That's why you also have to check whether the slope's sign changes or the function's concavity when deciding if you have an extremum.

      Second, you can have "flat inflection points" in multivariable calculus too. For example, f(x,y) = x^3 + y^2 at (0,0). They are not saddle points, because the problem is not a disagreement between the inputs, but just a problem with one of the inputs (in this case, x). (Though of course there may be problems with each of the inputs, as in f(x,y) = x^3 + y^3.)

      You can't really have saddle points in one dimension (of input). "Flat inflection points" are called something else and for good reason (though I don't know what they're usually called other than "flat inflection points" and the super annoying thing in calculus I have to check every time and I hate so much). However, they both show how cautious you need to be when finding extrema of functions (which is why I hate them so much).

      UPDATE:
      Okay, I looked on Wikipedia and apparently "flat inflection points" are saddle points too (even in single var!). It's just their definition: they call any point where the gradient is zero but is not a local extremum a saddle point, even if they do not resemble saddles. https://en.wikipedia.org/wiki/Saddle_point
      (23 votes)
  • duskpin sapling style avatar for user darres he
    I wish they had named it the pringle chip instead of saddle point
    ; p
    (38 votes)
    Default Khan Academy avatar avatar for user
  • leaf yellow style avatar for user QUack Man Taydo
    at you said local minima - think you meant local maxima. Not a big deal, just in case anyone gets confused.
    (7 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user George Iskander
    For single variable, there is a saddle point as well.
    Consider F(x) = x^3
    df/dx = 3x^2 equating by zero then we have an extremum point at x=0
    getting the second derivative at this point we found it equal to zero, which is neither max nor min point also from the graph it is clear that this point is a saddle point.
    (7 votes)
    Default Khan Academy avatar avatar for user
  • leafers sapling style avatar for user Mohammed Ghaïth
    Why do I keep thinking of Inflection Point...
    (3 votes)
    Default Khan Academy avatar avatar for user
  • piceratops tree style avatar for user hyunkyung
    If the partial derivatives are all zeros, is the gradient of this function pointing nowhere?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • piceratops ultimate style avatar for user Evan Indge
    In single-variable calculus world, would a function that has a derivative evaluated at a point equal to 0 but a second derivative evaluated at a point equal to 0 and either increasing or decreasing (like x^3 evaluated at 0) be considered a saddle point? It is also neither a local minimum or maximum, so what would we consider it as? Thanks!
    (1 vote)
    Default Khan Academy avatar avatar for user
    • leaf grey style avatar for user Alex
      In single-variable calculus, if f(x) has f'(c) = 0 and f''(c) = 0, it is simply indeterminate; one would have to find the f' values around x = c to determine if f(c) was simply just a critical point, a relative extremum, or an inflection point.
      (2 votes)
  • purple pi purple style avatar for user alphabetagamma
    It's interesting to consider second directional derivatives at saddle-points -- there are interesting conditions for what direction causes the point be be a minima and what direction causes it to be a maxima.
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user gyurkamm
    An idea: in case of the one variable functions, it could also be an option for the tangent to be horizontal if the function changes its band. Like the x^3. In x=0 point its derivate is actually zero without being a local maximum or minimum. (time )

    So a saddle point is named after its shape, but if we take the x^3 and y^3 az the surface of the function (I don't know what the expression could be f(x;y) = ?) then taking the formal definition, their derivates f'_x and f'_y would be zero at the point (0;0), it would not be a local max or min, and it wouldn't have the shape of a saddle... What's then? Does it have a special name? :-D
    (1 vote)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user Scott Yang
    your average pringles chip...
    (0 votes)
    Default Khan Academy avatar avatar for user

Video transcript

- [Voiceover] In the last video, I talked about how if you're trying to maximize or minimize a multi-variable function, you can imagine it's graph. In this case, this is just a two-variable function and we're looking at it's graph. And you want to find the spots where the tangent plane is completely flat. So one way to visualize this is to imagine a flat plane that just represents a constant Z value, so a constant output value for the function. And if you kind of move it up and down, you're looking for the spot where it only barely intersects with the graph at the top before it's not intersecting with it anymore, meaning that there's no values of the function that get above that point. So you're looking just for where it's tangent, where you can find a tangent plane that's flat. But this will give you some other points, like the little local minima here, the bumps where the value of the function at that point is higher than all of the neighbor points. You know, if you walk in any direction, you're going downhill, so that's another thing you're gonna incidentally pick up by looking for places where this tangent plane is flat, but there's also a really interesting new possibility that comes up in the context of multi-variable functions. And this is the idea of a saddle point. So let me pull up another graph here, this guy. And the function that you're looking at, here, I'll write it down, the function that you're looking at is f(x,y)=x2-y2. So now let's think about what the tangent plane at the origin of this entire graph would be. Now the tangent plane to this graph at the origin is actually flat. Here's what it looks like. And to convince yourself of this, let's go ahead and actually compute the partial derivatives of this function and evaluate each one at the origin. So the partial derivative, with respect to X, we look here and X-squared is the only spot where an X shows up, so it's 2X and the other partial derivative. The partial with respect to Y, we take the derivative of this negative Y-squared and we ignore the X because it looks like a constant as far as Y is concerned. And we get negative 2Y. Now, if we plug in the point, the origin, in to any one of these, you know, we plug in the point (X,Y)=(0,0), then what do each of these go to? Well the top one, X equals zero, so this guy goes to zero and similarly over here, Y is zero, so this goes to zero. So both partial derivatives are zero and what that means is if you are standing at the origin and you move in any direction, there's no slope to your movement. And one way of seeing this is to chop the graph. So if we imagine chopping it with a plane that represents a constant X-value and we kind of chop off the graph there, what you'll see, here, I'll get rid of the tangent plane. What you'll see is that the curve where this intersects the graphs, let me trace that out, the curve where it intersects the graph basically has a local maximum at that origin point. The tangent line of the curve at that point in the Y direction is flat and it's because it looks like a local maximum from that perspective. But now let's imagine chopping it in a different direction. So if instead, we have the full graph and instead of chopping it with a constant X value, we chop it with a constant Y value, then in that case, we look at the curve and if we trace out the curve where this constant Y value intersects the graph. Let's see what it would look like. It's also kind of this parabolic shape. Again, the tangent line is flat because it looks like a local minimum of that curve. So because it's flat in one direction and it's flat in the other direction, the tangent plane of the graph as a whole is indeed gonna be flat. But notice this is neither a local maximum nor a local minimum because from one direction, from one direction, it looked like it was a local maximum. Here, I'll get rid of that guy. It looks like it's a local maximum when you look on the curve there, but from another direction, if you chop it another way, it looks like a local minimum. And if we look at the equations, this kind of makes sense because if you're just thinking about movements in the X direction, the entire function looks like X- squared plus some kind of constant. So the graph of that would look like an X-squared parabola shape that has a local minimum, but if you're thinking of pure movements in the Y direction and you're just focused on that Y-squared component, the graph that you get for negative Y-squared is gonna look like an upside down parabola. Here, I'll draw that again. It's gonna look like an upside down parabola and that's got a local maximum. So it's kind of like the X and Y directions disagree over whether this point, whether this point where you have a flat tangent plane should be a local maximum or a local minimum. And this is new to multi-variable calculus, this is something that doesn't come up in single-variable calculus because when you're looking at the graph of a function, you know, you're looking at some kind of graph. If the tangent line is zero, you know, if the tangent line is completely flat at some point, either it's a local maximum or it's local minimum. It can't disagree because there's only one input variable. There's only one X as the input variable for your graph. But once we have two, it's possible that they disagree. And this kind of point has a special name and the name is kind of after this graph that you're looking at, it's called a saddle point. Saddle point. And this is one of those rare times where I actually kind of like the terminology that mathematicians have given something. Because this looks like a saddle, the sort of thing that you would put on a horse's back before riding it. So one thing that this means for us as we're gonna try to figure out ways to find the absolute maximum or minimum of a function, as we're trying to optimize a function that might represent like profits of your company or a cost function in a machine learning setting or something like that, is we're gonna have to be able to recognize if a point is a saddle point. And if you're just looking at the graph, that's fine. You can recognize it visually, but oftentimes if you're just given the formula of a function and it's some long thing. Without looking at the graph, how would you be able to tell, just by doing certain computations to the formula, whether or not it's a saddle point? And that comes down to something called the second partial derivative test, which I will talk about in the next few videos. See you then!