Skip to main content

Section 14.8 Lagrange Multipliers: Optimizing with a Constraint

In previous sections, we learned how to find the local and absolute extrema of a function over its domain or on a closed region. However, in many real-world applications, we are often restricted by specific conditions.
This section introduces the method of Lagrange multipliers, a powerful geometric strategy for finding the extrema of a function \(f\) subject to one or more constraint equations \(g = 0\text{.}\) Instead of substituting the constraint into the objective function (which can be algebraically messy), we look for points where the gradients of these functions align.
In life, we usually don’t just optimize a function within its domain. It always comes with some constraints. To maximize and/or minimize a function subject to some constraints, we can use the method of Lagrange multipliers.
Let’s start with a simple example. Imagine we have a surface \(f(x,y) = x^2 + y^2 - 2x + 2y + 5\text{.}\) Instead of looking at the entire surface, we only want to look at the points \((x,y,f(x,y))\) where \((x,y)\) satisfies some constraint, say \(x^2 + y^2 = 4\text{.}\) The diagram below demonstrate this situation.
Figure 14.8.1. Objective Function \(f(x,y) = x^2 + y^2 - 2x + 2y + 5\) with Constraint \(x^2 + y^2 = 4\)
The question here is: What are the maximum and minimum values of \(f(x,y)\) subject to the constraint \(x^2 + y^2 = 4\text{?}\)
As the above diagram shows, we can find a level curve of \(f\) that is tangent to the constraint curve. At the point of tangency, the level curve and the constraint curve will have the same tangent line, and thus the same normal vector. Since the gradient is normal to the curve, the gradient of the level curve and the gradient of the constraint curve will be parallel at the point of tangency. That is, there exists a scalar \(\lambda\) such that
\begin{equation*} \nabla f_P = \lambda \nabla g_P \end{equation*}
where \(P\) is the point of tangency, and \(g(x,y) = x^2 + 4y^2 - 4 = 0\) is the constraint function. It is clearer to see this relationship in the diagram below
Figure 14.8.2. \(\nabla f_P\) and \(\nabla g_P\) are parallel at the point of tangency \(P\text{.}\)
This is essentially the idea of Lagrange multipliers (the \(\lambda\) is called the Lagrange Multiplier). If we can find the point(s) \(P\) such that \(\nabla f_P = \lambda \nabla g_P\) for some scalar \(\lambda\text{,}\) then we can find the maximum and minimum values of \(f\) subject to the constraint \(g(x,y) = 0\text{.}\)

Note 14.8.4. But Richard... How do we guarantee that the point(s) we find using Lagrange multipliers are actually the maximum and minimum values?

Imagine we want to maximize or minimize the function value of the objective function \(f\) on the constraint curve \(g(x,y) = 0\text{.}\) If the level curve is still intersecting the constraint curve at two (or more) points, then we can keep moving towards the direction of the gradient (or the opposite direction) since the gradient always points to the maximum rate of increase. To some point, you can find the level curve that is tangent to the constraint curve.
At this point, we can no longer move in the direction of the gradient, since it will take us out of the constraint curve, which means the function value at this point will either maximize or minimize the function value on the constraint curve, depending on which direction we were moving towards.
The diagram below demonstrates this idea.
Figure 14.8.5.
Observing the diagram, we can see that the two gradients are parallel at the point of tangency, which is the point we find using Lagrange multipliers.

Example 14.8.6.

