Objectives
In this section you will learn how to...
Use Lagrange multipliers to find solutions to constrained optimization problems
In this section you will learn how to...
Use Lagrange multipliers to find solutions to constrained optimization problems
The cake exercise was an example of an optimization problem where we wish to optimize a function (the volume of a box) subject to a constraint (the box has to fit inside a cake). If you are an economics student, this section may be the key reason why you were asked to take multivariate calculus. In the business world, we often want to optimize something (profit, revenue, cost, utility, etc.) subject to some constraint (a limited budget, a demand curve, warehouse space, employee hours, etc.). An aerospace engineer will build the best wing that can withstand given forces. Everywhere in the engineering world, we often seek to create the “best” thing possible, subject to some outside constraints. Lagrange discovered an extremely useful method for answering this question, and today we call it “Lagrange Multipliers.”
See Wikipedia's entry on Lagrange Multipliers for more background on them.
Rather than introduce Cobb-Douglass production functions (from economics) or sheer-stress calculations (from engineering), we'll work with simple examples that illustrate the key points. Sometimes silly examples carry the message across just as well.
Suppose an ant walks around the circle \(g(x,y)=x^2+y^2=1\text{.}\) As the ant walks around the circle, the temperature is \(f(x,y) = x^2+y+4\text{.}\) Our goal is to find the maximum and minimum temperatures reached by the ant as it walks around the circle. We want to optimize \(f(x,y)\) subject to the constraint \(g(x,y)=1\text{.}\)
Draw the circle \(g(x,y)=1\text{.}\) Then, on the same set of axes, draw several level curves of \(f\text{.}\) The level curves \(f=3, 4, 5, 6\) are a good start. Then add more (maybe at each 1/4th). If you make a careful, accurate graph, it will help a lot below.
Based solely on your graph, where does the minimum temperature occur? What is the minimum temperature?
If the ant is at the point \((0,1)\text{,}\) and it moves left, will the temperature rise or fall? What if the ant moves right?
On your graph, place a dot(s) where you believe the ant reaches a maximum temperature (it may occur at more than one spot).
Explain why you believe this is the spot where the maximum temperature occurs. What about the level curves tells you that these spots should be a maximum?
Draw the gradient of \(f\) at the places where the minimum and maximum temperatures occur. Also draw the gradient of \(g\) at these spots.
Explain how are gradients of \(f\) and \(g\) related at these spots.
Suppose \(f\) and \(g\) are continuously differentiable functions. Suppose that we want to find the maximum and minimum values of \(f\) subject to the constraint \(g(x,y)=c\) (where \(c\) is some constant). Then if a maximum or minimum occurs, it must occur at a spot where the gradient of \(f\) and the gradient of \(g\) point in the same, or opposite, directions. So the gradient of \(g\) must be a multiple of the gradient of \(f\text{.}\) To find the maximum and minimum values (if they exist), we just solve the system of equations that result from
\begin{equation*} \vec \nabla f = \lambda \vec \nabla g, \text{ and } g(x,y)=c \end{equation*}where \(\lambda\) is the proportionality constant. The maximum and minimum values will be among the solutions of this system of equations.
Suppose an ant walks around the circle \(x^2+y^2=1\text{.}\) As the ant walks around the circle, the temperature is \(T(x,y) = x^2+y+4\text{.}\) Our goal is to find the maximum and minimum temperatures \(T\) reached by the ant as it walks around the circle.
What function \(f(x,y)\) do we wish to optimize? What is the constraint \(g(x,y)=c\text{?}\)
The most common error on this exercise is to divide both sides of an equation by \(x\text{,}\) which could be zero. If you do this, you'll only get 2 ordered pairs.
Find the gradient of \(f\) and the gradient of \(g\text{.}\) Then solve the system of equations that you get from the equations
\begin{equation*} \vec \nabla f = \lambda \vec \nabla g, x^2+y^2=1. \end{equation*}You should obtain 4 ordered pairs \((x,y)\text{.}\)
At each ordered pair, find the temperature.
What is the maximum temperature obtained? What is the minimum temperature obtained? Do your results match the previous exercise?
Consider the curve \(xy^2=54\) (draw it). The distance from each point on this curve to the origin is a function that must have a minimum value. Find a point \((a,b)\) on the curve that is closest to the origin.
The distance to the origin is \(d(x,y)=\sqrt{x^2+y^2}.\) This distance is minimized when \(f(x,y) = x^2+y^2\) is minimized. So use \(f(x,y)=x^2+y^2\) as the function you wish to minimize. What's the constraint \(g(x,y)=c\text{?}\)
Find the dimensions of the rectangular box with maximum volume that can be inscribed inside the ellipsoid
\begin{equation*} \frac{x^2}{2^2}+\frac{y^2}{3^2}+\frac{z^2}{5^2}=1. \end{equation*}What is the function \(f\) you wish to optimize? What is the constraint \(g=c\text{?}\) Try solving each equation for \(\lambda\) so you can eliminate it from the exercise.
Repeat Exercise 10.2.5, but this time use Lagrange multipliers. Find the dimensions of the rectangular box of maximum volume that fits underneath the surface \(z=f(x,y)=9-x^2-y^2\) for \(z\geq 0\text{.}\)
Let \(f(x,y,z) = (2x)(2x)(z)\) and \(g(x,y,z)=z+x^2+y^2=9\text{.}\) You'll get a system of 4 equations with 4 unknowns (\(x,y,z,\lambda\)). Try solving each equation for lambda. You know \(x,y,z\) can't be zero or negative, so ignore those possible cases.
These are provided to help you achieve better skills in basic computational answers.