method of Lagrange multipliers to find max or min value Im supposed to find the max/min values of $u$ where $u = x^2 + y^2 + z^2$ where $ax^2 +by^2+cz^2+2fyz+2gzx+2hxy=1 $
I have just learnt the principle of Lagrange multipliers so i tried doing
$\nabla f= \lambda \nabla g$ to this problem but it becomes really really long and I don't think it simplifies too....can anyone please give me a hint of how to proceed in a simple manner?
 A: You are being asked for the eigenvectors (specific multiple to be decided) of
$$
W =
\left(
\begin{array}{ccc}
a&h&g \\
h&b&f \\
g&f&c \\
\end{array}
\right)
$$
Various notes. If $W$ is positive definite, you have an ellipsoid, and a complete answer is possible. If $W$ is negative definite, the given set $x^T W x = 1$ is empty over the reals. 
Anyway, as a column vector, the gradient of $x^T W x$ is just $2Wx.$ The gradient of the other thing is $2x.$ You are being asked for $Wx = \lambda x,$ meaning eigenvector. Suppose we start out by demanding unit eigenvector. Are we done? Well, we need $x^T W x = 1.$ Then $x^T \lambda x = \lambda (x \cdot x) = \lambda |x|^2 = 1.$ So we demand an eigenvector with $|x| = \frac{1}{\sqrt \lambda}$ 
I will need to think what sensible things might be said when $W$ is indefinite; mostly, you still get a minimum if there are any positive eigenvalues, but no maximum if there are any negative eigenvalues, think of hyperbolas.  
A: Calling $p = (x,y,z)^{\dagger}$ we have the lagrangian
$$
L(p,\lambda) = p^{\dagger}\cdot p + \lambda \left(p^{\dagger}\cdot A\cdot p - 1\right)
$$
The stationary conditions are
$$
L_p = 2p^{\dagger}+2\lambda p^{\dagger}\cdot A = 2p^{\dagger}\left(I_3+\lambda A\right) = 0\\
L_{\lambda} = p^{\dagger}\cdot A\cdot p - 1 = 0
$$
From $p^{\dagger}\left(I_3+\lambda A\right) = 0$ we conclude that to have the non trivial solutions we need $\det\left(I_3+\lambda A\right) = 0$
Solving now the third degree polynomial $q_3(\lambda)=\det\left(I_3+\lambda A\right) = 0$ we will obtain $p = \bar p(\mu)$ that should verify $\bar p^{\dagger}(\mu)\cdot A\cdot \bar p(\mu) - 1 = 0$ etc.
NOTE
Supposing 
$$
A = \left(
\begin{array}{ccc}
 1 & 1 & 1 \\
 1 & 4 & 1 \\
 1 & 1 & 5 \\
\end{array}
\right)
$$
we habe
$$
q_3(\lambda) = 12 \lambda ^3+26 \lambda ^2+10 \lambda +1 = (\lambda+0.166667)(\lambda+1.70711)(\lambda+0.292893)=0
$$
now solving
$$
p^{\dagger}\cdot(I_3+\lambda_2 A) = 0
$$
with $\lambda_2 = -1.70711$ we obtain
$$
\bar p_2(\mu) = (\mu,-0.242641 \mu, -0.171573 \mu )
$$
now
$$
\bar p_2(\mu)^{\dagger}\cdot A\cdot \bar p_2(\mu) - 1 = 0.637518 \mu^2 -1 = 0\Rightarrow \mu = \pm 1.25243
$$
then a potential solution is
$$
\bar p_2 = (1.25243,-0.303891, -0.214883)
$$
etc.