Find the maximum and minimum values of the objective function
\begin{equation*} f(x,y) = 2x^2 + y^2 + 2 \end{equation*}
where \(x\) and \(y\) lie on the ellipse given by
\begin{equation*} g(x,y) = x^2 + 4y^2 - 4 = 0\text{.} \end{equation*}
Hint.
Richard coded the graph of the surface and the constraint curve for you to visualize the whole situation.
Figure 14.8.7. Graph of the surface \(f(x,y) = 2x^2 + y^2 + 2\) with the constraint curve \(x^2 + 4y^2 = 4\)
Basically, rather than looking at the entire surface, we are only looking at the points on the surface that are also on the constraint curve (the one colored blue on the figure above).
To even help you visualize it better, Richard included a diagram with the level curves of the surface and the constraint curve on the \(xy\)-plane below.
Figure 14.8.8.
Basically our task is to find the point(s) of tangency between the level curves and the constraint curve, and then evaluate the objective function at those point(s) to find the maximum and minimum values.
Solution.
We begin by finding the gradients of both our objective function \(f\) and our constraint function \(g\text{:}\)
\begin{align*} \nabla f(x,y) \amp = \langle 4x, 2y \rangle \\ \nabla g(x,y) \amp = \langle 2x, 8y \rangle \end{align*}
By the method of Lagrange multipliers, we set \(\nabla f = \lambda \nabla g\text{,}\) which gives us a system of equations. Don’t forget to include the constraint itself as the final equation!
\begin{align*} 4x \amp = \lambda (2x) \\ 2y \amp = \lambda (8y) \\ x^2 + 4y^2 \amp = 4 \end{align*}
Let’s solve this system. From the first equation,
\begin{equation*} 4x - 2\lambda x = 0 \qquad \implies \qquad 2x(2 - \lambda) = 0 \end{equation*}
This gives us two cases: either \(x = 0\) or \(\lambda = 2\text{.}\)
Case 1: If \(x = 0\text{,}\) we plug this into the constraint equation
\begin{align*} 0^2 + 4y^2 \amp = 4 \\ y^2 \amp = 1 \\ y \amp= \pm 1 \end{align*}
This yields two points: \((0,1)\) and \((0,-1)\text{.}\)
Case 2: If \(\lambda = 2\text{,}\) we plug this into the second equation
\begin{align*} 2y \amp = 2(8y) \\ 2y \amp = 16y \\ 14y \amp= 0 \\ y \amp= 0 \end{align*}
Now we plug \(y = 0\) into the constraint equation
\begin{align*} x^2 + 4(0)^2 \amp = 4 \\ x^2 \amp = 4 \\ x \amp= \pm 2 \end{align*}
This yields two more points: \((2,0)\) and \((-2,0)\text{.}\)
Finally, we evaluate the objective function \(f(x,y)\) at these four points to determine the absolute maximum and minimum values.
\begin{align*} f(0,1) \amp = 2(0)^2 + (1)^2 + 2 = 3 \\ f(0,-1) \amp = 2(0)^2 + (-1)^2 + 2 = 3 \\ f(2,0) \amp = 2(2)^2 + (0)^2 + 2 = 10 \\ f(-2,0) \amp = 2(-2)^2 + (0)^2 + 2 = 10 \end{align*}
The maximum value is 10 (occurring at \((\pm 2,0)\)), and the minimum value is 3 (occurring at \((0,\pm 1)\)).
The idea of the Lagrange multiplier can be extended to functions of more than two variables. The only adjustment we need to make is to replace the constraint curve with a constraint surface and the gradients will have three components instead of two.

Example 14.8.9.

Find the least distance between the point \(P(3,4,0)\) and the surface of the cone \(z^2 = x^2 + y^2\text{.}\)
Figure 14.8.10.
Hint.
Richard will help out with the setup here! Since we want to minimize the distance between \(P\) and a point on the cone, then we can define our objective function as
\begin{equation*} d(x,y,z) = \sqrt{(x - 3)^2 + (y - 4)^2 + z^2} \end{equation*}
Or even better, we can minimize the square of the distance to avoid the square root, as follows
\begin{equation*} f(x,y,z) = (x - 3)^2 + (y - 4)^2 + z^2 \end{equation*}
The constraint here is that the point must be lying on the cone, so the constraint is
\begin{equation*} g(x,y,z) = z^2 - x^2 - y^2 = 0 \end{equation*}
Now have fun with the rest of the process!
Solution.
Using the setup from the hint, we find the gradients for our squared distance objective function and the cone constraint function
\begin{align*} \nabla f \amp = \langle 2(x - 3), 2(y - 4), 2z \rangle \\ \nabla g \amp = \langle -2x, -2y, 2z \rangle \end{align*}
Setting \(\nabla f = \lambda \nabla g\text{,}\) we build our system of equations
\begin{align*} 2(x - 3) \amp = -2\lambda x \\ 2(y - 4) \amp = -2\lambda y \\ 2z \amp = 2\lambda z \\ z^2 - x^2 - y^2 \amp = 0 \end{align*}
Observing the third equation
\begin{equation*} 2z - 2\lambda z = 0 \qquad \implies \qquad 2z(1 - \lambda) = 0 \end{equation*}
This implies either \(z = 0\) or \(\lambda = 1\text{.}\)
If we let \(z = 0\text{,}\) our constraint equation becomes \(0^2 - x^2 - y^2 = 0 \implies x^2 + y^2 = 0\text{.}\) The only way this is true is if \(x = 0\) and \(y = 0\text{.}\) However, plugging \(x = 0\) into our first equation yields \(2(0 - 3) = 0 \implies -6 = 0\text{,}\) which is a contradiction. So, \(z \neq 0\text{.}\)
Therefore, it must be true that \(\lambda = 1\text{.}\) We plug \(\lambda = 1\) into our first two equations
\begin{align*} 2(x - 3) \amp = -2(1)x \implies 2x - 6 = -2x \implies 4x = 6 \implies x = \frac{3}{2} \\ 2(y - 4) \amp = -2(1)y \implies 2y - 8 = -2y \implies 4y = 8 \implies y = 2 \end{align*}
Now we plug \(x\) and \(y\) into the constraint to solve for \(z^2\) (note that we only need \(z^2\) to plug back into our objective function)
\begin{gather*} z^2 = x^2 + y^2 = \left(\frac{3}{2}\right)^2 + (2)^2 = \frac{9}{4} + 4 = \frac{25}{4} \end{gather*}
We have found the point that minimizes the squared distance. Plugging these into our objective function \(f\)
\begin{align*} f\left(\frac{3}{2}, 2, z\right) \amp = \left(\frac{3}{2} - 3\right)^2 + (2 - 4)^2 + \frac{25}{4} \\ \amp = \left(-\frac{3}{2}\right)^2 + (-2)^2 + \frac{25}{4} \\ \amp = \frac{9}{4} + 4 + \frac{25}{4} = \frac{34}{4} + \frac{16}{4} = \frac{50}{4} = \frac{25}{2} \end{align*}
Since \(f\) is the squared distance, the actual minimum distance is \(\ds d = \sqrt{\frac{25}{2}} = \frac{5}{\sqrt{2}} = \frac{5\sqrt{2}}{2}\text{.}\)
In addition, the Lagrange multiplier method can also be extended to optimize a function subject to multiple constraints. We will just need to make sure to add up the contributions from all the constraints. For example, if we want to optimize \(f(x,y,z)\) subject to two constraints \(g(x,y,z) = 0\) and \(h(x,y,z) = 0\text{,}\) then we need to find the points \(P\) such that
\begin{equation*} \nabla f_P = \lambda \nabla g_P + \mu \nabla h_P \end{equation*}
where \(\lambda\) and \(\mu\) are the Lagrange multipliers for the two constraints, respectively.

