<s>[INST] Lagrange multiplier on unit sphere for $f(x,y,z)=x^2+2y^2+3z^2$ 
Find the maximum and minimum value of $f(x,y,z)=x^2+2y^2+3z^2$ in the region $D=\{(x,y,z)\in \mathbb R^3| x^2+y^2+z^2=1\}$. And find a unit vector at which the maximum and minimum are attained respectively.

Attempt:
I know I need to proceed by Lagrange multiplier method, but I am not sure how to proceed after a step
we will get the equations as $$x=\lambda x$$$$y=\frac{\lambda}{2} y$$$$z=\frac{\lambda}{3} z$$$$x^2+y^2+z^2=1$$
Now how to solve them?
 [/INST] We have: $x^2 = 1 - y^2 - z^2 \implies f(x,y,z) = 1 - y^2 - z^2 + 2y^2 + 3z^2= 1+y^2+2z^2\ge 1$, and this is the minimum of $f$ which is achieved when $y = z = 0, x = \pm 1$. For the max, we have $f_y = 2y, f_z = 4z$, and $f_y = 0 = f_z \implies y = 0 = z$ which is the only critical point in the domain $D = [-1,1]\times [-1,1]= \{(y,z): -1 \le y, z \le 1\}$ of $f$. Thus evaluating the values of $f$ at the boundary points which are $(y,z) = (\pm 1, 0), (0,\pm 1)$, we have the max is $3$ when $x = 0, y = 0, z = \pm 1$.
</s>