<s>[INST] Optimize $xyz$ where $x+y+z=1$ and $x^2+y^2+z^2=1$? Im trying to optimize
$f(x,y,z)=xyz$ restricted to $g(x,y,z)=x+y+z=1$ and $h(x,y,z)=x^2+y^2+z^2=1$.
$∇f=(yz,xz,xy)$,  $∇g=(1,1,1)$ and $∇h=(2x,2y,2z)$.
I tried using the determinant $det(∇f,∇g,∇h)=yz(2z-2y)-xz(2z-2x)+xy(2y-2x)=0$ which I dont know what to do with and I cant simplify the determinant in a good way with row operations.
I also tried solving $z$ from $g=1$. $z=1-x-y$.
$f(x,y,1-x-y)=xy-x^2y-xy^2$ restricted to $h(x,y)=2x^2+2y^2-2x-2y+2xy+1$ with Lagrange multiplier but I made no progress there either as the partial derivatives got too messy.
 [/INST] The intersection locus of the sphere $x^2 + y^2 + z^2 = 1$ and the plane $x + y + z = 1$ is a circle with center at $(\dfrac{1}{3}, \dfrac{1}{3}, \dfrac{1}{3})$ and radius $\sqrt{\dfrac{2}{3}}$ spanned by the orthogonal unit vectors
$u_1 = \dfrac{1}{\sqrt{2}} (1, -1, 0) $
and
$ u_2 = \dfrac{1}{\sqrt{6}} (1, 1, -2 ) $
Therefore, the circle parametrically is given by $q(t) = (x(t), y(t), z(t))$ where
$ x(t) = \dfrac{1}{3} + \dfrac{1}{\sqrt{3}} \cos(t) + \dfrac{1}{3} \sin(t) $
$ y(t) = \dfrac{1}{3} - \dfrac{1}{\sqrt{3}} \cos(t) + \dfrac{1}{3} \sin(t) $
$z(t) = \dfrac{1}{3} - \dfrac{2}{3} \sin(t) $
It follows that
$ x(t) y(t) = \bigg( \dfrac{1}{3} (1 + \sin(t) ) \bigg)^2 - \dfrac{1}{3} \cos^2(t) $
and this simplifies to
$ x(t) y(t) = - \dfrac{2}{9} + \dfrac{2}{9} \sin(t) + \dfrac{4}{9} \sin^2(t) $
Multiplying by $z(t)$ gives
$ f(t) = x(t) y(t) z(t) = \dfrac{2}{27} (-1 + \sin(t) + 2 \sin^2(t) ) ( 1 - 2 \sin(t) ) \\
=  \dfrac{2}{27} (2 \sin(t) - 1)(\sin(t) + 1 )(1 - 2 \sin(t) ) $
Let $g(r) = (2 r - 1)(r + 1)(1 - 2r) = -(r + 1)(4 r^2 - 4 r + 1 ) = - (4 r^3 - 3 r + 1 ) $
$g'(r) = - (12 r^2 - 3 ) = -3 ( 4 r^2 - 1) $
Hence the the critical points are $ r = \pm \dfrac{1}{2} $. And we have  a local minimum at $r = - \dfrac{1}{2} $ where $g(- \dfrac{1}{2}) =  -2 $ and a local maximum at $r = \dfrac{1}{2} $ where $g(\dfrac{1}{2})  = 0 $.  And we also have $g(-1) = 0 $ and $g(1) = -2 $
Based upon all that, we deduce that
The maximum is $0$ and the minimum  is $ \dfrac{-4}{27} $
</s>