<s>[INST] Using Lagrange's Method in Finding Extreme Values of $x^2 + y^2 + z^2$ for $\frac{x^2}{a^2}+\frac{y^2}{b^2}+\frac{z^2}{c^2}=1$ (New to This Method) Did I do this hw question correctly (at least in theory, I do not expect anyone to check my algebra work)? In particular, did I solve for lambda and plug lambda back into my equations for x,y, and z correctly, or is there a better way? Something does not feel right about it. Thanks!
Apply Lagrange's method in finding the extreme values $x^2 + y^2 + z^2$ subject to the constraint $\frac{x^2}{a^2} + \frac{y^2}{b^2} + \frac{z^2}{c^2} = 1$, where $a > b > c > 0$.
Here is my work thus far:
Let $f(x,y,z) = x^2 + y^2 + z^2$, and let  $g(x,y,z) - k = \frac{x^2}{a^2} + \frac{y^2}{b^2} + \frac{z^2}{c^2} - 1$.
Then let $u=f(x,y,z) + \lambda(g(x,y,z) - k)$. This gives us: $$u=(x^2 + y^2 + z^2) + \lambda\frac{x^2}{a^2} + \lambda\frac{y^2}{b^2} + \lambda\frac{z^2}{c^2} - \lambda$$
Taking the partial of u with respect to each variable (including lambda) and setting it equal to zero, we get:
$u_x = 2x + \frac{2\lambda x}{a^2} = 0$
$u_y = 2y + \frac{2\lambda y}{b^2} = 0$
$u_z = 2z + \frac{2\lambda z}{c^2} = 0$
$u_\lambda = \frac{x^2}{a^2} + \frac{y^2}{b^2} + \frac{z^2}{c^2} = 1$
Solving for x, y, and z, we get $x = -\frac{\lambda}{a^2},\ y = -\frac{\lambda}{b^2},\ z = -\frac{\lambda}{c^2}$, which we can plug into our partial, $u_\lambda$, for x, y, and z. In our partial, we get $$\frac{\lambda^2}{a^6} + \frac{\lambda^2}{b^6} + \frac{\lambda^2}{c^6} = 1$$
Solving for $\lambda$ gives us the  difficult solution of $$\lambda = \pm \frac{a^3b^3c^3}{\sqrt{a^6b^6 + a^6c^6 + b^6c^6}}$$
Since $a,\ b,\ c>0$, the plugging in the positive solution for $\lambda$ will give us our max and vice versa for the min (if the function were odd, see below). Plugging $\lambda$ into our x, y, and z equations yield:
$x = \pm \frac{ab^3c^3}{\sqrt{a^6b^6 + a^6c^6 + b^6c^6}}$
$y = \pm \frac{a^3bc^3}{\sqrt{a^6b^6 + a^6c^6 + b^6c^6}}$
$z = \pm \frac{a^3b^3c}{\sqrt{a^6b^6 + a^6c^6 + b^6c^6}}$
Since f is even (each variable is raised to the second power), then either the positive or negative solution will give a positive result.
 [/INST] Setting $f_x=\lambda g_x, \;f_y=\lambda g_y, \;f_z=\lambda g_z$ gives
$\;\;\displaystyle2x=\lambda\cdot\frac{2x}{a^2}, \;\;2y=\lambda\cdot\frac{2}{b^2},\;\;2 z=\lambda\cdot\frac{2z}{c^2}$.
Therefore $\textbf{1)}$ $x=0$ or $\lambda=a^2\;\;\;$$\textbf{2)}$ $y=0$ or $\lambda=b^2\;\;\;$ $\textbf{3)}$ $z=0$ or $\lambda=c^2$
Since $\displaystyle\frac{x^2}{a^2}+\frac{y^2}{b^2}+\frac{z^2}{c^2}=1$ and $a>b>c$, this implies that either
$\textbf{A)}$ $x=0, y=0, z^2=c^2\;\;$  or$\;\;$ $\textbf{B)}$ $x=0, z=0, y^2=b^2\;\;$ or$\;\;$ $\textbf{C)}$ $y=0, z=0, x^2=a^2$.
Therefore $x^2+y^2+z^2$ has largest value $a^2$ and smallest value $c^2$.
</s>