I would like to find the coordinates which maximize the function $T(x,y,z)=2x+4xy+3z^2$ under the restriction $x^2+4y^2+4z^2-12=0$.
First, using the method of Lagrange multiplier leads to the answer $(x,y,z)=\left( \sqrt{\frac{47+\sqrt{97}}{8}}, \frac{-1+\sqrt{97}}{8}, 0 \right)$.
But, another direct method that eliminates the z by using restriction condition and equates partial derivatives of T with respect to x and y equals 0 leads to the answer $(x,y,z)=\left( \frac{-12}{7}, \frac{-8}{7}, \pm \frac{\sqrt{47}}{7} \right)$.
The right answer is first method(This problem is in Korean math exam and the answer is opened to the public.
I don't know why the second direct method leads to wrong answer...