<s>[INST] Finding the extrema on sphere Let $f(x,y,z) = xe^{yz}$ . Find the extrema on the sphere $x^2+y^2+z^2=1$ . We have $e^{yz}=2tx$ , $xze^{yz}= 2ty$ , $xye^{yz}=2tz$ solving by subtitutions i found that $z(x^4-2)=0$ implies that if $z=0$ then $y=0$ and $x= \pm1$ .   if the other part is zero then i found that the solution does not exist . Hence $( 1,0,0)$ is absolute maximum and $(-1,0,0)$ is absolute minimum . Is there any problem here ? Then i was asked to find the extrema for the unit sphere and for the sphere of radius $3$ to solve simultenously and i got stucked cqn somebody help me for that . ? 
 [/INST] The unit sphere is a compact subset of $\mathbb{R}^3$ and $f$ is continuous, so the extrema exist and are reached.
Let $g=0$ be the constraint, with
\begin{align}
g(x,y,z)=x^2+y^2+z^2-1.
\end{align}
We are going to use the Lagrange multipliers theorem ; to do this, we first compute the differentials
\begin{align}
\mathrm{d}g(x,y,z)&=2x\mathrm{d}x+2y\mathrm{d}y+2z\mathrm{d}z,
\end{align}
\begin{align}
\mathrm{d}f(x,y,z)&=\mathrm{e}^{yz}\mathrm{d}x+xz\mathrm{e}^{yz}\mathrm{d}y+xy\mathrm{e}^{yz}\mathrm{d}z.
\end{align}
Thus, the critical points can be found by cancelling every sub-determinant of the matrix
\begin{align}
\begin{pmatrix}
2x & 2y & 2z \\
\mathrm{e}^{yz} & xz\mathrm{e}^{yz} & xy\mathrm{e}^{yz}
\end{pmatrix}.
\end{align}
This gives us the following conditions : 
$$x^2z-y=0\quad\quad(1)$$
and
$$x^2y-z=0\quad\quad(2)$$
and
$$y^2-z=0\quad \text{or}\quad  x=0.\quad\quad(3)$$
$\bullet$ If $x^2z-y=0$, then plugging $y=x^2z$ in $(2)$ gives $x^4=1$ or $z=0$. If $x^4=1$, then $y^2=z^2$ and we have
$$1=x^2+y^2+z^2=1+2z^2$$
that is $z=0$ and then $y=0$. So we get a first couple of critical point $(x,y,z)=(\pm1,0,0)$ for which  $f(\pm1,0,0)=\pm1$. If $z=0$, then we get the same conclusion.
$\bullet$ If $x^2y-z=0$, then we can mimic what we've done just above with $y$ and $z$ exchanged.
$\bullet$ If $y^2-z=0$, then $(1)$ gives $x^2y^2=y$ while $(2)$ gives $x^2y=y^2$. If $y=0$, then $z=0$ and $x=\pm1$ and we get the above critical point anew. If $y\neq0$, we can divide by $y$ in the preceding relations to get $x^2=y$ and $x^2=1/y$, so that $\pm x=y=1$ is the only possibility. But this is impossible under the constraint $g=0$ (i.e. on the unit sphere, only one coordinate can be equal to $\pm1$).
$\bullet$ Finally, if $x=0$, then $(1)$ and $(2)$ immediately imply $y=z=0$ which is impossible under the constraint $g=0$.
Conclusion : There is only two critical points, and they are given with the corresponding value of $f$ by :
\begin{align}
(x,y,z)=(-1,0,0)\quad,\quad f(-1,0,0)=-1,
\end{align}
\begin{align}
(x,y,z)=(1,0,0)\quad,\quad f(1,0,0)=1.
\end{align}
</s>