Given the function, minimize the function subject to the constraint. (Lagrange's Multipliers)

1.4k Views Asked by At

Given the function $f(x, y, z) = (x-1)^2 + y^2 + (z+1)^2$:

Minimize $f(x, y, z)$ subject to the constraint $x + y +z = 1$

I know that you need to use Lagrange's Multipliers and thus would need to set $g(x, y, z) = x + y + z$ and find the gradient of both $f(x, y, z)$ and $g(x, y, z)$, but I'm not sure what to do next.

1

There are 1 best solutions below

0
On

Let $g(x,y,z,\lambda)=(x-1)^2+y^2+(z+1)^2-\lambda(x+y+z-1)$.

Set $\dfrac{\partial g}{\partial x}=2(x-1)-\lambda=0$,

$\dfrac{\partial g}{\partial y}=2y-\lambda=0$,

$\dfrac{\partial g}{\partial z}=2(z+1)-\lambda=0$,

and $\dfrac{\partial g}{\partial \lambda}=x+y+z-1=0$.

You should find that $\lambda=2(x-1)=2y=2(z+1)$,

so $y=x-1=z+1$, so $y+1=x$ and $y-1=z$.

Given $x+y+z-1=0$, this means $3y-1=0$, so $y=\dfrac13$, so $x=\dfrac43$, and $z=-\dfrac23$.

(Check that $x+y+z=1$.)

Therefore, the extremum is $(x-1)^2+y^2+(z+1)^2=\left(\dfrac13\right)^2+\left(\dfrac13\right)^2+\left(\dfrac13\right)^2=\dfrac13$.

Note that it occurs when $x-1=y=z+1$.