Section 4.8Lagrange Multipliers
Solving optimization problems for functions of two or more variables can be similar to solving such problems in single-variable calculus. However, techniques for dealing with multiple variables allow us to solve more varied optimization problems for which we need to deal with additional conditions or constraints. In this section, we examine one of the more common and useful methods for solving optimization problems with constraints.
Lagrange Multipliers
(see original) was an applied situation involving maximizing a profit function, subject to certain constraints. In that example, the constraints involved a maximum number of golf balls that could be produced and sold in \(1\) month \((x),\) and a maximum number of advertising hours that could be purchased per month \((y).\) Suppose these were combined into a budgetary constraint, such as \(20x+4y\le 216,\) that took into account the cost of producing the golf balls and the number of advertising hours purchased per month. The goal is, still, to maximize profit, but now there is a different type of constraint on the values of \(x\) and \(y.\) This constraint, when combined with the profit function \(f(x,y)=48x+96y-{x}^{2}-2xy-9{y}^{2},\) is an example of an optimization problem, and the function \(f(x,y)\) is called the objective function. A graph of various level curves of the function \(f(x,y)\) follows.

In Figure 1, the value \(c\) represents different profit levels (i.e., values of the function \(f).\) As the value of \(c\) increases, the curve shifts to the right. Since our goal is to maximize profit, we want to choose a curve as far to the right as possible. If there was no restriction on the number of golf balls the company could produce, or the number of units of advertising available, then we could produce as many golf balls as we want, and advertise as much as we want, and there would not be a maximum profit for the company. Unfortunately, we have a budgetary constraint that is modeled by the inequality \(20x+4y\le 216.\) To see how this constraint interacts with the profit function, Figure 2 shows the graph of the line \(20x+4y=216\) superimposed on the previous graph.

As mentioned previously, the maximum profit occurs when the level curve is as far to the right as possible. However, the level of production corresponding to this maximum profit must also satisfy the budgetary constraint, so the point at which this profit occurs must also lie on (or to the left of) the red line in Figure 2. Inspection of this graph reveals that this point exists where the line is tangent to the level curve of \(f.\) Trial and error reveals that this profit level seems to be around \(395,\) when \(x\) and \(y\) are both just less than \(5.\) We return to the solution of this problem later in this section. From a theoretical standpoint, at the point where the profit curve is tangent to the constraint line, the gradient of both of the functions evaluated at that point must point in the same (or opposite) direction. Recall that the gradient of a function of more than one variable is a vector. If two vectors point in the same (or opposite) directions, then one must be a constant multiple of the other. This idea is the basis of the method of Lagrange multipliers.
Let \(f\) and \(g\) be functions of two variables with continuous partial derivatives at every point of some open set containing the smooth curve \(g(x,y)=0.\) Suppose that \(f,\) when restricted to points on the curve \(g(x,y)=0,\) has a local extremum at the point \(({x}_{0},{y}_{0})\) and that \(∇g({x}_{0},{y}_{0})\ne 0.\) Then there is a number \(λ\) called a Lagrange multiplier, for which
\[∇f({x}_{0},{y}_{0})=λ∇g({x}_{0},{y}_{0}).\]
Proof
Assume that a constrained extremum occurs at the point \(({x}_{0},{y}_{0}).\) Furthermore, we assume that the equation \(g(x,y)=0\) can be smoothly parameterized as
\[x=x(s)\,\text{and}\,y=y(s)\]
where s is an arc length parameter with reference point \(({x}_{0},{y}_{0})\) at \(s=0.\) Therefore, the quantity \(z=f(x(s),y(s))\) has a relative maximum or relative minimum at \(s=0,\) and this implies that \(\frac{dz}{ds}=0\) at that point. From the chain rule,
\[\frac{dz}{ds}=\frac{∂f}{∂x}·\frac{dx}{ds}+\frac{∂f}{∂y}·\frac{dy}{ds}=(\frac{∂f}{∂x}\hat{i}+\frac{∂f}{∂y}\hat{j})·(\frac{dx}{ds}\hat{i}+\frac{dy}{ds}\hat{j})=0,\]
where the derivatives are all evaluated at \(s=0.\) However, the first factor in the dot product is the gradient of \(f,\) and the second factor is the unit tangent vector \(\text{T}(0)\) to the constraint curve. Since the point \(({x}_{0},{y}_{0})\) corresponds to \(s=0,\) it follows from this equation that
\[∇f({x}_{0},{y}_{0})·\text{T}(0)=0,\]
which implies that the gradient is either \(0\) or is normal to the constraint curve at a constrained relative extremum. However, the constraint curve \(g(x,y)=0\) is a level curve for the function \(g(x,y)\) so that if \(∇g({x}_{0},{y}_{0})\ne 0\) then \(∇g({x}_{0},{y}_{0})\) is normal to this curve at \(({x}_{0},{y}_{0})\) It follows, then, that there is some scalar \(λ\) such that
\[∇f({x}_{0},{y}_{0})=λ∇g({x}_{0},{y}_{0})\]
□
To apply Method of Lagrange Multipliers: One Constraint to an optimization problem similar to that for the golf ball manufacturer, we need a problem-solving strategy.
- Determine the objective function \(f(x,y)\) and the constraint function \(g(x,y).\) Does the optimization problem involve maximizing or minimizing the objective function?
- Set up a system of equations using the following template:
\[\begin{array}{lll}∇f({x}_{0},{y}_{0}) & = & λ∇g({x}_{0},{y}_{0}) \\ g({x}_{0},{y}_{0}) & = & 0.\end{array}\]
- Solve for \({x}_{0}\) and \({y}_{0}.\)
- The largest of the values of \(f\) at the solutions found in step \(3\) maximizes \(f;\) the smallest of those values minimizes \(f.\)
Use the method of Lagrange multipliers to find the minimum value of \(f(x,y)={x}^{2}+4{y}^{2}-2x+8y\) subject to the constraint \(x+2y=7.\)
Write the constraint as \(g(x,y)=0,\) set \(∇f=λ∇g,\) match the \(i\) and \(j\) coefficients, then combine those equations with \(g=0\) to solve the resulting system.
Let’s follow the problem-solving strategy:
- The optimization function is \(f(x,y)={x}^{2}+4{y}^{2}-2x+8y.\) To determine the constraint function, we must first subtract \(7\) from both sides of the constraint. This gives \(x+2y-7=0.\) The constraint function is equal to the left-hand side, so \(g(x,y)=x+2y-7.\) The problem asks us to solve for the minimum value of \(f,\) subject to the constraint (see the following graph).

