Lagrange Multipliers

Procedure

Lagrange multipliers are a method used to optimize an objective function when the variables are constrained. Before, we used a constraint to reduce a function of three variables to one of two variables. Now, the function is given in terms of two variables, and xx and yy are limited.

Goal:

Maximize or minimize an objective function f(x,y)f(x,y).

Constraints:

g(x,y)=0g(x,y)=0

Procedure:

Let the objective function ff and the constraint function gg be differentiable on a region of R2\mathbb{R}^2 with g(x,y) = 0∇g(x,y)\ \cancel=\ 0⃗ on the curve g(x,y)=0g(x,y)=0.

  1. Find xx, yy, and λλ such that f(x,y)=λg(x,y)  and  g(x,y)=0.\nabla f (x,y) = \lambda \nabla g (x,y)\ \textrm{ and }\ g(x,y) = 0. These are the candidates for the maxima and minima.

  2. Select the points (x,y)(x,y) that give the max/min values for f(x,y)f(x,y).

Examples

Find the absolute maximum and minimum for f(x,y)=2x2+y2+2f(x,y)=2x^2+y^2+2 subject to g(x,y)=x2+4y24=0g(x,y)=x^2+4y^2-4=0.

Solution

f(x,y)=4xı^+2yȷ^g(x,y)=2xı^+8yȷ^\begin{aligned} \nabla f (x,y) &= 4x \hat{\imath} + 2y \hat{\jmath}\ \ \nabla g (x,y) &= 2x \hat{\imath} + 8y \hat{\jmath} \end{aligned}

Set up the equality: f(x,y)=λg(x,y)4x=λ2x2x(2λ)=0x=0 or λ=2 and 2y=λ8y2y(14λ)=0y=0 or λ=14\begin{aligned} \nabla f (x,y) &= \lambda \nabla g (x,y)\ \ 4x &= \lambda 2x \longrightarrow 2x(2-\lambda)=0 \longrightarrow x=0 \textrm{ or } \lambda = 2\ \textrm{ and } 2y &= \lambda 8y \longrightarrow 2y(1-4\lambda) = 0 \longrightarrow y=0 \textrm{ or } \lambda = \dfrac{1}{4} \end{aligned}

The third condition is that g(x,y)=0g(x,y)=0:

Thus, we have four candidates for the maximum and minimum: (0,1)(0,1), (0,1)(0,−1), (2,0)(2,0), and (2,0)(−2,0). We just need to test the function ff at these four points and see which gives the largest value and which gives the smallest.

(x,y)f(x,y)(0,1)3(0,1)3(2,0)10(2,0)10\begin{array}{c | c} (x,y) & f(x,y)\ \hline (0,1) & 3\ (0,-1) & 3\ (2,0) & 10\ (-2,0) & 10 \end{array}

Therefore, the maximum of this function is 1010, attained at (2,0)(2,0) and (2,0)(−2,0), and the minimum is 33, attained at (0,1)(0,1) and (0,1)(0,−1).

  1. Find the absolute maximum and minimum of f(x,y)=xyf(x,y)=xy subject to the constraint x2+y28y=9x^2+y^2−8y=9.

  2. Maximum of 99 at (3,3)(3,3) and (3,3)(−3,−3); minimum of 3−3 at (3,3)(−\sqrt{3},\sqrt{3}) and (3,3)(\sqrt{3},−\sqrt{3})

  3. Find the absolute maximum and minimum of f(x,y)=y24x2f(x,y)=y^2-4x^2 subject to the constraint x2+2y2=4x^2+2y^2=4.

  4. Maximum of 22 at (0,2)(0,\sqrt{2}) and (0,2)(0,−\sqrt{2}); minimum of 16−16 at (2,0)(2,0) and (2,0)(−2,0)

Find the point on the surface 4x+y1=04x+y−1=0 closest to the point (1,2,3)(1,2,−3).

Solution

It will be easiest to minimize the squared distance from this point (subject to the constraint that the point lies on the surface): f(x,y,z)=(x1)2+(y2)2+(z+3)2g(x,y,z)=4x+y1\begin{aligned} f(x,y,z) &= (x-1)^2+(y-2)^2+(z+3)^2\ \ g(x,y,z) &= 4x+y-1 \end{aligned}

Find the gradients: f(x,y,z)=2x2,2y4,2z+6g(x,y,z)=4,1,0\begin{aligned} \nabla f (x,y,z) &= \langle 2x-2, 2y-4, 2z+6 \rangle\ \ \nabla g (x,y,z) &= \langle 4,1,0 \rangle \end{aligned}

Set up the equality, and equate the components: f(x,y,z)=λg(x,y,z)2x2=4λx=1+2λ and 2y4=λy=2+λ2 and 2z+6=0z=3\begin{aligned} \nabla f (x,y,z) &= \lambda \nabla g (x,y,z)\ \ 2x-2 &= 4\lambda \longrightarrow x=1+2\lambda\ \textrm{ and } 2y-4 &= \lambda \longrightarrow y = 2+\dfrac{\lambda}{2}\ \textrm{ and } 2z+6 &= 0 \longrightarrow z=-3 \end{aligned}

The last condition is that g(x,y)=0g(x,y)=0: 4x+y1=04(1+2λ)+(2+λ2)1=017λ2=5λ=1017\begin{aligned} 4x+y-1 &= 0\ 4(1+2\lambda)+\left(2+\dfrac{\lambda}{2}\right)-1 &= 0\ \dfrac{17\lambda}{2} &= -5\ \lambda &= -\dfrac{10}{17} \end{aligned}

Therefore, the point on the given surface that is closest to (1,2,3)(1,2,−3) is (317,2917,3)\left(-\dfrac{3}{17},\dfrac{29}{17},-3\right)