Example 14.8.11.

Find the maximum value of the function \(f(x,y,z) = x + 2y + 3z\) on the curve of intersection of the plane \(x - y + z = 1\) and the cylinder \(x^2 + y^2 = 1\text{.}\)
Solution.
We have one objective function and two constraints. Let \(g(x,y,z) = x - y + z - 1 = 0\) and \(h(x,y,z) = x^2 + y^2 - 1 = 0\text{.}\) We need to find the gradients for all three:
\begin{align*} \nabla f \amp = \langle 1, 2, 3 \rangle \\ \nabla g \amp = \langle 1, -1, 1 \rangle \\ \nabla h \amp = \langle 2x, 2y, 0 \rangle \end{align*}
Setting up the Lagrange multiplier equation with two constraints, \(\nabla f = \lambda \nabla g + \mu \nabla h\text{,}\) we get:
\begin{align*} 1 \amp = \lambda(1) + \mu(2x) \\ 2 \amp = \lambda(-1) + \mu(2y) \\ 3 \amp = \lambda(1) + \mu(0) \\ x - y + z \amp = 1 \\ x^2 + y^2 \amp = 1 \end{align*}
From the third equation, we immediately get \(\lambda = 3\text{.}\)
We can plug \(\lambda = 3\) into the first two equations to solve for \(x\) and \(y\) in terms of \(\mu\)
\begin{gather*} 1 = 3 + 2\mu x \implies -2 = 2\mu x \implies x = -\frac{1}{\mu} \\ 2 = -3 + 2\mu y \implies 5 = 2\mu y \implies y = \frac{5}{2\mu} \end{gather*}
Now, substitute these expressions for \(x\) and \(y\) into the second constraint equation (\(x^2 + y^2 = 1\))
\begin{align*} \left(-\frac{1}{\mu}\right)^2 + \left(\frac{5}{2\mu}\right)^2 \amp = 1 \\ \frac{1}{\mu^2} + \frac{25}{4\mu^2} \amp = 1 \\ \frac{4}{4\mu^2} + \frac{25}{4\mu^2} \amp = 1 \implies \frac{29}{4\mu^2} = 1 \implies 4\mu^2 = 29 \implies \mu = \pm\frac{\sqrt{29}}{2} \end{align*}
Since we are looking for the maximum value, let’s explore both cases for \(\mu\text{.}\)
Case 1: \(\mu = \frac{\sqrt{29}}{2}\) Substituting this back into our equations for \(x\) and \(y\)
\begin{align*} x \amp = \frac{-1}{\frac{\sqrt{29}}{2}} = -\frac{2}{\sqrt{29}} \\ y \amp = \frac{5}{2\left(\frac{\sqrt{29}}{2}\right)} = \frac{5}{\sqrt{29}} \end{align*}
Using the first constraint \(x - y + z = 1\) to find \(z\)
\begin{gather*} z = 1 - x + y = 1 - \left(-\frac{2}{\sqrt{29}}\right) + \frac{5}{\sqrt{29}} = 1 + \frac{7}{\sqrt{29}} \end{gather*}
Evaluating the objective function \(f = x + 2y + 3z\) at this point
\begin{align*} f \amp = -\frac{2}{\sqrt{29}} + 2\left(\frac{5}{\sqrt{29}}\right) + 3\left(1 + \frac{7}{\sqrt{29}}\right) \\ \amp = -\frac{2}{\sqrt{29}} + \frac{10}{\sqrt{29}} + 3 + \frac{21}{\sqrt{29}} = 3 + \frac{29}{\sqrt{29}} = 3 + \sqrt{29} \end{align*}
Case 2: \(\mu = -\frac{\sqrt{29}}{2}\) Similarly, we find \(x = \frac{2}{\sqrt{29}}\) and \(y = -\frac{5}{\sqrt{29}}\text{.}\) The \(z\) value is \(z = 1 - \frac{2}{\sqrt{29}} - \frac{5}{\sqrt{29}} = 1 - \frac{7}{\sqrt{29}}\text{.}\) Evaluating the objective function \(f\) at this point
\begin{align*} f \amp = \frac{2}{\sqrt{29}} + 2\left(-\frac{5}{\sqrt{29}}\right) + 3\left(1 - \frac{7}{\sqrt{29}}\right) \\ \amp = \frac{2}{\sqrt{29}} - \frac{10}{\sqrt{29}} + 3 - \frac{21}{\sqrt{29}} = 3 - \frac{29}{\sqrt{29}} = 3 - \sqrt{29} \end{align*}
Comparing the two results, the maximum value is \(3 + \sqrt{29}\text{.}\)

