0:00 / 0:00

Lagrange Multipliers

Say we want to optimize f(x, y, z) f(x,~y,~z)~ subject to the constraint g(x, y, z)=k, k∈ℜ. g(x,~y,~z)=k,~k\in\Re.~

We can use Lagrange Multipliers, where λ \lambda~denotes Lagrange Multipliers.

The procedure is as follows:

Step 1

Solve the following set of equations to identify the minimum and maximum values:
∇f(x, y, z)=λ∇g(x, y, z)g(x, y, z)=k, k∈ℜSolve this system\nabla f(x,~y,~z)=\lambda{\nabla g(x,~y,~z)}\newline{} g(x,~y,~z)=k,~k\in\Re\newline{} {\color{magenta}\text{\footnotesize{Solve this system}}}
where λ\colorThree{\lambda} is a scalar and the second equation is the equation of the constraints of the problem.

This set of equations could be expanded as:
fx=λgx(x, y, z)fy=λgy(x, y, z)fz=λgz(x, y, z)g(x, y, z)=k, k∈ℜf_x=\lambda{g_x(x,~y,~z)}\newline{} f_y=\lambda{g_y(x,~y,~z)}\newline{} f_z=\lambda{g_z(x,~y,~z)}\newline{} g(x,~y,~z)=k,~k\in\Re

Wize Tip
The function f(x, y, z) f(x,~y,~z)~is known as the objective function and g(x, y, z) g(x,~y,~z)~is the constraint.

When attempting to find the absolute maximum or minimums, we substitute them into the objective function, not our constraint.


Step 2

Plug in all the solutions from the first step into f(x, y, z)\colorThree{f(x,~y,~z)} and identify the maximum/minimum values, provided they exist and ∇g(x, y, z)≠0\colorThree{\nabla{g(x,~y,~z)} \neq 0} at that point.

Remember: For solving Lagrange Multiplier problems, in most cases it is easier to eliminate λ \color{orange}\lambda~ and solve for other variables.

Exam Tip
More than one constraint? No problem!

Let f(x, y, z) f(x,~y,~z)~be our function to optimize and subject to the constraints g(x, y, z)=cg(x,~y,~z)=c and h(x, y, z)=kh(x,~y,~z)=k.

Then,
∇f(x, y, z)=λ∇g(x, y, z)+μ∇h(x, y, z)g(x, y, z)=c, c∈ℜh(x, y, z)=k, k∈ℜ\color{blue}\nabla{f(x,~y,~z)}=\lambda \nabla{g(x,~y,~z)}+\mu \nabla{h(x,~y,~z)} \newline{} g(x,~y,~z)=c,~c\in\Re \newline{} h(x,~y,~z)=k,~k\in\Re


0:00 / 0:00

Example

Find the maximum volume of a rectangular box with a lid if the total area of the cardboard is 15 m215\ m^2.

V(x,y,z)=xyzV(x,y,z)=xyz



