Topic 14

Lagrange Multipliers

To find the max and min of ff on a g=kg = k, solve ∇f=λ∇g\nabla f = \lambda\nabla g together with g=kg = k. At an extreme point, the of ff just touches the constraint. So the two gradients are parallel. Every solution is a : evaluate ff at each one and compare.

5 kinds of question. Open the one you are stuck on.

1

Find the maximum and minimum on a curve using Lagrange multipliers

e.g. “Use the method of Lagrange multipliers to find the maximum and minimum values of f(x,y)f(x, y) subject to the constraint g(x,y)=kg(x, y) = k”
  1. 1
    Write ff and the constraint g(x,y)=kg(x, y) = k
  2. 2
    Write the system ∇f=λ∇g\nabla f = \lambda\nabla g, g=kg = k

    Three equations: fx=λgxf_x = \lambda g_x, fy=λgyf_y = \lambda g_y, g=kg = k.

  3. 3
    Eliminate λ\lambda, then use the constraint

    Before dividing by a variable, split off the case where it is 00.

  4. 4
    Evaluate ff at every solution and compare

    On a closed curve like a circle or an ellipse, both a max and a min exist. On an unbounded curve, one may not.

Remember: Gradients parallel, then compare.

See it in a problem3 worked examples

Use Lagrange multipliers to find the maximum and minimum of f(x,y)=2x+yf(x, y) = 2x + y subject to x2+4y2=17x^2 + 4y^2 = 17.

  1. 1
    Write ff and the constraint g(x,y)=kg(x, y) = k

    f=2x+yf = 2x + y,  g=x2+4y2=17\ g = x^2 + 4y^2 = 17.

  2. 2
    Write the system ∇f=λ∇g\nabla f = \lambda\nabla g, g=kg = k

    2=2λx2 = 2\lambda x,  1=8λy\ 1 = 8\lambda y,  x2+4y2=17\ x^2 + 4y^2 = 17.

  3. 3
    Eliminate λ\lambda, then use the constraint

    λ≠0\lambda \neq 0, so x=1λx = \dfrac{1}{\lambda} and y=18λy = \dfrac{1}{8\lambda}: x=8yx = 8y. Then 64y2+4y2=1764y^2 + 4y^2 = 17, y=±12y = \pm\tfrac12, x=±4x = \pm 4.

  4. 4
    Evaluate ff at every solution and compare

    f(4,12)=172f\left(4, \tfrac12\right) = \tfrac{17}{2} and f(−4,−12)=−172f\left(-4, -\tfrac12\right) = -\tfrac{17}{2}.

Answer:

Max 172\tfrac{17}{2} at (4,12)\left(4, \tfrac12\right); min −172-\tfrac{17}{2} at (−4,−12)\left(-4, -\tfrac12\right).

Common mistakes4
  • Dividing by xx and losing the solutions with x=0x = 0.
  • Dropping the constraint: ∇f=λ∇g\nabla f = \lambda\nabla g alone has too many solutions.
  • Reporting λ\lambda. It is a helper; the answer is the points and the values of ff.
  • Claiming a max on an unbounded curve like xy=2xy = 2, where ff can grow forever.
2

Find the maximum and minimum on a surface using Lagrange multipliers

e.g. “Find the maximum and minimum values of f(x,y,z)f(x, y, z) on the sphere x2+y2+z2=1x^2 + y^2 + z^2 = 1”
  1. 1
    Write the four equations: ∇f=λ∇g\nabla f = \lambda\nabla g and g=kg = k
  2. 2
    Solve the gradient equations for x,y,zx, y, z in terms of λ\lambda

    Or multiply them by xx, yy, zz so the same product appears in each, for example xyz=2λx2xyz = 2\lambda x^2.

  3. 3
    Substitute into the constraint and solve
  4. 4
    Evaluate ff at every point and compare

Remember: Four equations, four unknowns, then compare.

See it in a problem2 worked examples