Worksheet Assigned Problems for Section 14.8

The problems listed below are assigned to be included in your problem set portfolio. Note that a specific selection of these problems will also form the written homework assignments. I recommend working through all of them to ensure a solid grasp of the material. Reach out to Richard for help if you get stuck or have any questions.
The solutions will be posted after the written homework due dates. If you have any questions about your work, talk to Richard and he is happy to discuss the process with you.

14.8.1.

Find the extreme values of the function \(f(x,y) = 2x + 4y\) subject to the constraint \(g(x,y) = x^2 + y^2 - 5 = 0\) following the following steps:
  1. Show that the Lagrange equation \(\nabla f = \lambda \nabla g\) gives \(\lambda x = 1\) and \(\lambda y = 2\text{.}\)
  2. Show that these equations imply \(\lambda \neq 0\) and \(y = 2x\text{.}\)
  3. Use the constraint equation to determine the possible critical points \((x,y)\text{.}\)
  4. Evaluate \(f(x,y)\) at the critical points and determine the minimum and maximum values.
Solution.
  1. We are given the objective function \(f(x,y) = 2x + 4y\) and the constraint \(g(x,y) = x^2 + y^2 - 5 = 0\text{.}\) Taking the gradients, we get:
    \begin{align*} \nabla f \amp = \langle 2, 4 \rangle \\ \nabla g \amp = \langle 2x, 2y \rangle \end{align*}
    Setting \(\nabla f = \lambda \nabla g\) gives us the system:
    \begin{align*} 2 \amp = \lambda (2x) \implies 1 = \lambda x \\ 4 \amp = \lambda (2y) \implies 2 = \lambda y \end{align*}
  2. If \(\lambda = 0\text{,}\) the first equation becomes \(1 = 0\text{,}\) which is a contradiction. Therefore, \(\lambda \neq 0\text{.}\) Since \(\lambda \neq 0\text{,}\) we can solve for \(x\) and \(y\) in terms of \(\lambda\text{:}\)
    \begin{align*} x \amp = \frac{1}{\lambda} \\ y \amp = \frac{2}{\lambda} \end{align*}
    Notice that \(y = \frac{2}{\lambda} = 2\left(\frac{1}{\lambda}\right) = 2x\text{.}\) Thus, \(y = 2x\text{.}\)
  3. Substitute \(y = 2x\) into the constraint equation \(x^2 + y^2 = 5\text{:}\)
    \begin{align*} x^2 + (2x)^2 \amp = 5 \\ x^2 + 4x^2 \amp = 5 \\ 5x^2 \amp = 5 \implies x^2 = 1 \implies x = \pm 1 \end{align*}
    When \(x = 1\text{,}\) \(y = 2(1) = 2\text{.}\) When \(x = -1\text{,}\) \(y = 2(-1) = -2\text{.}\) Our critical points are \((1,2)\) and \((-1,-2)\text{.}\)
  4. Finally, evaluate \(f(x,y) = 2x + 4y\) at the critical points:
    \begin{align*} f(1,2) \amp = 2(1) + 4(2) = 10 \\ f(-1,-2) \amp = 2(-1) + 4(-2) = -10 \end{align*}
    The maximum value is \(10\) at \((1,2)\text{,}\) and the minimum value is \(-10\) at \((-1,-2)\text{.}\)

