I am trying to solve the following problem:
Find the extrema of the function $f: \mathbb{R}^3 \to \mathbb{R}$ given by $f(x,y,z)=sin(xyz)$ subject to $x^2+y^2+z^2=\pi$ (i.e. constrained to the surface of a sphere of radius $\sqrt{\pi}$). Are these global extrema of the constrained function, $f|_C$ with $C=\{(x,y,z):x^2+y^2+z^2=\pi\}$ ?
I did this using the Lagrange multiplier where $L(x,y,z,\lambda)=sin(xyz)-\lambda (x^2+y^2+z^2-\pi)$. Then $DL(x,y,z,\lambda)=(yzcos(xyz)-2\lambda x, xzcos(xyz)-2\lambda y, xycos(xyz)-2\lambda z, \pi -x^2-y^2-z^2)$. By letting $DL(x,y,z,\lambda)=0$, I got $cos(xyz)= \frac{2 \lambda x}{yz} = \frac{2 \lambda y}{xz}= \frac{2 \lambda z}{xy}$ so assuming $\lambda \neq 0$ this implies $\frac{x}{yz} = \frac{y}{xz}= \frac{z}{xy}$, $x^2=y^2=z^2$.
Substituting this into $\pi -x^2-y^2-z^2=0$, I have $x= \pm \sqrt{\frac{\pi}{3}} $, $y= \pm \sqrt{\frac{\pi}{3}} $, $z= \pm \sqrt{\frac{\pi}{3}} $, and $\lambda=\sqrt{\frac{\pi}{12}cos((\frac{\pi}{3})^{\frac{3}{2}})}$ if $xyz>0$, $\lambda=-\sqrt{\frac{\pi}{12}cos((\frac{\pi}{3})^{\frac{3}{2}})}$ if $xyz<0$.
In this case the local extrema of the constrained function is $\pm sin ((\frac{\pi}{3})^{\frac{3}{2}})$.
However, I am told that I am missing the case when $\lambda=0$, which would add further solutions of two of $x,y,z$ are equal to $0$ with the remaining one equal to $\sqrt{\pi}$. The local extreme of the constrained function in this case would be $0$.
I would like to know whether or not the $\lambda=0$ case should be included; did I miss any further cases of local extrema, and how can I prove whether or not these local extrema are global extrema of the given constrained function.
Thanks in advance.
Constrained extrema exist at points $\vec r$ wherever $\vec r$ satisfies the constraint $g(\vec r)=\text{ Const. }$ and... $$\vec\nabla f(\vec r) = \lambda \vec \nabla g(\vec r)$$ When $\lambda = 0$ we have $\vec\nabla f(\vec r) =0$ , so that $\vec r$ is an extremum of the unconstrained function $f$
Clearly extrema and the unconstrained function will also be extrema of the constrained function. You just need to check that there exist simultaneous solutions to ... $$\vec\nabla f(\vec r) = 0 \text{ ...and... }g(\vec r)=\text{ Const. }$$
In this case it is easy to see that $f(\vec r) $ has unconstrained extrema of $\pm1$ whenever $xyz=(n+1/2)\pi$ for any $n\in \mathbb{Z}$
It can now be demonstrated that some of these points satisfy the constraint by expressing both conditions in spherical coordinates ..
$$ g(\vec r)=\pi \implies r^2=\pi$$
$$\vec\nabla f(\vec r) = 0 \implies r^3\sin^2\theta \cos\theta \sin\phi\cos\phi = (n+1/2)\pi$$
solving the first equation for $r$ and simplifying we get ...
$$\sin (2\phi) = \frac{2n+1}{\sqrt\pi\sin^2(\theta)\cos(\theta)}$$
Clearly such solutions will exist and be global extrema provided that ...
$$\left| \frac{2n+1}{\sqrt\pi\sin^2(\theta)\cos(\theta)} \right| \le 1$$
or equivalently ... $$\left| \frac{\sqrt\pi\sin^2(\theta)\cos(\theta)}{2n+1} \right| \ge 1$$
Solutions do exist for $n=0$ where they generate a locus of global maxima having $f(\vec r)=1$
and for $n=-1$ where they generate a locus of global minima having $f(\vec r)=-1$
EDIT **** After further consideration I think that no global extrema exist in this case for any value of $n$ , but if the constraint sphere were larger they would exist and need to be considered.
It turns out that the maximum value of $\sin^2 x \cos x$ is $\frac{2}{3\sqrt3}$ and $\frac{2\sqrt\pi}{3\sqrt3}<1$ so the absolute value inequality above can never be satisfied.