Lagrange Multipliers (Two Variables)
(see below for directions - read them while the applet loads!)
Wait for the applet to load and for the contour plot to appear
in the gray area above.
(If there is no gray area, check your browser settings to make sure that
Java is enabled, or try with another browser)
Setup. Enter the function to minimize / maximize, f(x,y), into
the box in the upper-left corner. Enter the constraint, g(x,y), into
the box immediately below. Click on the "Plot curves" button in the
lower-left corner to update the display. Then, use the yellow slider
control to set the value of b in the constraint equation
The applet shows a contour plot of f (in blue), together with the level
curve g(x,y)=b corresponding to the constraint equation (in yellow).
You can use the blue slider control to move a highlighted level curve of
f. The minima and maxima of f subject to
the constraint correspond to the points where this level curve becomes
tangent to the yellow curve g(x,y)=b.
Click in the contour plot to move the pink dot and display the gradient
vectors of f and g at the given point. The components of
grad(f) and grad(g) are
displayed in the lower-right corner. As expected, the two
gradient vectors are proportional to each other at a constrained
The red "Show solutions" button displays a red curve consisting of all
points where grad(f) and grad(g) are proportional to each
other. The Lagrange multiplier method tells us that constrained
minima/maxima occur when this proportionality condition and the constraint
equation are both satisfied: this corresponds to the points where the red
and yellow curves intersect.