Exercise Group.

In the following exercises, find the minimum and maximum values of the function subject to the given constraints.
14.8.7.
\(f(x,y) = xy \, , \qquad 4x^2 + 9y^2 = 32\)
Solution.
Let \(f(x,y) = xy\) and the constraint \(g(x,y) = 4x^2 + 9y^2 - 32 = 0\text{.}\) Using Lagrange multipliers, \(\nabla f = \lambda \nabla g\text{:}\)
\begin{align*} y \amp = \lambda(8x) \\ x \amp = \lambda(18y) \\ 4x^2 + 9y^2 \amp = 32 \end{align*}
Multiply the first equation by \(y\) and the second by \(x\text{:}\)
\begin{align*} y^2 \amp = 8\lambda xy \\ x^2 \amp = 18\lambda xy \end{align*}
If \(\lambda = 0\text{,}\) then \(x = 0\) and \(y = 0\text{,}\) which does not satisfy the constraint \(4(0)^2 + 9(0)^2 = 32\text{.}\) Thus, \(\lambda \neq 0\) and \(xy \neq 0\text{.}\) We can divide the modified equations to get:
\begin{align*} 8\lambda xy \cdot x^2 \amp = 18\lambda xy \cdot y^2 \implies 8x^2 = 18y^2 \implies 4x^2 = 9y^2 \end{align*}
Substitute \(4x^2 = 9y^2\) into the constraint equation:
\begin{align*} 9y^2 + 9y^2 \amp = 32 \\ 18y^2 \amp = 32 \implies y^2 = \frac{16}{9} \implies y = \pm \frac{4}{3} \end{align*}
Now solve for \(x\text{:}\)
\begin{gather*} 4x^2 = 9\left(\frac{16}{9}\right) = 16 \implies x^2 = 4 \implies x = \pm 2 \end{gather*}
We have four critical points to check: \(\left(2, \frac{4}{3}\right)\text{,}\) \(\left(2, -\frac{4}{3}\right)\text{,}\) \(\left(-2, \frac{4}{3}\right)\text{,}\) and \(\left(-2, -\frac{4}{3}\right)\text{.}\) Evaluating \(f(x,y) = xy\text{:}\)
\begin{align*} f\left(2, \frac{4}{3}\right) \amp = \frac{8}{3} \amp f\left(-2, -\frac{4}{3}\right) \amp = \frac{8}{3} \\ f\left(2, -\frac{4}{3}\right) \amp = -\frac{8}{3} \amp f\left(-2, \frac{4}{3}\right) \amp = -\frac{8}{3} \end{align*}
The maximum value is \(\frac{8}{3}\) and the minimum value is \(-\frac{8}{3}\text{.}\)
14.8.13.
\(f(x,y,z) = xy + 2z\, , \qquad x^2 + y^2 + z^2 = 36\)
Solution.
Let \(g(x,y,z) = x^2 + y^2 + z^2 - 36 = 0\text{.}\) The Lagrange equations \(\nabla f = \lambda \nabla g\) yield:
\begin{align*} y \amp = 2\lambda x \\ x \amp = 2\lambda y \\ 2 \amp = 2\lambda z \implies 1 = \lambda z \\ x^2 + y^2 + z^2 \amp = 36 \end{align*}
Substitute the second equation into the first:
\begin{gather*} y = 2\lambda(2\lambda y) \implies y = 4\lambda^2 y \implies y(1 - 4\lambda^2) = 0 \end{gather*}
This gives us two cases: either \(y = 0\) or \(4\lambda^2 = 1\text{.}\)
Case 1: \(y = 0\text{.}\) If \(y = 0\text{,}\) then \(x = 2\lambda(0) = 0\text{.}\) Substituting \(x=0\) and \(y=0\) into the constraint gives:
\begin{align*} 0^2 + 0^2 + z^2 \amp = 36 \implies z = \pm 6 \end{align*}
This gives the points \((0,0,6)\) and \((0,0,-6)\text{.}\)
Case 2: \(4\lambda^2 = 1 \implies \lambda = \pm \frac{1}{2}\text{.}\) If \(\lambda = \frac{1}{2}\text{,}\) then \(y = x\) and from the third equation, \(z = \frac{1}{1/2} = 2\text{.}\) Substituting these into the constraint:
\begin{align*} x^2 + x^2 + 2^2 \amp = 36 \implies 2x^2 = 32 \implies x^2 = 16 \implies x = \pm 4 \end{align*}
This gives the points \((4,4,2)\) and \((-4,-4,2)\text{.}\)
If \(\lambda = -\frac{1}{2}\text{,}\) then \(y = -x\) and \(z = \frac{1}{-1/2} = -2\text{.}\) Substituting into the constraint:
\begin{align*} x^2 + (-x)^2 + (-2)^2 \amp = 36 \implies 2x^2 = 32 \implies x = \pm 4 \end{align*}
This gives the points \((4,-4,-2)\) and \((-4,4,-2)\text{.}\)
Now evaluate \(f(x,y,z) = xy + 2z\) at all these points:
\begin{align*} f(0,0,6) \amp = 0 + 12 = 12 \\ f(0,0,-6) \amp = 0 - 12 = -12 \\ f(4,4,2) \amp = 16 + 4 = 20 \\ f(-4,-4,2) \amp = 16 + 4 = 20 \\ f(4,-4,-2) \amp = -16 - 4 = -20 \\ f(-4,4,-2) \amp = -16 - 4 = -20 \end{align*}
The absolute maximum is \(20\) and the absolute minimum is \(-20\text{.}\)

