Lagrange's Multiplier for $f(x,y,z) = (xyz)^2$ Given a function:
$$f(x,y,z) = (xyz)^2$$
And the set: $$S = \{(x,y,z) : x^2 + y^2 + z^2  = a^2\} $$
Does $f$ have a maxima on $S$?
(Is this argument correct? : Yes, because f has a maxima and minima in S if S is compact and f is continuous. But here S is compact so we have a maxima)
Also, how do I tell if a function has maxima or minima on a set if the set is not compact?
I tried using the lagrange multiplier.
$f_x = 2xy^2z^2$, $f_y = 2yx^2z^2$,  $f_z = 2zx^2y^2$, $f_\lambda = x^2 + y^2 + z^2 - a^2$
$$f_x + \lambda g_x = 0$$
$$f_y + \lambda g_y = 0$$
$$f_z + \lambda g_z = 0$$
$$f_\lambda = 0$$
However on solving this system of equations using substitution, I am unable to find a solution for (x,y,z). I did find one point though (0,0,0), for $a = 0$,  Can I set $a$ to be $0$?
$$2xy^2z^2 = \lambda2x$$
$$2yx^2z^2 = \lambda2y$$
$$2zx^2y^2 = \lambda2z$$
So suppose $x = 0$ and $\lambda \not = 0$, we have $\lambda2y = 0$, so $y = 0$, similarly $z = 0$, $(0,0,0)$ satisfies $f_\lambda = 0$ for $a = 0$, so this is one point.
However, evaluating for other points, I am unable to simplify.
For $x \not = 0$, we have: $y^2z^2 = \lambda$
But how do I proceed from now?
Can I say by symmetry, if any one of $x$, $y$ or $z$ is $0$ then they all have to be $0$?
If so, then we have all non zero :
$$x^2z^2 = x^2y^2 = y^2z^2$$
which means $$ x^2 = y^2 = z^2$$
And then substituting this into constraint, we get 6 points of the form
$$( \pm\ a/\sqrt3, \pm\ a/\sqrt3, \pm\ a/\sqrt3)$$
Is this correct?
 A: Define : $\mathcal{L}(x,y,z,\lambda) = (xyz)^2 - \lambda\cdot(x^2 + y^2 + z^2 - a^2)$ for any $\lambda \in \mathbb{R}$ , and for any $x, y, z \in \mathbb{R}$ .
So, $~\mathcal{L}_x = 2xy^2z^2 - 2\lambda x~$ , $~\mathcal{L}_x = 2x^2yz^2 - 2\lambda y~$ , and $~\mathcal{L}_x = 2x^2y^2z - 2\lambda z~$ . Also, we have : $~\mathcal{L}_\lambda = a^2 - (x^2 + y^2 + z^2)~$ .
Equating these to $0$ , we get : $\lambda = x^2y^2 = y^2z^2 = z^2x^2~$ , and $~~a^2 = x^2 + y^2 + z^2$ .
Now, if any of $x, y, z$ is $0$ , then $f$ won't be maximized for sure, in fact it'll get minimized then. So , multiplying the first $3$ constraints by $z^2, x^2 , y^2$ respectively , we get $\lambda x^2 = \lambda y^2 = \lambda z^2$ , which implies that $f$ is maximized when $x^2 = y^2 = z^2 = k~$ (Say) .
Thus, by Lagrange Multiplier Theorem, using the 4th constraint, we get that $f$ is maximized when $a^2 = x^2 + y^2 + z^2 = 3k$ , i.e. $~x^2 = y^2 = z^2 = \frac{a^2}{3}$ .
Therefore, $f$ is maximized when $~(x,y,z) = \left(\pm\dfrac{| a |}{3} , \pm\dfrac{| a |}{3} , \pm\dfrac{| a |}{3} \right)$ , and the maximum value of will be $\dfrac{a^6}{27}$ .

In fact, you don't need a strong result like Lagrange Multiplier in order to solve this problem. Observe that by simple AM-GM Inequality, we have : $$(xyz)^2 = x^2\cdot y^2 \cdot z^2 \leqslant \left[\dfrac{x^2 + y^2 + z^2}{3}\right]^3 = \left(\dfrac{a^2}{3}\right)^3 = \dfrac{a^6}{27}$$ and the maximum is attained when $x^2 = y^2 = z^2 = \dfrac{a^2}{3}$ , which is certainly same as the result produced using Lagrange Multiplier. Hope it helps.