Find the maximum and minimum of f(x,y,z)=2x−y+2zf(x, y, z) = 2x - y + 2z on the sphere x2+y2+z2=9x^2 + y^2 + z^2 = 9.

  1. 1
    Write the four equations: ∇f=λ∇g\nabla f = \lambda\nabla g and g=kg = k

    2=2λx2 = 2\lambda x,  −1=2λy\ -1 = 2\lambda y,  2=2λz\ 2 = 2\lambda z,  x2+y2+z2=9\ x^2 + y^2 + z^2 = 9.

  2. 2
    Solve the gradient equations for x,y,zx, y, z in terms of λ\lambda

    x=1λx = \dfrac{1}{\lambda},  y=−12λ\ y = -\dfrac{1}{2\lambda},  z=1λ\ z = \dfrac{1}{\lambda}.

  3. 3
    Substitute into the constraint and solve

    1+14+1λ2=9\dfrac{1 + \tfrac14 + 1}{\lambda^2} = 9 gives λ=±12\lambda = \pm\tfrac12: the points ±(2,−1,2)\pm(2, -1, 2).

  4. 4
    Evaluate ff at every point and compare

    f(2,−1,2)=4+1+4=9f(2, -1, 2) = 4 + 1 + 4 = 9 and f(−2,1,−2)=−9f(-2, 1, -2) = -9.

Answer:

Max 99 at (2,−1,2)(2, -1, 2); min −9-9 at (−2,1,−2)(-2, 1, -2).

Common mistakes3
  • Missing the solutions where a variable is 00 (they often give f=0f = 0).
  • Stopping at λ\lambda: plug the points into ff.
  • Forgetting the ±\pm when taking a square root.
3

Find the closest and farthest points using Lagrange multipliers

e.g. “Find the points on the ellipse … closest to and farthest from the origin”
  1. 1
    Use the squared distance DD, not the distance

    D=(x−a)2+(y−b)2+(z−c)2D = (x - a)^2 + (y - b)^2 + (z - c)^2 has the same extreme points and no square root.

  2. 2
    Set ∇D=λ∇g\nabla D = \lambda\nabla g and keep g=kg = k
  3. 3
    Solve for every candidate point

    Split off the case where a factor is 00 before dividing.

  4. 4
    Compare DD: smallest is closest, largest farthest

    The distance itself is D\sqrt{D}.

Remember: Square the distance, then Lagrange.

See it in a problem3 worked examples

Find the points on the ellipse x2+xy+y2=3x^2 + xy + y^2 = 3 closest to and farthest from the origin.

  1. 1
    Use the squared distance DD, not the distance

    D=x2+y2D = x^2 + y^2.

  2. 2
    Set ∇D=λ∇g\nabla D = \lambda\nabla g and keep g=kg = k

    2x=λ(2x+y)2x = \lambda(2x + y),  2y=λ(x+2y)\ 2y = \lambda(x + 2y),  x2+xy+y2=3\ x^2 + xy + y^2 = 3.

  3. 3
    Solve for every candidate point

    Eliminate λ\lambda: 2x(x+2y)=2y(2x+y)2x(x + 2y) = 2y(2x + y), so x2=y2x^2 = y^2. y=xy = x: 3x2=33x^2 = 3, points ±(1,1)\pm(1, 1). y=−xy = -x: x2=3x^2 = 3, points ±(3,−3)\pm(\sqrt3, -\sqrt3).

  4. 4
    Compare DD: smallest is closest, largest farthest

    D(±(1,1))=2D(\pm(1, 1)) = 2 and D(±(3,−3))=6D(\pm(\sqrt3, -\sqrt3)) = 6.

Answer:

Closest: ±(1,1)\pm(1, 1), distance 2\sqrt2. Farthest: ±(3,−3)\pm(\sqrt3, -\sqrt3), distance 6\sqrt6.

Common mistakes3
  • Answering with DD instead of the distance D\sqrt{D}.
  • Missing a case: the closest point often comes from the case you were tempted to divide away.
  • Giving a distance when the question asks for the point.
4

Solve an optimization word problem using Lagrange multipliers

e.g. “A closed rectangular box with a volume of … is to be constructed of two materials … find the dimensions of the least expensive box”
  1. 1
    Name the variables and write the objective ff
  2. 2
    Write the fixed quantity as the constraint g=kg = k
  3. 3
    Solve ∇f=λ∇g\nabla f = \lambda\nabla g with g=kg = k

    Sizes are positive, so you may divide by xx, yy, zz. Symmetry often gives x=yx = y quickly.

  4. 4
    Answer with the dimensions and units

Remember: Objective, constraint, gradients parallel.

See it in a problem3 worked examples