14.8.19.

The surface area of a right-circular cone of radius \(r\) and height \(h\) is
\begin{equation*} S = \pi r\sqrt{r^2 + h^2} \end{equation*}
and its volume is
\begin{equation*} V = \frac{1}{3}\pi r^2h \end{equation*}
  1. Determine the ratio \(h/r\) for the cone with given surface area \(S\) and maximum volume \(V\text{.}\)
  2. What is the ratio \(h/r\) for a cone with given volume \(V\) and minimum surface area \(S\text{?}\)
  3. Does a cone with given volume \(V\) and maximum surface area \(S\) exist?
Solution.
Before we begin, note that we can use Lagrange multipliers by finding the gradients of \(V\) and \(S\) with respect to \(r\) and \(h\text{:}\)
\begin{align*} \nabla V \amp = \left\langle \frac{2}{3}\pi rh, \frac{1}{3}\pi r^2 \right\rangle \\ \nabla S \amp = \left\langle \pi\sqrt{r^2+h^2} + \frac{\pi r^2}{\sqrt{r^2+h^2}}, \frac{\pi rh}{\sqrt{r^2+h^2}} \right\rangle = \left\langle \pi\frac{2r^2+h^2}{\sqrt{r^2+h^2}}, \frac{\pi rh}{\sqrt{r^2+h^2}} \right\rangle \end{align*}
  1. To maximize \(V\) given \(S\text{,}\) we set \(\nabla V = \lambda \nabla S\text{:}\)
    \begin{align*} \frac{2}{3}\pi rh \amp = \lambda \pi\frac{2r^2+h^2}{\sqrt{r^2+h^2}} \\ \frac{1}{3}\pi r^2 \amp = \lambda \frac{\pi rh}{\sqrt{r^2+h^2}} \end{align*}
    Assuming \(r, h \neq 0\text{,}\) we can isolate \(\lambda\) in both equations and set them equal, or simply divide the first equation by the second:
    \begin{align*} \frac{\frac{2}{3}\pi rh}{\frac{1}{3}\pi r^2} \amp = \frac{\lambda \pi\frac{2r^2+h^2}{\sqrt{r^2+h^2}}}{\lambda \frac{\pi rh}{\sqrt{r^2+h^2}}} \\ \frac{2h}{r} \amp = \frac{2r^2+h^2}{rh} \end{align*}
    Cross-multiply to get:
    \begin{align*} 2h^2r \amp = r(2r^2+h^2) \\ 2h^2 \amp = 2r^2+h^2 \implies h^2 = 2r^2 \implies \frac{h^2}{r^2} = 2 \implies \frac{h}{r} = \sqrt{2} \end{align*}
  2. To minimize \(S\) given \(V\text{,}\) the Lagrange condition is \(\nabla S = \mu \nabla V\text{.}\) Because the vectors must still be parallel, the proportion between the components must be exactly the same as in part (a). Therefore, the algebra will lead to the exact same geometric ratio: \(\frac{h}{r} = \sqrt{2}\text{.}\)
  3. No, such a cone does not exist. If \(V\) is constant, \(h = \frac{3V}{\pi r^2}\text{.}\) Substitute this into the surface area formula:
    \begin{align*} S \amp = \pi r \sqrt{r^2 + \left(\frac{3V}{\pi r^2}\right)^2} = \sqrt{\pi^2 r^4 + \frac{9V^2}{r^2}} \end{align*}
    If we stretch the cone to be infinitely wide and flat (\(r \to \infty\)), the surface area \(S \to \infty\text{.}\) Thus, there is no maximum surface area for a given volume.

14.8.23.

