Courses · Calculus 3 · Unit guide
Calculus 3: Optimization and Lagrange multipliers
Find critical points, classify them with the second derivative test, and handle constraints
This unit covers: Critical points, the second derivative test, constrained extrema with Lagrange multipliers.

Here's a question students get wrong all the time: if both partial derivatives are zero, have you found a maximum? Not necessarily. In this multivariable calculus video, we'll find critical points, classify them, look for absolute extrema, and solve constrained problems with Lagrange multipliers.
What a Critical Point Is
Let's start with the definition. A critical point of a function of two variables is a point where both partial derivatives equal zero, or where one of them doesn't exist. Saying both partials are zero is the same as saying the gradient is the zero vector, so the tangent plane is flat there. Every local max or min of a smooth function happens at a critical point, but the reverse isn't true.
A critical point of f is a point where fx = 0 and fy = 0, or where a partial derivative does not exist. Definition of a critical point
Key points.
- Critical point: both partials zero, or one doesn't exist
- Same as the gradient being the zero vector
- Local extrema can only happen at critical points
- Not every critical point is an extremum
Finding Critical Points
Here's how you find them in practice. Take f of x and y equals x cubed minus three x plus y squared. The partial with respect to x is three x squared minus three, and setting that to zero gives x equals plus or minus one. The partial with respect to y is two y, which is zero only when y is zero. So our critical points are one comma zero and negative one comma zero.
f(x,y) = x³ − 3x + y² fx = 3x² − 3 = 0 x = ±1 fy = 2y = 0 → y = 0 points: (1,0), (−1,0)
Key points.
- Set each partial derivative equal to zero
- Solve the equations together
- Example gives the points (1, 0) and (−1, 0)
The Discriminant D
To tell what kind of point you've found, you use the second derivative test, which is built on a number called the discriminant. You write D equals f x x times f y y, minus f x y squared. That's exactly the determinant of the two by two Hessian matrix of second partials. The key habit is to evaluate D at each critical point separately, because its sign can change from point to point.
D = fxx·fyy − (fxy)² D = det [fxx fxy; fxy fyy] evaluate at each (a,b)
Key points.
- D uses all three second partial derivatives
- D is the determinant of the Hessian matrix
- Evaluate D at each critical point separately
Reading the Second Derivative Test
Now read the sign of D. If D is positive and f x x is positive, the surface curves up in every direction, so you have a local minimum. If D is positive and f x x is negative, it's a local maximum. If D is negative, the surface curves up one way and down another, which is a saddle point. And if D is zero, the test tells you nothing, so you'll need another method.
Key points.
- D > 0 and fxx > 0: local minimum
- D > 0 and fxx < 0: local maximum
- D < 0: saddle point
- D = 0: the test is inconclusive
Classifying Our Example
Let's finish our example. The second partials are f x x equals six x, f y y equals two, and f x y equals zero, so D equals twelve x. At one comma zero, D is twelve, which is positive, and f x x is six, also positive, so it's a local minimum. The function value there is negative two. At negative one comma zero, D is negative twelve, so that's a saddle point.
fxx = 6x, fyy = 2, fxy = 0 D = 12x (1,0): D = 12 > 0, fxx = 6 > 0 → local min, f(1,0) = −2 (−1,0): D = −12 < 0 → saddle
Key points.
- fxx = 6x, fyy = 2, fxy = 0, so D = 12x
- At (1, 0): local minimum with value −2
- At (−1, 0): D is negative, so a saddle point
Absolute Extrema on a Closed Region
Sometimes you want the absolute max and min, not just local ones. The extreme value theorem says a continuous function on a closed and bounded region always attains both. To find them, you first locate critical points inside the region and evaluate f there. Then you check the boundary, often by turning each edge into a one variable problem. Finally, you compare every value, and the largest and smallest are your answers.
- Confirm f is continuous on a closed, bounded region
- Find critical points inside and evaluate f
- Find extreme values of f on each boundary piece
- Compare all values: largest is max, smallest is min
The Idea Behind Lagrange Multipliers
Now suppose you must stay on a curve, a constraint written as g of x and y equals k. Picture the level curves of f crossing that constraint. As you move along the constraint, f keeps changing until a level curve just touches it without crossing. At that touching point the curves are tangent, so their gradients are parallel. That gives the Lagrange condition: the gradient of f equals lambda times the gradient of g.
Key points.
- Maximize or minimize f subject to g(x, y) = k
- At the extremum, a level curve of f touches the constraint
- Tangency means ∇f = λ∇g, gradients are parallel
Worked Example with Lagrange Multipliers
Let's work one. We want the extremes of f equals x y on the circle x squared plus y squared equals eight. The gradient condition gives y equals two lambda x and x equals two lambda y. Multiply the first by y and the second by x, and both equal two lambda x y, so x squared equals y squared. Then two x squared equals eight, so x is plus or minus two. Checking the four points, the maximum is four and the minimum is negative four.
f = xy, g: x² + y² = 8 y = 2λx, x = 2λy ⇒ x² = y² ⇒ y = ±x 2x² = 8 ⇒ x = ±2 f(2,2) = f(−2,−2) = 4 max f(2,−2) = f(−2,2) = −4 min
Key points.
- Extremize f = xy on the circle x² + y² = 8
- Gradient equations give x² = y², so y = ±x
- Maximum 4 at (2, 2); minimum −4 at (2, −2)
Unconstrained vs Constrained Problems
Here's where students mix things up. For an unconstrained problem, you set the gradient to zero and classify with the discriminant. For a constrained problem, you solve the gradient of f equals lambda times the gradient of g, together with the constraint itself, and you don't use D at all. Instead, you plug every solution into f and compare, just like we did with four and negative four.
Unconstrained
- Solve fx = 0 and fy = 0
- Classify with D = fxx·fyy − (fxy)²
- Gives local max, min or saddle
Constrained (Lagrange)
- Solve ∇f = λ∇g and g = k
- Don't forget the constraint equation
- Compare f at every solution found
Remember this
If you remember one thing, make it this: zero gradient means critical, not extreme, so always classify, and with constraints, compare values. Now quiz yourself on finding and classifying a few critical points.
Practice this unit
- Calculus 3: Optimization and Lagrange Multipliers quiz15 multiple-choice questions with explanations · no account needed
- Calculus 3: Vectors and the Geometry of Space quiz15 multiple-choice questions with explanations · no account needed
- Calculus 3: Vector Functions and Motion in Space quiz15 multiple-choice questions with explanations · no account needed
- Calculus 3: Optimization and Lagrange Multipliers31 flashcards · study free
- Calculus 3: Vectors and the Geometry of Space36 flashcards · study free
- Calculus 3: Vector Functions and Motion in Space32 flashcards · study free
- Calculus 3: Partial Derivatives30 flashcards · study free
Every Calculus 3 deck and quiz: the Calculus 3 page.
Other Calculus 3 unit guides
- Vectors and the geometry of spaceStudy guide
- Vector functions and motion in spaceStudy guide
- Partial derivativesStudy guide
- Gradient and directional derivativesStudy guide
- Double integralsStudy guide
- Triple integrals and coordinate changesStudy guide
- Vector fields and line integralsStudy guide
- Green’s theoremStudy guide
- Surface integrals, Stokes’ theorem and the Divergence TheoremStudy guide
Try it with your own material
Upload a PDF, slides or notes and study the deck in minutes. Making your own cards is free with no limits.