Compute extreme values of $f(x,y,z)=x-2y+z^2$ over the constraint $x^2+y^2+z^2=9$.

86 Views Asked by At

Let $f(x,y,z)=x-2y+z^2$ over the contraint $x^2+y^2+z^2=9$.

By Lagrange multipliers I can consider the following function

$$ \begin{split} L(x,y,x \lambda) &= x-2y+z^2+ \lambda(x^2+y^2+z^2-9)\\ &=x-2y+z^2+ \lambda x^2+ \lambda y^2+ \lambda z^2-9 \lambda). \end{split}$$

So

$$ \begin{split} 0 &= \frac{\partial L}{\partial x} &= 1+2 \lambda x\\ 0 &= \frac{\partial L}{\partial y} &= -2+2 \lambda y\\ 0 &= \frac{\partial L}{\partial z} &= 2z+ 2 \lambda z\\ 0 &= \frac{\partial L}{\partial \lambda} &= x^2+y^2+z^2. \end{split} $$

From the first 2 equations $\lambda, x, y \neq 0$, so I conclude that $$ x = \frac{-1}{2 \lambda} \quad \mbox{and} \quad y = \frac{1}{ \lambda}. $$

I have trouble trying to calculate $z$ in terms of $\lambda$ substituting in $x^2+y^2+z^2-9$. the values obtained for $x$ and $y$ I obtain $$z= \pm \sqrt{9-\frac{3}{4\lambda ^2}}.$$ But I cannot proceed anymore from here :(

How can I end up computing the extreme values over these conditions?

2

There are 2 best solutions below

0
On BEST ANSWER

$$x = -\frac{1}{2\lambda} \ , y = \frac{1}{\lambda},2z(1+\lambda) = 0$$ $$\implies x = -\frac{1}{2\lambda} \ , y = \frac{1}{\lambda} \ and \ (\ z = 0 \ or \lambda = -1)$$

CASE $1$: $\lambda =-1\implies x = \frac{1}{2} \ , \ y= -1 $

So, $x^2+y^2+z^2 = 9\implies \frac{1}{4}+1+z^2 = 9 \implies z^2=9-\frac{5}{4} = \frac{31}{4}$

Thus from case $1$

$$x = \frac{1}{2}, \ y = -1 , z^2 = \frac{31}{4}$$

CASE $2$: $z=0$

So, $ x = -\frac{1}{2\lambda} \ , y = \frac{1}{\lambda}\implies \frac{1}{4\lambda^2}+\frac{1}{\lambda^2}+0 = 9 \implies \frac{5}{4\lambda^2} = 9\implies\lambda = \pm\frac{\sqrt5}{6}$

So,

$$x = -\frac{3}{\sqrt5}, \ y= +\frac{6}{\sqrt{5}}, \ z=0$$

or

$$x = \frac{3}{\sqrt5}, \ y= -\frac{6}{\sqrt{5}}, \ z=0$$

Use these three sets of values and find which corresponds to maximum or minimum.

1
On

You can find the maximum easily: $$ f(x,y,z) = x-2y+9-x^2-y^2 = 9-\left(x-\frac{1}{2}\right)^2-(y+1)^2+1+\frac{1}{4}, $$ which has a maximum of $10.25$ attained at $(x,y,z)=\left(\frac{1}{2},-1,\pm\sqrt{7.75}\right).$

For the minimum use the Lagrangian as you have tried. But there are some errors in your calculation. You should have $$ x=\frac{-1}{2\lambda}, y=\frac{1}{\lambda} \quad \text{and} \quad z=\pm\sqrt{9-\frac{5}{4\lambda^2}}. $$

Then at the optimal $(x,y,z)$ yields

$$f(x,y,z)=-\dfrac{5}{2\lambda}+9-\dfrac{5}{4\lambda^2}=10.25-\dfrac{5}{4}\left(\dfrac{1}{\lambda}-1\right)^2.$$

For the maximum, as before, we can take $\lambda=1$ and this gives us the previous solution. For the minimum, we need to maximize $\left(\frac{1}{\lambda}-1\right)^2$ over $\left\{\lambda:\frac{5}{4\lambda^2}\le 9\right\}.$ This will be optimized at $\lambda=-\frac{\sqrt{5}}{6},$ which gives $(x,y,z)=\left(\frac{3}{\sqrt{5}},-\frac{6}{\sqrt{5}},0\right).$