Skip to content
AllCalcHub

Maxima, Minima and Lagrange Multipliers

Find the maxima, minima and saddle points of f(x, y), or the extreme values of a function subject to a constraint by Lagrange multipliers, with every point checked.

About the Maxima, Minima and Lagrange Multipliers

At a maximum or minimum of f(x, y) both partial derivatives are zero. At each such critical point, with r = f_xx, s = f_xy and t = f_yy: if rt − s² > 0 it is a minimum (r > 0) or a maximum (r < 0); if rt − s² < 0 it is a saddle point; if rt − s² = 0 the test can't decide.

To find the extreme values of f subject to a constraint g = c, Lagrange's method solves ∇f = λ∇g together with g = c. The candidates are compared: on a closed, bounded constraint such as a circle or sphere, the largest value is the maximum and the smallest the minimum.

The equations are solved numerically from many starting points inside a box, so a solution outside the box can be missed; widen R if you expect one. Each solution is shown exactly when it is a simple fraction or square root, and substituted back to check it.

The formula

f_x = f_y = 0; rt − s² > 0 ⇒ extremum; ∇f = λ∇g, g = c

r, s, t
f_xx, f_xy, f_yy at the point
λ
the Lagrange multiplier: how fast the optimum changes as c changes

Worked example

f = x³ + y³ − 3xy

  1. f_x = 3x² − 3y = 0, f_y = 3y² − 3x = 0
  2. (0, 0): rt − s² = −9, saddle point
  3. (1, 1): rt − s² = 27 > 0, r = 6 > 0, minimum f = −1

Questions people ask

Why does rt − s² = 0 say 'can't decide'?

The second-derivative test fails there; you need to look at f near the point (for example along lines through it).

Is the largest Lagrange value always the maximum?

On a closed, bounded constraint (a circle, an ellipse, a sphere), yes. On an unbounded one, like a line, the function may have no maximum at all.