Area: 2xy+2xz+2yz=152xy+2xz+2yz=15
⇒g(x,y,z)=xy+xz+yz=7.5\Rightarrow g(x,y,z)=xy+xz+yz=7.5 (constraint)
{∇→V=λ∇→gg(x,y,z)=7.5⇒{Vx=λgxVy=λgyVz=λgzg(x,y,z)=7.5\left\{ \begin{array}{rl} \overrightarrow{\nabla}V&=\lambda\overrightarrow{\nabla}g \\ g(x,y,z)&=7.5 \end{array}\right. \Rightarrow \left\{ \begin{array}{rl} V_x&=\lambda g_x\\ V_y&=\lambda g_y\\ V_z&=\lambda g_z\\ g(x,y,z)&=7.5 \end{array}\right.\newline{}
⇒{yz=(y+z)λ(eq.1)xz=(x+z)λ(eq.2)xy=(x+y)λ(eq.3)xy+xz+yz=7.5(eq.4) \Rightarrow \left\{ \begin{array}{rll} yz&=(y+z)\lambda&(\mathrm{eq}.1)\\ xz&=(x+z)\lambda&(\mathrm{eq}.2)\\ xy&=(x+y)\lambda&(\mathrm{eq}.3)\\ xy+xz+yz&=7.5&(\mathrm{eq}.4) \end{array}\right.\newline{}

Eliminate λ\lambda
(eq.1)(eq.2):yzxz=y+zx+z⇒x(y+z)=(x+z)y⇒xy+xz=xy+yz\frac{(\mathrm{eq}.1)}{(\mathrm{eq}.2)}: \frac{y \cancel{z} }{x \cancel{z}}=\frac{y+z}{x+z}\Rightarrow x(y+z)=(x+z)y\Rightarrow \cancel{xy}+xz=\cancel {xy}+yz
⇒x=y\Rightarrow \boxed{x=y}

(eq.2)(eq.3):xzxy=(x+z)(x+y)⇒zx+zy=xy+zy⇒z=y\frac{(\mathrm{eq}.2)}{(\mathrm{eq}.3)}: \frac{\cancel{x}z}{\cancel{x}y}=\frac{(x+z)}{(x+y)}\Rightarrow zx+\cancel{zy}=xy+\cancel{zy}\Rightarrow\boxed{z=y}
⇒x=y=z\Rightarrow x=y=z (eq. 5)

(eq.5)⇒(eq.4):x2+x2+x2=3x2=7.5⇒x2=2.5⇒x=2.5(\mathrm{eq}.5)\Rightarrow(\mathrm{eq}.4): x^2+x^2+x^2=3x^2=7.5\Rightarrow x^2=2.5 \Rightarrow x=\sqrt{2.5}

Point: (2.5,2.5,2.5)(\sqrt{2.5},\sqrt{2.5},\sqrt{2.5})

The volume is
V=(2.5)3m3V=(\sqrt{2.5})^3m^3

Example

Find the points on the curve x3y=20x^3y=20 that are closest to the origin.

Distance to origin =x2+y2=\sqrt{x^2+y^2}
I choose f(x,y)=x2+y2⇒∇→f=(2x,2y)f(x,y)=x^2+y^2\Rightarrow\overrightarrow{\nabla}f=(2x,2y)
Constraint =g(x,y)=x3y=20⇒∇→g=(3x2y,x3)=g(x,y)=x^3y=20\Rightarrow\overrightarrow{\nabla}g=(3x^2y,x^3)

{∇→f=λ∇→gg=20⇒{2x=λ(3x2y)(eq.1)2y=x3λ(eq.2)x3y=20(eq.3)\left\{ \begin{array}{rl} \overrightarrow{\nabla}f&=\lambda\overrightarrow{\nabla}g \\ g&=20 \end{array}\right. \Rightarrow \left\{ \begin{array}{rll} 2x&=\lambda(3x^2y)&(\mathrm{eq}.1)\\ 2y&=x^3\lambda&(\mathrm{eq}.2)\\ x^3y&=20&(\mathrm{eq}.3) \end{array}\right.

From (eq.1)(eq.2):xy=3̸x2yx3̸⇒x2=3y2⇒x=3y⇒y=13x\frac{(\mathrm{eq}.1)}{(\mathrm{eq}.2)}: \qquad \frac{x}{y}=\frac{3\not{x^2}y}{x\not{3}}\Rightarrow x^2=3y^2\Rightarrow x=\sqrt{3}y\Rightarrow y=\frac{1}{\sqrt{3}}x

From (eq.3)⇒x3⋅13x=20⇒203=x4⇒x=±2034(\mathrm{eq}.3)\Rightarrow x^3\cdot \frac{1}{\sqrt{3}}x=20\Rightarrow 20\sqrt{3}=x^4\Rightarrow x=\pm \sqrt[4]{20\sqrt{3}}

Therefore,
  • x=±2034 x=\pm \sqrt[4]{20\sqrt{3}}
  • y=13x=±132034=±204338y=\frac{1}{\sqrt{3}}x= \pm \frac{1}{\sqrt{3}}\sqrt[4]{20\sqrt{3}}=\pm\frac{\sqrt[4]{20}}{\sqrt[8]{3^3}}

Practice

Find the maximum and the minimum values of f(x, y, z)=xyz f(x,~y,~z)=xyz~subject to x+y+z=1, x,y,z≥0.x+y+z=1,~x,y,z\geq0.

Practice

Find the maximum and minimum values of f(x, y, z)=3x2+yf(x,~y,~z)=3x^2+y subject to 4x−3y=9 and x2+z2=94x-3y=9~\text{and}~x^2+z^2=9.