Figure 3 — Graph of level curves of the function \(f(x,y)={x}^{2}+4{y}^{2}-2x+8y\) corresponding to \(c=10\) and \(26.\) The red graph is the constraint function. - We then must calculate the gradients of both f and g:
The equation \(∇f({x}_{0},{y}_{0})=λ∇g({x}_{0},{y}_{0})\) becomes
which can be rewritten as
Next, we set the coefficients of \(i\,\text{and}\,j\) equal to each other:
The equation \(g({x}_{0},{y}_{0})=0\) becomes \({x}_{0}+2{y}_{0}-7=0.\) Therefore, the system of equations that needs to be solved is\[\begin{array}{l}∇f(x,y)=(2x-2)i+(8y+8)j \\ ∇g(x,y)=i+2j.\end{array}\]
\[(2{x}_{0}-2)i+(8{y}_{0}+8)j=λ(i+2j),\]
\[(2{x}_{0}-2)i+(8{y}_{0}+8)j=λi+2λj.\]
\[\begin{array}{l}2{x}_{0}-2=λ \\ 8{y}_{0}+8=2λ.\end{array}\]
\[\begin{array}{lll}2{x}_{0}-2 & = & λ \\ 8{y}_{0}+8 & = & 2λ \\ {x}_{0}+2{y}_{0}-7 & = & 0.\end{array}\]
- This is a linear system of three equations in three variables. We start by solving the second equation for \(λ\) and substituting it into the first equation. This gives \(λ=4{y}_{0}+4,\) so substituting this into the first equation gives
Solving this equation for \({x}_{0}\) gives \({x}_{0}=2{y}_{0}+3.\) We then substitute this into the third equation:
Since \({x}_{0}=2{y}_{0}+3,\) this gives \({x}_{0}=5.\)\[2{x}_{0}-2=4{y}_{0}+4.\]
\[\begin{array}{lll}(2{y}_{0}+3)+2{y}_{0}-7 & = & 0 \\ 4{y}_{0}-4 & = & 0 \\ {y}_{0} & = & 1.\end{array}\]
- Next, we substitute \((5,1)\) into \(f(x,y)={x}^{2}+4{y}^{2}-2x+8y,\) gives \(f(5,1)={5}^{2}+4{(1)}^{2}-2(5)+8(1)=27.\) To ensure this corresponds to a minimum value on the constraint function, let’s try some other values, such as the intercepts of \(g(x,y)=0,\) Which are \((7,0)\) and \((0,3.5).\) We get \(f(7,0)=35\) and \(f(0,3.5)=77,\) so it appears \(f\) has a minimum at \((5,1).\)
Use the method of Lagrange multipliers to find the maximum value of \(f(x,y)=9{x}^{2}+36xy-4{y}^{2}-18x-8y\) subject to the constraint \(3x+4y=32.\)
\(f\) has a maximum value of \(976\) at the point \((8,2).\)
Let’s now return to the problem posed at the beginning of the section.
The golf ball manufacturer, Pro-T, has developed a profit model that depends on the number \(x\) of golf balls sold per month (measured in thousands), and the number of hours per month of advertising y, according to the function
\[z=f(x,y)=48x+96y-{x}^{2}-2xy-9{y}^{2},\]
where \(z\) is measured in thousands of dollars. The budgetary constraint function relating the cost of the production of thousands golf balls and advertising units is given by \(20x+4y=216.\) Find the values of \(x\) and \(y\) that maximize profit, and find the maximum profit.
Rewrite the budget constraint as \(g(x,y)=0,\) set \(∇f=λ∇g,\) match coefficients, and solve the resulting system together with the constraint equation.
Again, we follow the problem-solving strategy:
- The optimization function is \(f(x,y)=48x+96y-{x}^{2}-2xy-9{y}^{2}.\) To determine the constraint function, we first subtract 216 from both sides of the constraint, then divide both sides by \(4,\) which gives \(5x+y-54=0.\) The constraint function is equal to the left-hand side, so \(g(x,y)=5x+y-54.\) The problem asks us to solve for the maximum value of \(f,\) subject to this constraint.
- So, we calculate the gradients of both \(f\,\text{and}\) \(g\text{:}\)
The equation \(∇f({x}_{0},{y}_{0})=λ∇g({x}_{0},{y}_{0})\) becomes
which can be rewritten as
We then set the coefficients of \(i\,\text{and}\,j\) equal to each other:
The equation \(g({x}_{0},{y}_{0})=0\) becomes \(5{x}_{0}+{y}_{0}-54=0.\) Therefore, the system of equations that needs to be solved is\[\begin{array}{l}∇f(x,y)=(48-2x-2y)i+(96-2x-18y)j \\ ∇g(x,y)=5i+j.\end{array}\]
\[(48-2{x}_{0}-2{y}_{0})i+(96-2{x}_{0}-18{y}_{0})j=λ(5i+j),\]
\[(48-2{x}_{0}-2{y}_{0})i+(96-2{x}_{0}-18{y}_{0})j=λ5i+λj.\]
\[\begin{array}{lll}48-2{x}_{0}-2{y}_{0} & = & 5λ \\ 96-2{x}_{0}-18{y}_{0} & = & λ.\end{array}\]
\[\begin{array}{lll}48-2{x}_{0}-2{y}_{0} & = & 5λ \\ 96-2{x}_{0}-18{y}_{0} & = & λ \\ 5{x}_{0}+{y}_{0}-54 & = & 0.\end{array}\]
- We use the left-hand side of the second equation to replace \(λ\) in the first equation:
Then we substitute this into the third equation:
Since \({x}_{0}=54-11{y}_{0},\) this gives \({x}_{0}=10.\)\[\begin{array}{lll}48-2{x}_{0}-2{y}_{0} & = & 5(96-2{x}_{0}-18{y}_{0}) \\ 48-2{x}_{0}-2{y}_{0} & = & 480-10{x}_{0}-90{y}_{0} \\ 8{x}_{0} & = & 432-88{y}_{0} \\ {x}_{0} & = & 54-11{y}_{0}.\end{array}\]
\[\begin{array}{lll}5(54-11{y}_{0})+{y}_{0}-54 & = & 0 \\ 270-55{y}_{0}+{y}_{0} & = & 0 \\ 216-54{y}_{0} & = & 0 \\ {y}_{0} & = & 4.\end{array}\]
- We then substitute \((10,4)\) into \(f(x,y)=48x+96y-{x}^{2}-2xy-9{y}^{2},\) which gives
Therefore the maximum profit that can be attained, subject to budgetary constraints, is \(\text{\$}540,000\) with a production level of \(10,000\) golf balls and \(4\) hours of advertising bought per month. Let’s check to make sure this truly is a maximum. The endpoints of the line that defines the constraint are \((10.8,0)\) and \((0,54)\) Let’s evaluate \(f\) at both of these points:
The second value represents a loss, since no golf balls are produced. Neither of these values exceed \(540,\) so it seems that our extremum is a maximum value of \(f.\)\[\begin{array}{ll}f(10,4) & =48(10)+96(4)-{(10)}^{2}-2(10)(4)-9{(4)}^{2} \\ & =480+384-100-80-144=540.\end{array}\]
\[\begin{array}{lll}f(10.8,0) & = & 48(10.8)+96(0)-{10.8}^{2}-2(10.8)(0)-9({0}^{2})=401.76 \\ f(0,54) & = & 48(0)+96(54)-{0}^{2}-2(0)(54)-9({54}^{2})=-21,060.\end{array}\]
A company has determined that its production level is given by the Cobb-Douglas function \(f(x,y)=2.5{x}^{0.45}{y}^{0.55}\) where x represents the total number of labor hours in \(1\) year and y represents the total capital input for the company. Suppose \(1\) unit of labor costs \(\text{\$}40\) and \(1\) unit of capital costs \(\text{\$}50.\) Use the method of Lagrange multipliers to find the maximum value of \(f(x,y)=2.5{x}^{0.45}{y}^{0.55}\) subject to a budgetary constraint of \(\text{\$}500,000\) per year.
A maximum production level of \(13890\) occurs with \(5625\) labor hours and \(\text{\$}5500\) of total capital input.
In the case of an optimization function with three variables and a single constraint function, it is possible to use the method of Lagrange multipliers to solve an optimization problem as well. An example of an optimization function with three variables could be the Cobb-Douglas function in the previous example: \(f(x,y,z)={x}^{0.2}{y}^{0.4}{z}^{0.4},\) where \(x\) represents the cost of labor, \(y\) represents capital input, and \(z\) represents the cost of advertising. The method is the same as for the method with a function of two variables; the equations to be solved are
\[\begin{array}{lll}∇f(x,y,z) & = & λ∇g(x,y,z) \\ g(x,y,z) & = & 0.\end{array}\]
Find the minimum of the function \(f(x,y,z)={x}^{2}+{y}^{2}+{z}^{2}\) subject to the constraint \(x+y+z=1.\)
Set \(∇f=λ∇g\) componentwise to get three equations; notice they force \({x}_{0}={y}_{0}={z}_{0},\) then substitute into the constraint to solve.
- The optimization function is \(f(x,y,z)={x}^{2}+{y}^{2}+{z}^{2}.\) To determine the constraint function, we subtract \(1\) from each side of the constraint: \(x+y+z-1=0\) which gives the constraint function as \(g(x,y,z)=x+y+z-1.\)
- Next, we calculate \(∇f(x,y,z)\) and \(∇g(x,y,z)\text{:}\)
This leads to the equations
which can be rewritten in the following form:\[\begin{array}{l}∇f(x,y,z)=\langle 2x,2y,2z\rangle \\ ∇g(x,y,z)=\langle 1,1,1\rangle \text{.}\end{array}\]
\[\begin{array}{lll}\langle 2{x}_{0},2{y}_{0},2{z}_{0}\rangle & = & λ\langle 1,1,1\rangle \\ {x}_{0}+{y}_{0}+{z}_{0}-1 & = & 0\end{array}\]
\[\begin{array}{lll}2{x}_{0} & = & λ \\ 2{y}_{0} & = & λ \\ 2{z}_{0} & = & λ \\ {x}_{0}+{y}_{0}+{z}_{0}-1 & = & 0.\end{array}\]
- Since each of the first three equations has \(λ\) on the right-hand side, we know that \(2{x}_{0}=2{y}_{0}=2{z}_{0}\) and all three variables are equal to each other. Substituting \({y}_{0}={x}_{0}\) and \({z}_{0}={x}_{0}\) into the last equation yields \(3{x}_{0}-1=0,\) so \({x}_{0}=\frac{1}{3}\) and \({y}_{0}=\frac{1}{3}\) and \({z}_{0}=\frac{1}{3}\) which corresponds to a critical point on the constraint curve.
- Then, we evaluate f at the point \((\frac{1}{3},\frac{1}{3},\frac{1}{3})\text{:}\)
Therefore, an extremum of the function is \(\frac{1}{3}.\) To verify it is a minimum, choose other points that satisfy the constraint and calculate \(f\) at that point. For example,
Both of these values are greater than \(\frac{1}{3},\) leading us to believe the extremum is a minimum.\[f(\frac{1}{3},\frac{1}{3},\frac{1}{3})={(\frac{1}{3})}^{2}+{(\frac{1}{3})}^{2}+{(\frac{1}{3})}^{2}=\frac{3}{9}=\frac{1}{3}.\]
\[\begin{array}{lll}f(1,0,0) & = & {1}^{2}+{0}^{2}+{0}^{2}=1 \\ f(0,-2,3) & = & {0}^{2}+{(-2)}^{2}+{3}^{2}=13.\end{array}\]
Use the method of Lagrange multipliers to find the minimum value of the function
\[f(x,y,z)=x+y+z\]
subject to the constraint \({x}^{2}+{y}^{2}+{z}^{2}=1.\)
\(\begin{array}{lll}f(\frac{\sqrt{3}}{3},\frac{\sqrt{3}}{3},\frac{\sqrt{3}}{3}) & = & \frac{\sqrt{3}}{3}+\frac{\sqrt{3}}{3}+\frac{\sqrt{3}}{3}=\sqrt{3} \\ f(-\frac{\sqrt{3}}{3},-\frac{\sqrt{3}}{3},-\frac{\sqrt{3}}{3}) & = & -\frac{\sqrt{3}}{3}-\frac{\sqrt{3}}{3}-\frac{\sqrt{3}}{3}=\text{-}\sqrt{3}.\end{array}\)
Problems with Two Constraints
The method of Lagrange multipliers can be applied to problems with more than one constraint. In this case the optimization function, \(w\) is a function of three variables:
\[w=f(x,y,z)\]
and it is subject to two constraints:
\[g(x,y,z)=0\,\text{and}\,h(x,y,z)=0.\]
There are two Lagrange multipliers, \({λ}_{1}\) and \({λ}_{2},\) and the system of equations becomes
\[\begin{array}{lll}∇f({x}_{0},{y}_{0},{z}_{0}) & = & {λ}_{1}∇g({x}_{0},{y}_{0},{z}_{0})+{λ}_{2}∇h({x}_{0},{y}_{0},{z}_{0}) \\ g({x}_{0},{y}_{0},{z}_{0}) & = & 0 \\ h({x}_{0},{y}_{0},{z}_{0}) & = & 0.\end{array}\]
Find the local extreme values of the function
\[f(x,y,z)={x}^{2}+{y}^{2}+{z}^{2}\]
subject to the constraints \({z}^{2}={x}^{2}+{y}^{2}\) and \(x+y-z+1=0.\)
Set \(∇f={λ}_{1}∇g+{λ}_{2}∇h\) componentwise, eliminate the multipliers between the resulting equations, then combine with both constraint equations to solve for \({x}_{0},{y}_{0},{z}_{0}.\)
Let’s follow the problem-solving strategy:
- The optimization function is \(f(x,y,z)={x}^{2}+{y}^{2}+{z}^{2}.\) To determine the constraint functions, we first subtract \({z}^{2}\) from both sides of the first constraint, which gives \({x}^{2}+{y}^{2}-{z}^{2}=0,\) so \(g(x,y,z)={x}^{2}+{y}^{2}-{z}^{2}.\) The second constraint function is \(h(x,y,z)=x+y-z+1.\)
- We then calculate the gradients of \(f,g,\,\text{and}\,h\text{:}\)
The equation \(∇f({x}_{0},{y}_{0},{z}_{0})={λ}_{1}∇g({x}_{0},{y}_{0},{z}_{0})+{λ}_{2}∇h({x}_{0},{y}_{0},{z}_{0})\) becomes
which can be rewritten as
Next, we set the coefficients of \(i\,\text{,}\,j\text{, and}\,k\) equal to each other:
The two equations that arise from the constraints are \({z}_{0}{}^{2}={x}_{0}{}^{2}+{y}_{0}{}^{2}\) and \({x}_{0}+{y}_{0}-{z}_{0}+1=0.\) Combining these equations with the previous three equations gives\[\begin{array}{l}∇f(x,y,z)=2xi+2yj+2zk \\ ∇g(x,y,z)=2xi+2yj-2zk \\ ∇h(x,y,z)=i+j-k.\end{array}\]
\[2{x}_{0}i+2{y}_{0}j+2{z}_{0}k={λ}_{1}(2{x}_{0}i+2{y}_{0}j-2{z}_{0}k)+{λ}_{2}(i+j-k),\]
\[2{x}_{0}i+2{y}_{0}j+2{z}_{0}k=(2{λ}_{1}{x}_{0}+{λ}_{2})i+(2{λ}_{1}{y}_{0}+{λ}_{2})j-(2{λ}_{1}{z}_{0}+{λ}_{2})k.\]
\[\begin{array}{l}2{x}_{0}=2{λ}_{1}{x}_{0}+{λ}_{2} \\ 2{y}_{0}=2{λ}_{1}{y}_{0}+{λ}_{2} \\ 2{z}_{0}=-2{λ}_{1}{z}_{0}-{λ}_{2}.\end{array}\]
\[\begin{array}{lll}2{x}_{0} & = & 2{λ}_{1}{x}_{0}+{λ}_{2} \\ 2{y}_{0} & = & 2{λ}_{1}{y}_{0}+{λ}_{2} \\ 2{z}_{0} & = & -2{λ}_{1}{z}_{0}-{λ}_{2} \\ {z}_{0}{}^{2} & = & {x}_{0}{}^{2}+{y}_{0}{}^{2} \\ {x}_{0}+{y}_{0}-{z}_{0}+1 & = & 0.\end{array}\]
- The first three equations contain the variable \({λ}_{2}.\) Solving the third equation for \({λ}_{2}\) and replacing into the first and second equations reduces the number of equations to four:
Next, we solve the first and second equation for \({λ}_{1}.\) The first equation gives \({λ}_{1}=\frac{{x}_{0}+{z}_{0}}{{x}_{0}-{z}_{0}},\) the second equation gives \({λ}_{1}=\frac{{y}_{0}+{z}_{0}}{{y}_{0}-{z}_{0}}.\) We set the right-hand side of each equation equal to each other and cross-multiply:
Therefore, either \({z}_{0}=0\) or \({y}_{0}={x}_{0}.\) If \({z}_{0}=0,\) then the first constraint becomes \(0={x}_{0}{}^{2}+{y}_{0}{}^{2}.\) The only real solution to this equation is \({x}_{0}=0\) and \({y}_{0}=0,\) which gives the ordered triple \((0,0,0).\) This point does not satisfy the second constraint, so it is not a solution.
Next, we consider \({y}_{0}={x}_{0},\) which reduces the number of equations to three:
We substitute the first equation into the second and third equations:
Then, we solve the second equation for \({z}_{0},\) which gives \({z}_{0}=2{x}_{0}+1.\) We then substitute this into the first equation,
and use the quadratic formula to solve for \({x}_{0}\text{:}\)
Recall \({y}_{0}={x}_{0},\) so this solves for \({y}_{0}\) as well. Then, \({z}_{0}=2{x}_{0}+1,\) so
Therefore, there are two ordered triplet solutions:\[\begin{array}{lll}2{x}_{0} & = & 2{λ}_{1}{x}_{0}-2{λ}_{1}{z}_{0}-2{z}_{0} \\ 2{y}_{0} & = & 2{λ}_{1}{y}_{0}-2{λ}_{1}{z}_{0}-2{z}_{0} \\ {z}_{0}{}^{2} & = & {x}_{0}{}^{2}+{y}_{0}{}^{2} \\ {x}_{0}+{y}_{0}-{z}_{0}+1 & = & 0.\end{array}\]
\[\begin{array}{lll}\frac{{x}_{0}+{z}_{0}}{{x}_{0}-{z}_{0}} & = & \frac{{y}_{0}+{z}_{0}}{{y}_{0}-{z}_{0}} \\ ({x}_{0}+{z}_{0})({y}_{0}-{z}_{0}) & = & ({x}_{0}-{z}_{0})({y}_{0}+{z}_{0}) \\ {x}_{0}{y}_{0}-{x}_{0}{z}_{0}+{y}_{0}{z}_{0}-{z}_{0}{}^{2} & = & {x}_{0}{y}_{0}+{x}_{0}{z}_{0}-{y}_{0}{z}_{0}-{z}_{0}2 \\ 2{y}_{0}{z}_{0}-2{x}_{0}{z}_{0} & = & 0 \\ 2{z}_{0}({y}_{0}-{x}_{0}) & = & 0.\end{array}.\]
\[\begin{array}{lll}{y}_{0} & = & {x}_{0} \\ {z}_{0}{}^{2} & = & {x}_{0}{}^{2}+{y}_{0}{}^{2} \\ {x}_{0}+{y}_{0}-{z}_{0}+1 & = & 0.\end{array}\]
\[\begin{array}{lll}{z}_{0}{}^{2} & = & {x}_{0}{}^{2}+{x}_{0}{}^{2} \\ {x}_{0}+{x}_{0}-{z}_{0}+1 & = & 0.\end{array}\]
\[\begin{array}{lll}{z}_{0}{}^{2} & = & 2{x}_{0}{}^{2} \\ {(2{x}_{0}+1)}^{2} & = & 2{x}_{0}{}^{2} \\ 4{x}_{0}{}^{2}+4{x}_{0}+1 & = & 2{x}_{0}{}^{2} \\ 2{x}_{0}{}^{2}+4{x}_{0}+1 & = & 0,\end{array}\]
\[{x}_{0}=\frac{-4\pm \sqrt{{4}^{2}-4(2)(1)}}{2(2)}=\frac{-4\pm \sqrt{8}}{4}=\frac{-4\pm 2\sqrt{2}}{4}=-1\pm \frac{\sqrt{2}}{2}.\]
\[{z}_{0}=2{x}_{0}+1=2(-1\pm \frac{\sqrt{2}}{2})+1=-2+1\pm \sqrt{2}=-1\pm \sqrt{2}.\]
\[(-1+\frac{\sqrt{2}}{2},-1+\frac{\sqrt{2}}{2},-1+\sqrt{2})\,\text{and}\,(-1-\frac{\sqrt{2}}{2},-1-\frac{\sqrt{2}}{2},-1-\sqrt{2}).\]
- We substitute \((-1+\frac{\sqrt{2}}{2},-1+\frac{\sqrt{2}}{2},-1+\sqrt{2})\) into \(f(x,y,z)={x}^{2}+{y}^{2}+{z}^{2},\) which gives
Then, we substitute \((-1-\frac{\sqrt{2}}{2},-1-\frac{\sqrt{2}}{2},-1-\sqrt{2})\) into \(f(x,y,z)={x}^{2}+{y}^{2}+{z}^{2},\) which gives
\(6+4\sqrt{2}\) and \(6-4\sqrt{2}\) are the local extreme values of \(f(x,y,z),\) subject to the given constraints.\[\begin{array}{ll}f(-1+\frac{\sqrt{2}}{2},-1+\frac{\sqrt{2}}{2},-1+\sqrt{2}) & ={(-1+\frac{\sqrt{2}}{2})}^{2}+{(-1+\frac{\sqrt{2}}{2})}^{2}+{(-1+\sqrt{2})}^{2} \\ & =(1-\sqrt{2}+\frac{1}{2})+(1-\sqrt{2}+\frac{1}{2})+(1-2\sqrt{2}+2) \\ & =6-4\sqrt{2}.\end{array}\]
\[\begin{array}{ll}f(-1-\frac{\sqrt{2}}{2},-1-\frac{\sqrt{2}}{2},-1-\sqrt{2}) & ={(-1-\frac{\sqrt{2}}{2})}^{2}+{(-1-\frac{\sqrt{2}}{2})}^{2}+{(-1-\sqrt{2})}^{2} \\ & =(1+\sqrt{2}+\frac{1}{2})+(1+\sqrt{2}+\frac{1}{2})+(1+2\sqrt{2}+2) \\ & =6+4\sqrt{2}.\end{array}\]
Use the method of Lagrange multipliers to find the minimum value of the function
\[f(x,y,z)={x}^{2}+{y}^{2}+{z}^{2}\]
subject to the constraints \(2x+y+2z=9\) and \(5x+5y+7z=29.\)
\(f(2,1,2)=9\) is a minimum.
Key Concepts
- An objective function combined with one or more constraints is an example of an optimization problem. (See Example 2.)
- To solve optimization problems, we apply the method of Lagrange multipliers using a four-step problem-solving strategy. (See Example 1, Example 3, and Example 4.)
Key Equations
| Method of Lagrange multipliers, one constraint | \(\begin{array}{lll}∇f({x}_{0},{y}_{0}) & = & λ∇g({x}_{0},{y}_{0}) \\ g({x}_{0},{y}_{0}) & = & 0\end{array}\) |
| Method of Lagrange multipliers, two constraints | \(\begin{array}{lll}∇f({x}_{0},{y}_{0},{z}_{0}) & = & {λ}_{1}∇g({x}_{0},{y}_{0},{z}_{0})+{λ}_{2}∇h({x}_{0},{y}_{0},{z}_{0}) \\ g({x}_{0},{y}_{0},{z}_{0}) & = & 0 \\ h({x}_{0},{y}_{0},{z}_{0}) & = & 0\end{array}\) |
Section Exercises
For the following exercises, use the method of Lagrange multipliers to find the maximum and minimum values of the function subject to the given constraints.
\(f(x,y)={x}^{2}y;{x}^{2}+2{y}^{2}=6\)
\(f(x,y,z)=xyz,{x}^{2}+2{y}^{2}+3{z}^{2}=6\)
maximum: \(2\frac{\sqrt{3}}{3},\) minimum: \(\frac{-2\sqrt{3}}{3}\)
\(f(x,y)=xy;4{x}^{2}+8{y}^{2}=16\)
\(f(x,y)=4{x}^{3}+{y}^{2};2{x}^{2}+{y}^{2}=1\)
maximum: \((\frac{\sqrt{2}}{2},0,\sqrt{2}),\) minimum: \((\frac{\text{-}\sqrt{2}}{2},0,\text{-}\sqrt{2})\)
\(f(x,y,z)={x}^{2}+{y}^{2}+{z}^{2},{x}^{4}+{y}^{4}+{z}^{4}=1\)
\(f(x,y,z)=yz+xy,xy=1,{y}^{2}+{z}^{2}=1\)
maximum: \(\frac{3}{2},\) minimum = \(\frac{1}{2}\)
\(f(x,y)={x}^{2}+{y}^{2},{(x-1)}^{2}+4{y}^{2}=4\)
\(f(x,y)=4xy,\frac{{x}^{2}}{9}+\frac{{y}^{2}}{16}=1\)
maxima: \(f(\frac{3\sqrt{2}}{2},2\sqrt{2})=24,\) \(f(-\frac{3\sqrt{2}}{2},-2\sqrt{2})=24;\) minima: \(f(-\frac{3\sqrt{2}}{2},2\sqrt{2})=-24,\) \(f(\frac{3\sqrt{2}}{2},-2\sqrt{2})=-24\)
\(f(x,y,z)=x+y+z,\frac{1}{x}+\frac{1}{y}+\frac{1}{z}=1\)
\(f(x,y,z)=x+3y-z,{x}^{2}+{y}^{2}+{z}^{2}=4\)
maximum: \(2\sqrt{11}\) at \(f(\frac{2}{\sqrt{11}},\frac{6}{\sqrt{11}},\frac{-2}{\sqrt{11}});\) minimum: \(-2\sqrt{11}\) at \(f(\frac{-2}{\sqrt{11}},\frac{-6}{\sqrt{11}},\frac{2}{\sqrt{11}})\)
\(f(x,y,z)={x}^{2}+{y}^{2}+{z}^{2},xyz=4\)
Minimize \(f(x,y)={x}^{2}+{y}^{2}\) on the hyperbola \(xy=1.\)
\(2.0\)
Minimize \(f(x,y)=xy\) on the ellipse \({b}^{2}{x}^{2}+{a}^{2}{y}^{2}={a}^{2}{b}^{2}.\)
Maximize \(f(x,y,z)=2x+3y+5z\) on the sphere \({x}^{2}+{y}^{2}+{z}^{2}=19.\)
\(19\sqrt{2}\)
Maximize \(\begin{array}{l}f(x,y)={x}^{2}-{y}^{2};x>0,y>0; \\ g(x,y)=y-{x}^{2}=0\end{array}\)
The curve \({x}^{3}-{y}^{3}=1\) is asymptotic to the line \(y=x.\) Find the point(s) on the curve \({x}^{3}-{y}^{3}=1\) farthest from the line \(y=x.\)
\((\frac{1}{\sqrt[3]{2}},\frac{-1}{\sqrt[3]{2}})\)
Maximize \(U(x,y)=8{x}^{4\text{/}5}{y}^{1\text{/}5};4x+2y=12\)
Minimize \(f(x,y)={x}^{2}+{y}^{2},x+2y-5=0.\)
\(f(1,2)=5\)
Maximize \(f(x,y)=\sqrt{6-{x}^{2}-{y}^{2}},x+y-2=0.\)
Minimize \(f(x,y,z)={x}^{2}+{y}^{2}+{z}^{2},x+y+z=1.\)
\(f(\frac{1}{3},\frac{1}{3},\frac{1}{3})=\frac{1}{3}\)
Minimize \(f(x,y)={x}^{2}-{y}^{2}\) subject to the constraint \(x-2y+6=0.\)
Minimize \(f(x,y,z)={x}^{2}+{y}^{2}+{z}^{2}\) when \(x+y+z=9\) and \(x+2y+3z=20.\)
minimum: \(f(2,3,4)=29\)
For the next group of exercises, use the method of Lagrange multipliers to solve the following applied problems.
A pentagon is formed by placing an isosceles triangle on a rectangle, as shown in the diagram. If the perimeter of the pentagon is \(10\) in., find the lengths of the sides of the pentagon that will maximize the area of the pentagon.
A rectangular box without a top (a topless box) is to be made from \(12\) ft2 of cardboard. Find the maximum volume of such a box.
The maximum volume is \(4\) ft3. The dimensions are \(1\,\times \,2\,\times \,2\) ft.
Find the minimum and maximum distances between the ellipse \({x}^{2}+xy+2{y}^{2}=1\) and the origin.
Find the point on the surface \({x}^{2}-2xy+{y}^{2}-x+y=0\) closest to the point \((1,2,-3).\)
The point on the surface \({x}^{2}-2xy+{y}^{2}-x+y=0\) closest to the point \((1,2,-3)\) is \(\left(\frac{3}{2},\frac{3}{2},-3\right)\) .
Show that, of all the triangles inscribed in a circle of radius \(R\) (see diagram), the equilateral triangle has the largest perimeter.
Find the minimum distance from point \((0,1)\) to the parabola \({x}^{2}=4y.\)
\(1.0\)
Find the minimum distance from the parabola \(y={x}^{2}\) to point \((0,3).\)
Find the minimum distance from the plane \(x+y+z=1\) to point \((2,1,1).\)
\(\sqrt{3}\)
A large container in the shape of a rectangular solid must have a volume of \(480\) m3. The bottom of the container costs $5/m2 to construct whereas the top and sides cost $3/m2 to construct. Use Lagrange multipliers to find the dimensions of the container of this size that has the minimum cost.
Find the point on the line \(y=2x+3\) that is closest to point \((4,2).\)
\((\frac{2}{5},\frac{19}{5})\)
Find the point on the plane \(4x+3y+z=2\) that is closest to the point \((1,-1,1).\)
Find the maximum value of \(f(x,y)=\text{sin}\,x\,\text{sin}\,y,\) where \(x\,\text{and}\,y\) denote the acute angles of a right triangle. Draw the contours of the function using a CAS.
\(\frac{1}{2}\)
A rectangular solid is contained within a tetrahedron with vertices at
\((1,0,0),(0,1,0),(0,0,1),\) and the origin. The base of the box has dimensions \(x,y,\) and the height of the box is \(z.\) If the sum of \(x,y,\,\text{and}\,z\) is 1.0, find the dimensions that maximizes the volume of the rectangular solid.
[T] By investing x units of labor and y units of capital, a watch manufacturer can produce \(P(x,y)=50{x}^{0.4}{y}^{0.6}\) watches. Find the maximum number of watches that can be produced on a budget of \(\text{\$}20,000\) if labor costs $100/unit and capital costs $200/unit. Use a CAS to sketch a contour plot of the function.
Roughly 3365 watches at the critical point \((80,60)\)
Chapter Review Exercises
For the following exercises, determine whether the statement is true or false. Justify your answer with a proof or a counterexample.
The domain of \(f(x,y)={x}^{3}{\text{sin}}^{-1}(y)\) is \(x=\) all real numbers, and \(\text{-}\pi \le y\le \pi .\)
If the function \(f(x,y)\) and all its second derivatives are continuous everywhere, then \({f}_{xy}={f}_{yx}.\)
True, by Clairaut’s theorem
The linear approximation to the function of \(f(x,y)=5{x}^{2}+x\,\text{tan}(y)\) at \((2,\pi )\) is given by \(L(x,y)=22+21(x-2)+(y-\pi ).\)
\((\frac{3}{4},\frac{9}{16})\) is a critical point of \(g(x,y)=4{x}^{3}-2{x}^{2}y+{y}^{2}-2.\)
False
For the following exercises, sketch the function in one graph and, in a second, sketch several level curves.
\(f(x,y)={e}^{\text{-}({x}^{2}+2{y}^{2})}.\)
\(f(x,y)=x+4{y}^{2}.\)
Answers may vary
For the following exercises, evaluate the following limits, if they exist. If they do not exist, prove it.
\(\underset{(x,y)\to (1,1)}{\text{lim}}\frac{4xy}{x-2{y}^{2}}\)
\(\underset{(x,y)\to (0,0)}{\text{lim}}\frac{4xy}{x-2{y}^{2}}\)
Does not exist
For the following exercises, find the largest region of continuity for the function.
\(f(x,y)={x}^{3}{\text{sin}}^{-1}(y)\)
\(g(x,y)=\text{ln}(4-{x}^{2}-{y}^{2})\)
Continuous at all points on the \(x,y\text{-plane,}\) except where \({x}^{2}+{y}^{2}>4.\)
For the following exercises, find all first derivatives, full or partial, as appropriate.
\(f(x,y)=\sqrt{{x}^{2}-{y}^{2}}\)
\(u(x,y)={x}^{4}-3xy+1,x=2t,y={t}^{3}\)
\(\frac{∂u}{∂x}=4{x}^{3}-3y,\frac{∂u}{∂y}=-3x,\frac{dx}{dt}=2,\frac{dy}{dt}=3{t}^{2},\frac{du}{dt}=40{t}^{3}\)
For the following exercises, find all second partial derivatives.
\(g(t,x)=3{t}^{2}-\text{sin}(x+t)\)
\(h(x,y,z)=\frac{{x}^{3}{e}^{2y}}{z}\)
\({h}_{xx}(x,y,z)=\frac{6x{e}^{2y}}{z},\) \({h}_{xy}(x,y,z)=\frac{6{x}^{2}{e}^{2y}}{z},\) \({h}_{xz}(x,y,z)=-\frac{3{x}^{2}{e}^{2y}}{{z}^{2}},\) \({h}_{yx}(x,y,z)=\frac{6{x}^{2}{e}^{2y}}{z},\) \({h}_{yy}(x,y,z)=\frac{4{x}^{3}{e}^{2y}}{z},\) \({h}_{yz}(x,y,z)=-\frac{2{x}^{3}{e}^{2y}}{{z}^{2}},\) \({h}_{zx}(x,y,z)=-\frac{3{x}^{2}{e}^{2y}}{{z}^{2}},\) \({h}_{zy}(x,y,z)=-\frac{2{x}^{3}{e}^{2y}}{{z}^{2}},\) \({h}_{zz}(x,y,z)=\frac{2{x}^{3}{e}^{2y}}{{z}^{3}}\)
For the following exercises, find an equation of the tangent plane to the specified surface at the given point.
\(z={x}^{3}-2{y}^{2}+y-1\) at point \((1,1,-1)\)
\(z={e}^{x}+\frac{2}{y}\) at point \((0,1,3)\)
\(z=x-2y+5\)
Approximate \(f(x,y)={e}^{{x}^{2}}+\sqrt{y}\) at \((0.1,9.1).\) Write down your linear approximation function \(L(x,y).\) How accurate is the approximation to the exact answer, rounded to four digits?
Find the differential \(dz\) of \(h(x,y)=4{x}^{2}+2xy-3y\) and approximate \(\Delta z\) at the point \((1,-2).\) Let \(\Delta x=0.1\) and \(\Delta y=0.01.\)
\(dz=4dx-dy,\) \(dz(0.1,0.01)=0.39,\) \(\Delta z=0.432\)
Find the directional derivative of \(f(x,y)={x}^{2}+6xy-{y}^{2}\) in the direction \(\text{v}=i+4j.\)
Find the maximal directional derivative magnitude and direction for the function \(f(x,y)={x}^{3}+2xy-\text{cos}(\pi y)\) at point \((3,0).\)
\(3\sqrt{85},\langle 27,6\rangle\)
For the following exercises, find the gradient.
\(c(x,t)=e{(t-x)}^{2}+3\,\text{cos}(t)\)
\(f(x,y)=\frac{\sqrt{x}+{y}^{2}}{xy}\)
\(∇f(x,y)=-\frac{\sqrt{x}+2{y}^{2}}{2{x}^{2}y}\text{i}+(\frac{1}{x}-\frac{1}{\sqrt{x}{y}^{2}})\text{j}\)
For the following exercises, find and classify the critical points.
\(z={x}^{3}-xy+{y}^{2}-1\)
For the following exercises, use Lagrange multipliers to find the maximum and minimum values for the functions with the given constraints.
\(f(x,y)={x}^{2}y,{x}^{2}+{y}^{2}=4\)
maximum: \(\frac{16}{3\sqrt{3}},\) minimum: \(-\frac{16}{3\sqrt{3}}\)
\(f(x,y)={x}^{2}-{y}^{2},x+6y=4\)
A machinist is constructing a right circular cone out of a block of aluminum. The machine gives an error of \(5\text{\%}\) in height and \(2\text{\%}\) in radius. Find the maximum error in the volume of the cone if the machinist creates a cone of height \(6\) cm and radius \(2\) cm.
\(2.3228\) cm3
A trash compactor is in the shape of a cuboid. Assume the trash compactor is filled with incompressible liquid. The length and width are decreasing at rates of \(2\) ft/sec and \(3\) ft/sec, respectively. Find the rate at which the liquid level is rising when the length is \(14\) ft, the width is \(10\) ft, and the height is \(4\) ft.
Glossary
- constraint
- an inequality or equation involving one or more variables that is used in an optimization problem; the constraint enforces a limit on the possible solutions for the problem
- Lagrange multiplier
- the constant (or constants) used in the method of Lagrange multipliers; in the case of one constant, it is represented by the variable \(λ\)
- method of Lagrange multipliers
- a method of solving an optimization problem subject to one or more constraints
- objective function
- the function that is to be maximized or minimized in an optimization problem
- optimization problem
- calculation of a maximum or minimum value of a function of several variables, often using Lagrange multipliers