**Problem of the Week**

**BUGCAT**

**Zassenhaus Conference**

**Hilton Memorial Lecture**

**BingAWM**

**Math Club**

**Actuarial Association**

You are here: Homepage » People » Graduate Students » John Brown » Courses » Calculus III » Chapter 14: Partial Derivatives » Chapter 14 - Section 8 - Lagrange Multipliers

people:grads:brown:brown_teaching:math323:chapter_14:section_8

← Chapter 14: Partial Derivatives

← Calculus III Discussion Links

← Chapter 14 - Section 7 - Maxima and Minima

**Section Overview**

In this section we learn how to use the Lagrange Technique to locate extreme (maximum or minimum) values of a multivariable function subject to some constraints. As we shall see, the technique outlined is extremely similar to the method we used in Calculus I to locate extreme values of a single variable function on an interval. We will describe the technique three times, once for a three-variable function with one constraint, once for a three-variable function with two constraints, and finally for the case of an $n$-variable function with $m$ constraints. We will assume throughout that our objective function is differentiable and our constraints have non-zero gradient, except for a couple examples in which we will discuss how and why the technique may fail when a constraint gradient is the zero vector.

Let $ w = f(x,y,z) $ denote our objective function and $ g(x,y,z) = k $ our constraint; that is, we seek for the extreme values attained by the function $ f $ on the level surface $ g = k $. Suppose $ f $ does have an extreme value at a point $ P = (x_0,y_0,z_0) $ on the surface $ g = k $. Let $ C $ be a curve with differentiable parametrization $ \mathbf{r}(t) $ that lies on the surface $ g = k $ and passes through the point $ P $. Let $ t_0 $ denote the parameter value corresponding to the point $ P $, so $ \mathbf{r}(t_0) = \langle x_0 , y_0 , z_0 \rangle $, and let $ h(t) = f \circ \mathbf{r}(t) $. Now $ h $ has an extreme value at $ t_0 $, so it has a critical point there. Since $ f $ is differentiable at $ P $ and $ \mathbf{r} $ is differentiable, it follows that the composition $ h $ is differentiable at $ t_0 $, and so the critical point $ t_0 $ is a root of the derivative. Hence, by the chain rule we have

$$ \begin{aligned} 0 &= h^{'}(t_0) \\ &= \frac{\partial f}{\partial x} (x_0,y_0,z_0) \frac{dx}{dt} (t_0) + \frac{\partial f}{\partial y} (x_0,y_0,z_0) \frac{dy}{dt} (t_0) + \frac{\partial f}{\partial z} (x_0,y_0,z_0) \frac{dz}{dt} (t_0) \\ &= \nabla f(x_0,y_0,z_0) \cdot \mathbf{r}^{'}(t_0) \end{aligned} $$

Thus the gradient of $ f $ at the point $ P $ is orthogonal to the line tangent to the curve $ C $ at the point $ P $. Since this holds for all curves in the surface $ g = k $ through the point $ P $, it follows that the gradient of $ f $ at $ P $ is parallel to the direction of the plane tangent to the surface $ g = k $ at the point $ P $; in other words, at the point $ P $, if $ \nabla g \neq \mathbf{0} $ then $ \nabla f = \lambda \nabla g $ for some number $ \lambda $.