A closed rectangular box must hold 20 m320\text{ m}^3. The top and bottom cost 5 dollars per m2\text{m}^2 and the sides 2 dollars per m2\text{m}^2. Find the cheapest dimensions.

  1. 1
    Name the variables and write the objective ff

    Base xx by yy, height zz. Cost C=5(2xy)+2(2xz+2yz)=10xy+4xz+4yzC = 5(2xy) + 2(2xz + 2yz) = 10xy + 4xz + 4yz.

  2. 2
    Write the fixed quantity as the constraint g=kg = k

    g=xyz=20g = xyz = 20.

  3. 3
    Solve ∇f=λ∇g\nabla f = \lambda\nabla g with g=kg = k

    10y+4z=λyz10y + 4z = \lambda yz,  10x+4z=λxz\ 10x + 4z = \lambda xz,  4x+4y=λxy\ 4x + 4y = \lambda xy. Multiply the first by xx and the second by yy: 10xy+4xz=10xy+4yz10xy + 4xz = 10xy + 4yz, so x=yx = y. Then 8x=λx28x = \lambda x^2, λ=8x\lambda = \tfrac{8}{x}, and 10x+4z=8z10x + 4z = 8z gives z=52xz = \tfrac52 x. So 52x3=20\tfrac52 x^3 = 20, x=2x = 2.

  4. 4
    Answer with the dimensions and units

    x=y=2 mx = y = 2\text{ m}, z=5 mz = 5\text{ m}; cost 40+40+40=12040 + 40 + 40 = 120 dollars.

Answer:

2 m×2 m2\text{ m} \times 2\text{ m} base, 5 m5\text{ m} tall.

Common mistakes3
  • Counting the top and bottom of a closed box as one face. A closed box has both.
  • Using V=xyzV = xyz for a box inside an ellipsoid. With a corner at (x,y,z)(x, y, z), the sides are 2x2x, 2y2y, 2z2z, so V=8xyzV = 8xyz.
  • Giving only the cost or volume when the dimensions are asked for.
5

Use Lagrange multipliers with two constraints

e.g. “… on the curve of intersection of the plane … and the paraboloid …”
  1. 1
    Write ff and both constraints g=k1g = k_1, h=k2h = k_2
  2. 2
    Set ∇f=λ∇g+μ∇h\nabla f = \lambda\nabla g + \mu\nabla h

    With the two constraints: five equations in x,y,z,λ,μx, y, z, \lambda, \mu.

  3. 3
    Eliminate λ\lambda and μ\mu; then use both constraints
  4. 4
    Evaluate ff at every solution and compare

Remember: Two constraints, two multipliers.

See it in a problem2 worked examples

Find the highest and lowest points on the curve where the plane x+y+z=1x + y + z = 1 meets the cylinder x2+y2=2x^2 + y^2 = 2.

  1. 1
    Write ff and both constraints g=k1g = k_1, h=k2h = k_2

    f=zf = z;  g=x2+y2=2\ g = x^2 + y^2 = 2;  h=x+y+z=1\ h = x + y + z = 1.

  2. 2
    Set ∇f=λ∇g+μ∇h\nabla f = \lambda\nabla g + \mu\nabla h

    0=2λx+μ0 = 2\lambda x + \mu,  0=2λy+μ\ 0 = 2\lambda y + \mu,  1=μ\ 1 = \mu.

  3. 3
    Eliminate λ\lambda and μ\mu; then use both constraints

    μ=1\mu = 1, so 2λx=2λy=−12\lambda x = 2\lambda y = -1: λ≠0\lambda \neq 0 and x=yx = y. Then 2x2=22x^2 = 2, x=±1x = \pm 1, and z=1−2xz = 1 - 2x.

  4. 4
    Evaluate ff at every solution and compare

    (1,1,−1)(1, 1, -1) gives z=−1z = -1;  (−1,−1,3)\ (-1, -1, 3) gives z=3z = 3.

Answer:

Highest (−1,−1,3)(-1, -1, 3); lowest (1,1,−1)(1, 1, -1).

Common mistakes2
  • Using only one constraint: the answer must lie on both surfaces.
  • Writing ∇f=λ∇g=μ∇h\nabla f = \lambda\nabla g = \mu\nabla h. The right side is a sum.

Need the formulas? Must memorize · Flashcards

Found this helpful? Leave us a review on Google ↗Spotted a mistake?

Which topics are you reviewing?

The topic list, Flashcards, Must memorize and Exam words will only show these. Change it any time with the Topics button above the topic list.

Vectors & geometry
Partial derivatives
Optimization
Multiple integrals
11 of 20 topics selected