PAGE 1

15.8 Lagrange Multipliers

Constrained optimization problems: find max/min of something subject to a certain condition.

For example, find max/min of \( f(x,y) = x^2 + y^2 \) subject to the condition that \( xy = 1 \).

\( f(x,y) = x^2 + y^2 \) is called the objective

\( g(x,y) = xy - 1 = 0 \) is called the constraint

Since the constraint is simple we can solve this by substitution:

\[ f(x,y) = x^2 + y^2 \quad \text{and} \quad xy = 1 \rightarrow y = \frac{1}{x} \]\[ f(x,y) = x^2 + \left(\frac{1}{x}\right)^2 = x^2 + \frac{1}{x^2} = f(x) \]\[ f'(x) = 2x - \frac{2}{x^3} = 0 \rightarrow x^4 = 1 \rightarrow x = -1, \, x = 1 \]\[ y = \frac{1}{x} \rightarrow y = -1 \text{ when } x = -1, \quad y = 1, \, x = 1 \]

Critical pts: \( (-1, -1), (1, 1) \)

PAGE 2
\( f(x,y) = x^2 + y^2 \)\( xy = 1 \)

\( f \) does not have a maximum since we can make \( x \) or \( y \) arbitrarily large \( (y = \frac{1}{x}, \text{ or } x = \frac{1}{y}) \).

So critical pts \( (1, 1), (-1, -1) \) must be where minima are.

The geometric interpretation is much more important

Graph of concentric circles (level curves k=0, 1, 4) and a red hyperbola (xy=1) tangent at (1,1) and (-1,-1).

\( f(x,y) = x^2 + y^2 \)

Level curves: \( x^2 + y^2 = k \)

Constraint: \( xy = 1 \)

\( y = \frac{1}{x} \) (hyperbolas)

At \( (1, 1) \) any movement on the red curve \( \rightarrow \) bigger \( k \).

At locations of max/min, the constraint curve and the objective level curve are tangent to each other.

PAGE 3

At the point where the objective (\(f\)) is tangent to the constraint (\(g\)), their gradients must also be tangent.

A sketch of two curves f and g meeting at a tangent point with parallel gradient vectors.

Tangent gradients \(\Rightarrow \vec{\nabla} f = \lambda \vec{\nabla} g\)

Greek lowercase "lambda" (Lagrange multiplier)

Method of Lagrange Multipliers:

To find max/min of \(f(x, y)\) subject to constraint \(g(x, y) = 0\), find where:

\(\vec{\nabla} f = \lambda \vec{\nabla} g\)

PAGE 4

Example

\(f(x, y) = 4 - x^2 - y^2\)

Subject to \(4x^2 + y^2 = 4\)

Rewrite: \(g(x, y) = 4x^2 + y^2 - 4 = 0\)

Solve \(\vec{\nabla} f = \lambda \vec{\nabla} g\)

\(\vec{\nabla} f = \langle f_x, f_y \rangle = \langle -2x, -2y \rangle\)

\(\vec{\nabla} g = \langle g_x, g_y \rangle = \langle 8x, 2y \rangle\)

\(\vec{\nabla} f = \lambda \vec{\nabla} g \rightarrow \langle -2x, -2y \rangle = \lambda \langle 8x, 2y \rangle\)

\(-2x = \lambda \cdot 8x \quad \text{--- (1)}\)

\(-2y = \lambda \cdot 2y \quad \text{--- (2)}\)

Solve for \(x\), \(y\) and optionally \(\lambda\) with the help of \(g(x, y) = 0\)

(1): \(\lambda \cdot 8x + 2x = 0\)

\(2x(4\lambda + 1) = 0 \rightarrow x = 0 \quad \text{or} \quad \lambda = -1/4\)

Using \(g(x, y) = 4x^2 + y^2 - 4 = 0\), we set \(y = \pm 2\)

Points of interest: \((0, 2), (0, -2)\)

PAGE 5

Lagrange Multipliers: Continued Analysis

②: \( \lambda \cdot 2y + 2y = 0 \)

\( 2y(\lambda + 1) = 0 \rightarrow y = 0 \text{ or } \lambda = -1 \)

From \( g(x,y) = 4x^2 + y^2 - 4 = 0 \), we get \( x = \pm 1 \).

points of interest: \( (1, 0), (-1, 0) \)

Comparing Function Values

Now compare \( f(x,y) = 4 - x^2 - y^2 \) at the points of interest:

\( f(0, 2) = 0 \)

\( f(0, -2) = 0 \)

two minima at \( (0, \pm 2), f = 0 \)

\( f(1, 0) = 3 \)

\( f(-1, 0) = 3 \)

two maxima at \( (\pm 1, 0), f = 3 \)

Geometric View

\( f(x,y) = 4 - x^2 - y^2 \rightarrow \) level curves are circles

\( k = 4 - x^2 - y^2 \rightarrow x^2 + y^2 = (4 - k) \)

\( g(x,y) = 4x^2 + y^2 - 4 = 0 \rightarrow \) ellipse

Coordinate graph showing concentric circles (f) and a vertical ellipse (g) intersecting at (0,2), (0,-2), (1,0), and (-1,0).
Geometric representation of level curves and constraint ellipse.
PAGE 6

Example: Optimization with Three Variables

\( f(x,y,z) = xyz \)

Subject to \( x^2 + y^2 + z^2 = 3 \rightarrow g(x,y,z) = x^2 + y^2 + z^2 - 3 = 0 \)

Geometric Interpretation

Find places on the sphere \( x^2 + y^2 + z^2 = 3 \) where the product of the coordinates \( (x,y,z) \) is max/min.

Solution using Lagrange Multipliers

Solve \( \vec{\nabla} f = \lambda \vec{\nabla} g \)

\( \vec{\nabla} f = \langle yz, xz, xy \rangle \)

\( \vec{\nabla} g = \langle 2x, 2y, 2z \rangle \)

\( \vec{\nabla} f = \lambda \vec{\nabla} g \rightarrow \langle yz, xz, xy \rangle = \lambda \langle 2x, 2y, 2z \rangle \)

① \( yz = \lambda \cdot 2x \rightarrow \lambda = \frac{yz}{2x} \)

② \( xz = \lambda \cdot 2y \rightarrow \lambda = \frac{xz}{2y} \)

③ \( xy = \lambda \cdot 2z \rightarrow \lambda = \frac{xy}{2z} \)

④ \( g = x^2 + y^2 + z^2 - 3 = 0 \)

\( \frac{yz}{2x} = \frac{xz}{2y} = \frac{xy}{2z} \)

PAGE 7

Solving for Critical Points

\[ \frac{yz}{2x} = \frac{xz}{2y} = \frac{xy}{2z} \]

From the first equality:

\[ y^2z = x^2z \implies x^2 = y^2 \]

From the second equality:

\[ xz^2 = xy^2 \implies y^2 = z^2 \]

Combining these, we get:

\[ x^2 = y^2 = z^2 \]

Substitution into Constraint

Now substitute into \( g(x, y, z) = x^2 + y^2 + z^2 - 3 = 0 \):

\[ 3x^2 - 3 = 0 \implies x = \pm 1 \]

So,

\[ y = \pm 1 \] \[ z = \pm 1 \]

Points of Interest

  • \( (1, 1, 1) \)
  • \( (-1, -1, -1) \)
  • \( (1, -1, -1), (-1, 1, -1), (-1, -1, 1) \)
  • \( (1, 1, -1), (1, -1, 1), (-1, 1, 1) \)

Compare \( f(x, y, z) = xyz \) at these locations:

max: \( 1 \) at \( (1, 1, 1), (-1, -1, 1), (-1, 1, -1), (1, -1, -1) \)

min: \( -1 \) at the other places

PAGE 8

Analysis of Boundary Conditions

When we solved for \( \lambda \) earlier, we implicitly required \( x \neq 0, y \neq 0, z \neq 0 \).

But there are possible locations on the sphere where these variables could be zero.

However, \( f = xyz \). If one is zero, \( f = 0 \) and it's neither max nor min.