Let us recall the technique used in Calculus I to locate extreme values of a differentiable function $ y = f(x) $ on an open interval $ I $. If $ f $ has an extreme value at a point $ x_0 \in I $, then $ x_0 $ is a critical point of $ f $, and since we are assuming that $ f $ is differentiable on $ I $ we must have $ f^{'}(x_0) = 0 $. We use this result to develop our technique as follows. Assuming that $ f $ has extreme values on $ I $, we locate them in two steps:

- Solve $ f^{'} = 0 $
- Evaluate $ f $ at each solution $ c $ found in step 1.; largest value is the maximum, smallest is the minimum.

The Lagrange technique works in a very similar way; assuming extreme values exist, we first find critical points, then evaluate at each to determine the extreme values. There is a slight difference in our Lagrange technique though, in that it is not the critical points of $ f $ which we seek for but rather one which involves $ f $ together with our constraint $ g = k $. Let $ \lambda $ denote a fourth variable and set $ F = f - \lambda (g - k) $. Critical points of $ F $ are found by solving the vector equation $ \mathbf{0} = \nabla F $, which yields the following system of four equations with four unknowns:

$$ \begin{array}{ll} 0 = F_x = f_x - \lambda g_x \\ 0 = F_y = f_y - \lambda g_y \\ 0 = F_z = f_z - \lambda g_z \\ 0 = F_\lambda = g - k \end{array} $$

We see that the first three equations represent the vector equation $ \nabla f = \lambda \nabla g $ and the fourth equation is our constraint $ g = k $. From our discussion above, we can conclude that if $ f $ has an extreme value at a point $ P = (x_0,y_0,z_0) $ on the surface $ g=k $ and if $ \nabla g \neq \mathbf{0} $ at $ P $ then there exists a number $ \lambda_0 $ such that $ \nabla f = \lambda_0 \nabla g $ at $ P $ and so $ (x_0,y_0,z_0,\lambda_0) $ is a critical point of $ F $. Therefore, assuming that $ f $ has extreme values on the surface $ g=k $ and that the gradient of $ g $ is non-zero, we can find the extreme values in two steps:

- Solve $ \nabla \mathbf{F} = 0 $.
- Evaluate $ f $ at the projections in $ \mathbb{R}^3 $ of each solution found in step 1.; largest is maximum, smallest is minimum

Note that in step 1. above, we don't actually need the $ \lambda $ part of the solution. You may find it's values in the course of finding $ x,y, $ and $ z $, but more often it will just be used to help relate the important variables. The points found in step 1. are in four-space, but we need points in three space to evaluate $ f $; specifically, we need the $ x,y,z $ part. The projection referred to above works as follows:

$$ (x,y,z,\lambda) \rightarrow (x,y,z,0) \simeq (x,y,z) $$

In words, we replace our fourth coordinate with zero, then identify the point $ (x,y,z,0) $ in $ \mathbb{R}^4 $ with the point $ (x,y,z) $ in $ \mathbb{R}^3 $.

Exercise: Use the Lagrange technique to find the maximum and minimum values of the function $ f(x,y,z) = e^{xyz} $ on the ellipsoid $ 2x^2 + y^2 + z^2 = 24 $.

Solution: Set $ F = e^{xyz} - \lambda (2x^2 + y^2 + z^2 - 24) $. Then $ \mathbf{0} = \nabla F $ yields

$$ \begin{array}{ll} 0 = yze^{xyz} - 4x \lambda \\ 0 = xze^{xyz} - 2y \lambda \\ 0 = xye^{xyz} - 2z \lambda \\ 0 = 2x^2 + y^2 + z^2 - 24 \end{array} $$

Multiplying equation one by $ x $, equation two by $ y $, and equation three by $ z $, we see that $$ xyze^{xyz} = 4x^2 \lambda = 2y^2 \lambda = 2z^2 \lambda $$ First, suppose $ \lambda \neq 0 $. Then we have $ 2x^2 = y^2 = z^2 $, and so from equation four we have $ 24 = 6x^2 $ hence $ x = \pm 2 $ and $ y = z = \pm 2 \sqrt{2} $. Now, since we multiplied equation one by $ x $, we have to account for the possibility that we have multiplied by $ 0 $. However, in this case it is clear from equations two and three that if $ x = 0 $ then also $ y = z = 0 $, contradicting equation four as $ 0 \neq 24 $. Hence, $ x \neq 0 $, and similarly $ y,z \neq 0 $. Now, we've found eight points which could yield extreme values, but we observe that there are only actually two possibilities; because $ f(x,y,z) = e^{xyz} $, the four points with an even number of negative coordinates map to the maximum value of $ e^{16} $, while the four points with an odd number of negatives map to the minimum value of $ e^{-16} $. Now, suppose $ \lambda = 0 $. Then $ 0 = xy = xz = yz $, so at least two of $ x,y,z $ are $ 0 $, and our corresponding solutions are $ (\pm 4 \sqrt{3} , 0, 0) $, $ (0, \pm 2 \sqrt{6} , 0) $, and $ (0,0, \pm 2 \sqrt{6} ) $. At each point we have $ xyz = 0 $, so $ f = e^{0} = 1 $. Since $ e^{-16} < 1 < e^{16} $, we conclude that the maximum value of $ f $ on the given ellipsoid is $ e^{16} $ and it's minimum value is $ e^{-16} $.

Exercise: Find the maximum and minimum values attained by the function $ f(x,y,z) = x^4 + y^4 + z^4 $ on the unit sphere.

Solution: Since the unit sphere is the surface $ x^2 + y^2 + z^2 = 1 $ our auxiliary function is $ F(x,y,z,\lambda) = x^4 + y^4 + z^4 - \lambda (x^2 + y^2 + z^2 - 1) $, so the vector equation $ \mathbf{0} = \nabla F $ yeilds the system

$$ \begin{array}{ll} 0 = 4x^3 - 2x \lambda = 2x(2x^2 - \lambda) \\ 0 = 4y^3 - 2y \lambda = 2y(2y^2 - \lambda) \\ 0 = 4z^3 - 2z \lambda = 2z(2z^2 - \lambda) \\ 1 = x^2 + y^2 + z^2 \end{array} $$

Using a table to organize the possible cases we quickly locate the maximum value of $ 1 $ and the minimum value of $ \frac{1}{3} $:

$$ \begin{array}{|c|c|c|c|c|c|} \hline x & y & z & x^2 & y^2 & z^2 & f \\ \hline \neq 0 & \neq 0 & \neq 0 & \frac{1}{3} & \frac{1}{3} & \frac{1}{3} & \frac{1}{3} \\ \hline \neq 0 & \neq 0 & 0 & \frac{1}{2} & \frac{1}{2} & 0 & \frac{1}{2} \\ \hline \neq 0 & 0 & \neq 0 & \frac{1}{2} & 0 & \frac{1}{2} & \frac{1}{2} \\ \hline 0 & \neq 0 & \neq 0 & 0 & \frac{1}{2} & \frac{1}{2} & \frac{1}{2} \\ \hline \neq 0 & 0 & 0 & 1 & 0 & 0 & 1 \\ \hline 0 & \neq 0 & 0 & 0 & 1 & 0 & 1 \\ \hline 0 & 0 & \neq 0 & 0 & 0 & 1 & 1 \\ \hline \end{array} $$

Let $ f(x,y,z) $ be our objective function and $ g(x,y,z) = k $ and $ h(x,y,z) = \ell $ our two constraints. Let $$ F = f - \lambda (g - k) - \mu (h - \ell) $$ If $ f $ has an extreme value at a point $ (x_0,y_0,z_0) $ on the intersection of the level surfaces $ g=k $ and $ h=\ell $ and both $ \nabla g $ and $ \nabla h $ are non-zero, then there exist numbers $ \lambda_0 $ and $ \mu_0 $ such that $ (x_0,y_0,z_0,\lambda_0,\mu_0) $ is a critical point of $ F $. Thus, to find extreme values of $ f $ subject to the given constraints, we solve $ \mathbf{0} = \nabla F $ and check each point.

Exercise: Find the extreme values of $ z $ subject to the constraints $ x^2 + y^2 = z^2 $ and $ x + y + z = 24 $.

Solution: Set $ F = z - \lambda ( x^2 + y^2 - z^2) - \mu (x + y + z - 24) $ and solve the vector equation $ \mathbf{0} = \nabla F $. We get the system of equations

$$ \begin{array}{ll} 0 = 2x \lambda + \mu \\ 0 = 2y \lambda + \mu \\ 0 = 1 - 2z \lambda - \mu \\ z^2 = x^2 + y^2 \\ 24 = x + y + z \end{array} $$

We see if $ x = 0 $ then $ \mu = 0 $, so $ y = 0 $ or $ \lambda = 0 $. If $ y = 0 $ then $ z = 0 $ by equation four, so equation three is $ 0 = 1 $ a contradiction. If $ \lambda = 0 $ then again we have $ 0 = 1 $ for equation three, a contradiction. Hence, $ x \neq 0 $. Similarly, we find $ y,z, \lambda , \mu \neq 0 $. Now the first three equations give $ x = y = \frac{-\mu}{2 \lambda} $ and $ z = \frac{1- \mu}{2 \lambda} $. Substituting into equations four and five we have $ \frac{(1 - \mu)^2}{4 \lambda^2} = \frac{\mu^2}{2 \lambda^2} $ and $ 24 = \frac{1 - 3 \mu}{2 \lambda} $, from which we find two solutions $ \mu = -1 + \sqrt{2} $ and $ 2 \lambda = \frac{4 - 3 \sqrt{2}}{24} $ and $ \mu = -1 - \sqrt{2} $ and $ 2 \lambda = \frac{4 + 3 \sqrt{2}}{24} $ and so we have our minimum value $ z = -24(1 + \sqrt{2}) $ when $ \mu = -1 + \sqrt{2} $ and our maximum value $ z = 24(1 + \sqrt{2}) $ when $ \mu = -1 - \sqrt{2} $.

As usual we form an auxiliary function $ F $ with of objective and all constraints and seek for solutions to the vector equation $ \mathbf{0} = \nabla F $. Let $ x_1,x_2,\ldots,x_n $ denote the $n$-variables and $ g_1 = k_1, g_2 = k_2, \ldots, g_m = k_m $ the $ m $ constraints. Then we introduce $m$ variables $ \lambda_1,\lambda_2,\ldots,\lambda_m $ and set $$ F = f - \displaystyle \sum_{i=1}^m \lambda_i (g_i - k_i) $$

Exercise: Find the maximum and minimum values attained by summing the coordinates of a point on the unit $n$-sphere.

Solution: Our objective function is $ f(x_1,x_2,\ldots,x_n) = x_1 + x_2 + \ldots + x_n $ and our constraint is $ x_1^2 + x_2^2 + \ldots + x_n^2 = 1 $, so we have $ F = x_1 + x_2 + \ldots + x_n - \lambda ( x_1^2 + x_2^2 + \ldots + x_n^2 - 1 ) $. We see that for each $ 1 \leq i \leq n $, we have $ \frac{\partial F}{\partial x_i} = 1 - 2 \lambda x_i $, and so the vector equation $ \mathbf{0} = \nabla F $ yields $ x_i = \frac{1}{2 \lambda} $ for all $ i $. Hence, from our last equation we have $ 1 = n( \frac{1}{4 \lambda^2} ) $ or $ x_i = \frac{1}{2 \lambda} = \pm \frac{\sqrt{n}}{n} $. Thus, our maximum value is $ \sqrt{n} $, while our minimum value is $ - \sqrt{n} $.

people/grads/brown/brown_teaching/math323/chapter_14/section_8.txt · Last modified: 2020/03/19 16:15 by brown

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported

## Section 14.8 Discussion