Find the point \((x_0, y_0)\) on the line \(4x + 9y = 12\) that is closest to the origin.
Solution.
We want to minimize the distance to the origin, which is \(d = \sqrt{x^2+y^2}\text{.}\) To make the calculus easier, we will instead minimize the square of the distance, \(f(x,y) = x^2+y^2\text{,}\) subject to the constraint \(g(x,y) = 4x + 9y - 12 = 0\text{.}\)
Using Lagrange multipliers, \(\nabla f = \lambda \nabla g\text{:}\)
\begin{align*} 2x \amp = \lambda(4) \implies x = 2\lambda \\ 2y \amp = \lambda(9) \implies y = \frac{9}{2}\lambda = 4.5\lambda \end{align*}
Substitute these into the constraint equation:
\begin{align*} 4(2\lambda) + 9(4.5\lambda) \amp = 12 \\ 8\lambda + 40.5\lambda \amp = 12 \\ 48.5\lambda \amp = 12 \implies \lambda = \frac{12}{48.5} = \frac{24}{97} \end{align*}
Now plug \(\lambda\) back in to find \(x_0\) and \(y_0\text{:}\)
\begin{align*} x_0 \amp = 2\left(\frac{24}{97}\right) = \frac{48}{97} \\ y_0 \amp = \frac{9}{2}\left(\frac{24}{97}\right) = \frac{108}{97} \end{align*}
The closest point is \(\left(\frac{48}{97}, \frac{108}{97}\right)\text{.}\)

14.8.29.

Show that the minimum distance from the origin to a point on the plane \(ax + by + cz = d\) is
\begin{equation*} \frac{|d|}{\sqrt{a^2 + b^2 + c^2}} \end{equation*}
Solution.
Similar to the previous problem, we minimize the square of the distance, \(f(x,y,z) = x^2+y^2+z^2\text{,}\) subject to the plane constraint \(g(x,y,z) = ax + by + cz - d = 0\text{.}\)
Set up the Lagrange equations \(\nabla f = \lambda \nabla g\text{:}\)
\begin{align*} 2x \amp = a\lambda \implies x = \frac{a\lambda}{2} \\ 2y \amp = b\lambda \implies y = \frac{b\lambda}{2} \\ 2z \amp = c\lambda \implies z = \frac{c\lambda}{2} \end{align*}
Substitute these into the constraint equation:
\begin{align*} a\left(\frac{a\lambda}{2}\right) + b\left(\frac{b\lambda}{2}\right) + c\left(\frac{c\lambda}{2}\right) \amp = d \\ \frac{\lambda}{2}(a^2 + b^2 + c^2) \amp = d \implies \lambda = \frac{2d}{a^2+b^2+c^2} \end{align*}
Now substitute \(\lambda\) back to find the coordinates:
\begin{align*} x \amp = \frac{a}{2}\left(\frac{2d}{a^2+b^2+c^2}\right) = \frac{ad}{a^2+b^2+c^2} \\ y \amp = \frac{b}{2}\left(\frac{2d}{a^2+b^2+c^2}\right) = \frac{bd}{a^2+b^2+c^2} \\ z \amp = \frac{c}{2}\left(\frac{2d}{a^2+b^2+c^2}\right) = \frac{cd}{a^2+b^2+c^2} \end{align*}
Finally, calculate the minimum distance \(D = \sqrt{x^2+y^2+z^2}\text{:}\)
\begin{align*} D \amp = \sqrt{\left(\frac{ad}{a^2+b^2+c^2}\right)^2 + \left(\frac{bd}{a^2+b^2+c^2}\right)^2 + \left(\frac{cd}{a^2+b^2+c^2}\right)^2} \\ \amp = \sqrt{\frac{a^2d^2 + b^2d^2 + c^2d^2}{(a^2+b^2+c^2)^2}} = \sqrt{\frac{d^2(a^2+b^2+c^2)}{(a^2+b^2+c^2)^2}} \\ \amp = \sqrt{\frac{d^2}{a^2+b^2+c^2}} = \frac{|d|}{\sqrt{a^2+b^2+c^2}} \end{align*}
This confirms the distance formula.

14.8.41.

