# Calculate max/min of a 3 variable function, restricted to g(x,y,z)=0

Calculate extrema of $f(x,y,z)=xe^{yz}$ on boundary $3x^2 +y^2 +z^2 =27$

• I did Lagrange multiplier (4 equations 4 variable) but I can't figure out how to solve that system. $f_x + \lambda g_x$,$f_y + \lambda g_y,f_z + \lambda g_z,g(x,y,z)=0$

$e^{yz}+\lambda (6x)=0$

$xze^{yz}+\lambda (2y)=0$

$xye^{yz}+\lambda (2z)=0$

$3x^2 +y^2 +z^2 -27 = 0$

I tried a lot of combinations but I can't solve this. Can you help me ?

• Although books rarely explain it this way, sometimes it's better to think about proportions here, eliminating $\lambda$ and getting $$\frac{f_x}{g_x} = \frac{f_y}{g_y} = \frac{f_z}{g_z}.$$ Of course, you have to be careful to consider the possibility that you've tried to divide by $0$. – Ted Shifrin Jul 21 '18 at 17:03
• I got to that point but I can't figure out how to proceed , like : 1/6x = xz/2y , how Do I need to reason in order to solve this proportion ? – NPLS Jul 21 '18 at 17:07
• So you end up with $$\frac1{3x}=\frac{xz}y=\frac{xy}z,$$ assuming none of $x,y,z$ is $0$. Start with the last equality, and you get $z^2=y^2$, so $z=\pm y$. Therefore, this reduces to $\frac1{3x}=\pm x$. Can you finish? With regard to the $0$ worries, $x\ne 0$, and $y=0$ if and only if $z=0$. So you should check points of the form $(x,0,0)$ that satisfy your constraint. – Ted Shifrin Jul 21 '18 at 17:13
• Thanks that's what I needed! – NPLS Jul 21 '18 at 17:16

Make $\mu = \frac{\lambda}{e^{yz}}$ and then solve
$$1+\mu 6 x = 0\\ x z + \mu 2 y = 0\\ xy + \mu 2z = 0\\ 3x^2+y^2+z^2-27=0$$
$$\left[ \begin{array}{ccccc} x & y & z & \mu & f \\\ -3 & 0 & 0 & \frac{1}{18} & 0 \\ 3 & 0 & 0 & -\frac{1}{18} & 0 \\ -\frac{1}{\sqrt{3}} & -\sqrt{13} & -\sqrt{13} & \frac{1}{2 \sqrt{3}} & -\frac{13 e}{\sqrt{3}} \\ -\frac{1}{\sqrt{3}} & \sqrt{13} & \sqrt{13} & \frac{1}{2 \sqrt{3}} & -\frac{13 e}{\sqrt{3}} \\ \frac{1}{\sqrt{3}} & -\sqrt{13} & -\sqrt{13} & -\frac{1}{2 \sqrt{3}} & \frac{13 e}{\sqrt{3}} \\ \frac{1}{\sqrt{3}} & \sqrt{13} & \sqrt{13} & -\frac{1}{2 \sqrt{3}} & \frac{13 e}{\sqrt{3}} \\ \end{array} \right]$$