Skip to main content

Section 10.1 The Method of Lagrange Multipliers

Subsection 10.1.1 Why the Gradients Must Be Collinear

The set of points satisfying the constraint \(g(x,y) = 0\) is a curve \(C\) in the plane: it is precisely the level curve of \(g\) of value \(0\text{.}\) We showed in Theoremย 7.10 that the gradient of a function is perpendicular to its level curves, so at every point of \(C\) where \(\nabla g \neq \mathbf 0\text{,}\)
\begin{equation} \nabla g \cdot \mathbf T = 0,\tag{10.2} \end{equation}
where \(\mathbf T\) is a vector tangent to \(C\) at that point. To stay on the curve, any small motion away from the point must be along the tangent direction \(\mathbf T\text{.}\)
How does \(f\) change as we move along \(C\text{?}\) By (7.5), the rate of change of \(f\) in the direction of the unit tangent vector \(\mathbf T\) is the directional derivative
\begin{equation} D_{\mathbf T} f = \nabla f \cdot \mathbf T.\tag{10.3} \end{equation}
If \(\nabla f \cdot \mathbf T \neq 0\) at a point of \(C\text{,}\) as in Figureย 10.1, then the motion along the curve has a component along \(\nabla f\text{:}\) the value of \(f\) increases as we move along \(C\) in the direction of \(\mathbf T\) and decreases as we move in the direction of \(-\mathbf T\text{.}\) Such a point cannot be a constrained maximum or minimum.
Diagram Exploration Keyboard Controls
Key Action
Enter, A Activate keyboard driven exploration
B Activate menu driven exploration
Escape Leave exploration mode
Cursor down Explore next lower level
Cursor up Explore next upper level
Cursor right Explore next element on level
Cursor left Explore previous element on level
X Toggle expert mode
W Extra details if available
Space Repeat speech
M Activate step magnification
Comma Activate direct magnification
N Deactivate magnification
Z Toggle subtitles
C Cycle contrast settings
T Monochrome colours
L Toggle language (if available)
K Kill current sound
Y Stop sound output
O Start and stop sonification
P Repeat sonification output
Figure 10.1. A point of the constraint curve \(g(x,y)=0\) that is not a constrained extremum. The gradient \(\nabla g\) is perpendicular to the curve by Theoremย 7.10, but \(\nabla f\) is not: it has a nonzero component (dashed) along the tangent direction \(\mathbf T\text{,}\) so \(f\) is still changing as we move along the curve.
At a constrained local maximum or minimum, then, a small motion along the curve must not produce any change in \(f\text{:}\) the rate of change (10.3) must vanish, so
\begin{equation} \nabla f \cdot \mathbf T = 0.\tag{10.4} \end{equation}
Now compare (10.2) and (10.4): at a constrained extremum, the tangent vector \(\mathbf T\) is perpendicular to both gradients \(\nabla f\) and \(\nabla g\text{.}\) In the plane, all vectors perpendicular to the nonzero vector \(\mathbf T\) lie on a single line, so \(\nabla f\) and \(\nabla g\) must be collinear (parallel). Phrased differently, there exists some number \(\lambda \in \R\) such that
\begin{equation} \nabla f = \lambda\, \nabla g.\tag{10.5} \end{equation}
Figureย 10.2 explains the condition (10.5) by superposing the constraint curve \(g(x,y) = 0\) onto the family of level curves of \(f(x,y)\text{,}\) that is, the collection of curves \(f(x,y) = c\text{,}\) where \(c\) is a real number in the range of \(f\text{.}\) In the figure, \(c_1 \lt c^* \lt c_3 \lt c_4 \lt c_5\text{.}\) Imagine a point moving along the constraint curve from \((x_1,y_1)\) to \((x_2,y_2)\text{.}\) Initially, the motion has a component along the negative gradient direction \(-\nabla f\text{,}\) so the value of \(f\) decreases. This component becomes smaller and smaller. When the moving point reaches \((x^*,y^*)\text{,}\) the motion is perpendicular to \(\nabla f\text{.}\) From that point on, the motion has a component along the gradient direction \(\nabla f\text{,}\) so the value of \(f\) increases. Thus at \((x^*,y^*)\) the function \(f\) achieves a local minimum on the constraint curve, namely the value \(c^*\text{.}\) The motion is in the tangential direction of the constraint curve, which is perpendicular to \(\nabla g\text{;}\) therefore at \((x^*,y^*)\) the two gradients \(\nabla f\) and \(\nabla g\) are collinear, which is what (10.5) says. Since both curves are perpendicular to the same line at \((x^*,y^*)\text{,}\) the level curve \(f(x,y) = c^*\) and the constraint curve \(g(x,y) = 0\) are tangent at \((x^*,y^*)\text{.}\)
Diagram Exploration Keyboard Controls
Key Action
Enter, A Activate keyboard driven exploration
B Activate menu driven exploration
Escape Leave exploration mode
Cursor down Explore next lower level
Cursor up Explore next upper level
Cursor right Explore next element on level
Cursor left Explore previous element on level
X Toggle expert mode
W Extra details if available
Space Repeat speech
M Activate step magnification
Comma Activate direct magnification
N Deactivate magnification
Z Toggle subtitles
C Cycle contrast settings
T Monochrome colours
L Toggle language (if available)
K Kill current sound
Y Stop sound output
O Start and stop sonification
P Repeat sonification output
Figure 10.2. The constraint curve \(g(x,y)=0\) superposed on the family of level curves of \(f\text{,}\) with \(c_1 \lt c^* \lt c_3 \lt c_4 \lt c_5\text{.}\) At the constrained minimum \((x^*,y^*)\text{,}\) the level curve \(f = c^*\) is tangent to the constraint curve and the two gradients are collinear: \(\nabla f = \lambda\,\nabla g\text{.}\) Here they point in opposite directions, so \(\lambda \lt 0\text{;}\) it is only the collinearity that matters.
Suppose we find the set \(S\) of points \((x,y)\) satisfying the two equations
\begin{align*} g(x,y) \amp= 0,\\ \nabla f \amp= \lambda\, \nabla g \quad \text{for some } \lambda. \end{align*}
Then \(S\) contains the local extrema of \(f\) subject to the constraint \(g(x,y) = 0\text{.}\) The same reasoning applies to functions of three variables: there the constraint \(g(x,y,z) = 0\) defines a level surface of \(g\text{,}\) the gradient \(\nabla g\) is perpendicular to that surface, and at a constrained extremum \(\nabla f\) can have no component tangent to the surface, so once again \(\nabla f\) and \(\nabla g\) must be collinear.

Subsection 10.1.2 Stating the Method

The number \(\lambda\) is called a Lagrange multiplier. The equation \(\nabla f = \lambda\,\nabla g\) is a vector equation, so it holds component by component; together with the constraint it gives four equations in the four unknowns \(x\text{,}\) \(y\text{,}\) \(z\text{,}\) \(\lambda\) (three equations in \(x\text{,}\) \(y\text{,}\) \(\lambda\) for functions of two variables). Notice that we are usually not interested in the value of \(\lambda\) itself: it is an auxiliary unknown that we eliminate along the way while solving for the coordinates of the candidate points.
You have attempted of activities on this page.