Find the minimum of \(f(x,y,z) = x^2 + y^2 + z^2\) subject to the two constraints \(x + y + z = 1\) and \(x + 2y + 3z = 6\text{.}\)
Solution.
Here we have two constraints. Let \(g(x,y,z) = x + y + z - 1 = 0\) and \(h(x,y,z) = x + 2y + 3z - 6 = 0\text{.}\) Using \(\nabla f = \lambda \nabla g + \mu \nabla h\text{:}\)
\begin{align*} 2x \amp = \lambda(1) + \mu(1) \\ 2y \amp = \lambda(1) + \mu(2) \\ 2z \amp = \lambda(1) + \mu(3) \end{align*}
We can solve this by substituting these expressions into the two constraint equations. First, let’s look at the \(g\) constraint: \(x + y + z = 1 \implies 2x + 2y + 2z = 2\text{.}\) Substitute our gradient equations into this:
\begin{align*} (\lambda + \mu) + (\lambda + 2\mu) + (\lambda + 3\mu) \amp = 2 \\ 3\lambda + 6\mu \amp = 2 \qquad \text{(Equation A)} \end{align*}
Now for the \(h\) constraint: \(x + 2y + 3z = 6 \implies 2x + 4y + 6z = 12\text{.}\) Substitute our gradient equations:
\begin{align*} (\lambda + \mu) + 2(\lambda + 2\mu) + 3(\lambda + 3\mu) \amp = 12 \\ \lambda + \mu + 2\lambda + 4\mu + 3\lambda + 9\mu \amp = 12 \\ 6\lambda + 14\mu \amp = 12 \qquad \text{(Equation B)} \end{align*}
We now have a system of two variables. Multiply Equation A by 2:
\begin{align*} 6\lambda + 12\mu \amp = 4 \end{align*}
Subtract this from Equation B:
\begin{align*} (6\lambda + 14\mu) - (6\lambda + 12\mu) \amp = 12 - 4 \\ 2\mu \amp = 8 \implies \mu = 4 \end{align*}
Substitute \(\mu = 4\) back into Equation A to find \(\lambda\text{:}\)
\begin{align*} 3\lambda + 6(4) \amp = 2 \implies 3\lambda = -22 \implies \lambda = -\frac{22}{3} \end{align*}
Now we can find our coordinates:
\begin{gather*} 2x = -\frac{22}{3} + 4 = -\frac{10}{3} \implies x = -\frac{5}{3} \\ 2y = -\frac{22}{3} + 8 = \frac{2}{3} \implies y = \frac{1}{3} \\ 2z = -\frac{22}{3} + 12 = \frac{14}{3} \implies z = \frac{7}{3} \end{gather*}
Finally, plug this point into \(f(x,y,z)\) to find the minimum value:
\begin{align*} f\left(-\frac{5}{3}, \frac{1}{3}, \frac{7}{3}\right) \amp = \left(-\frac{5}{3}\right)^2 + \left(\frac{1}{3}\right)^2 + \left(\frac{7}{3}\right)^2 \\ \amp = \frac{25}{9} + \frac{1}{9} + \frac{49}{9} = \frac{75}{9} = \frac{25}{3} \end{align*}

14.8.45.

The cylinder \(x^2 + y^2 = 1\) intersects the plane \(x + z = 1\) in an ellipse. Find the point on such an ellipse that is farthest from the origin.
Solution.
We want to maximize the distance to the origin, which means maximizing \(f(x,y,z) = x^2+y^2+z^2\text{.}\) The constraints are \(g(x,y,z) = x^2+y^2 - 1 = 0\) and \(h(x,y,z) = x+z - 1 = 0\text{.}\)
Set up \(\nabla f = \lambda \nabla g + \mu \nabla h\text{:}\)
\begin{align*} 2x \amp = 2\lambda x + \mu \\ 2y \amp = 2\lambda y \\ 2z \amp = \mu \end{align*}
From the second equation, \(2y(1 - \lambda) = 0\text{,}\) so either \(y = 0\) or \(\lambda = 1\text{.}\)
Case 1: \(y = 0\text{.}\) Substitute this into the first constraint: \(x^2 + 0^2 = 1 \implies x = \pm 1\text{.}\) If \(x = 1\text{,}\) the second constraint gives \(1 + z = 1 \implies z = 0\text{.}\) This is point \((1, 0, 0)\text{.}\) If \(x = -1\text{,}\) the second constraint gives \(-1 + z = 1 \implies z = 2\text{.}\) This is point \((-1, 0, 2)\text{.}\)
Case 2: \(\lambda = 1\text{.}\) Substitute into the first equation: \(2x = 2(1)x + \mu \implies \mu = 0\text{.}\) If \(\mu = 0\text{,}\) the third equation gives \(2z = 0 \implies z = 0\text{.}\) Using the second constraint, \(x + 0 = 1 \implies x = 1\text{.}\) Using the first constraint, \(1^2 + y^2 = 1 \implies y = 0\text{.}\) We arrive at the point \((1,0,0)\) again.
Evaluating the distance squared for our two candidates:
\begin{align*} f(1,0,0) \amp = 1^2 + 0^2 + 0^2 = 1 \\ f(-1,0,2) \amp = (-1)^2 + 0^2 + 2^2 = 5 \end{align*}
The maximum distance squared is 5, so the farthest point from the origin is \((-1, 0, 2)\text{.}\)