<s>[INST] Why Lagrange Multiplier Doesn't Work? Question: Find maximum value $f(x,y,z) = xy + zy + xz - 4xyz$ subject to constraint $x + y + z = 1$ and $x,y,z \geq 0$.
$$
g(x,y,z) = x + y + z - 1
$$
and
$$
\nabla g(x,y,z) \neq 0,
\qquad 
\nabla g(x,y,z) = \langle 1,1,1 \rangle. 
$$
When we apply Lagrange Multiplier Method, we find
$f \bigl( \frac{1}{2}, \frac{1}{4}, \frac{1}{4} \bigr) = \frac{3}{16}$, the maximum value, but the answer is
$f \bigl( 0, \frac{1}{2}, \frac{1}{2} \bigr) = \frac{1}{4}$.
Why does that happen? Lagrange Multiplier Method has a only $1$ rule: $\nabla g(x,y,z) \neq 0$, there is no rule break.
EDİT: I find f(0,1/2,1/2) with another method and f(1/2,1/4,1/4) is not both a global maxima and a global minima point but Lagrange Multiplier gives that result, and f(1/2,1/4,1/4) is not a local minimum f(0,0,1) is lower than that.
 [/INST] You may use KKT conditions instead.
Or you may apply Lagrange Multiplier for the following equivalent problem:
Find the maximum of $F(a, b, c) = a^2b^2 + b^2c^2 + c^2a^2 -4a^2b^2c^2$ subject to $a^2+b^2+c^2 = 1$.
(Note: We have only one constraint. )
Let
$$L(a, b, c) := a^2b^2 + b^2c^2 + c^2a^2 -4a^2b^2c^2 + \lambda (a^2 + b^2 + c^2 - 1).$$
We have
\begin{align*}
 \frac{\partial L}{\partial a}
 &= -2a(4b^2c^2 - b^2 - c^2 - \lambda) = 0,\\
 \frac{\partial L}{\partial b}
 &= -2b(4c^2a^2 - a^2 - c^2 - \lambda ) = 0, \\
 \frac{\partial L}{\partial c}
 &= -2c(4a^2b^2 - a^2 - b^2 - \lambda) = 0, \\
 \frac{\partial L}{\partial \lambda} &= a^2 + b^2 + c^2 - 1 = 0.
\end{align*}
Let us solve this system of equations.
If $abc \ne 0$, we have
\begin{align*}
 4b^2c^2 - b^2 - c^2 - \lambda &= 0, \tag{1}\\
 4c^2a^2 - a^2 - c^2 - \lambda & = 0, \tag{2}\\
 4a^2b^2 - a^2 - b^2 - \lambda &= 0, \tag{3}\\
 a^2 + b^2 + c^2 - 1 &= 0. \tag{4}
\end{align*}
We can easily get all four solutions of $(a^2, b^2, c^2, \lambda)$:
$$(1/4, 1/4, 1/2, -1/4), 
(1/2, 1/4, 1/4, -1/4), 
(1/4, 1/2, 1/4, -1/4),
(1/3,1/3, 1/3, -2/9).$$
(Note: We actually need $a^2, b^2, c^2$. We don't need $a, b, c$.)
If $a=b=0$, we have $c^2 = 1, \lambda = 0$.
If $a=c=0$, we have $b^2 = 1, \lambda = 0$.
If $b=c=0$, we have $a^2 = 1, \lambda = 0$.
If $a = 0, bc \ne 0$, we have
$b^2 = c^2 = 1/2$ and $\lambda = -1/2$.
If $b = 0, ac \ne 0$, we have
$a^2 = c^2 = 1/2$ and $\lambda = -1/2$.
If $c = 0, ab \ne 0$, we have
$a^2 = b^2 = 1/2$ and $\lambda = -1/2$.
It is easy to get the maximum $1/4$ when $a = 0, b^2 = c^2 = 1/2$ or $b = 0, c^2 = a^2 = 1/2$ or $c = 0, a^2 = b^2 = 1/2$.
Come back to the original problem. The maximum is $1/4$ when $x = 0, y = z = 1/2$ or $y = 0, x = z = 1/2$ or $z = 0, x = y = 1/2$.
</s>