Find the vector with $||x||^2=x^Tx=1$ that maximizes the following function.
$f(x) = 2x_1^2+2x_2^2-x_3^3+2x_1x_2$
I have rewritten the quadratic form as
$f(x) = \frac{1}{2}x^T \begin{bmatrix} 4&2&0\\2&4&0\\0&0&-2\end{bmatrix} x$
in which the gradient can be found as $\nabla{f}=Qx+b$ where $b = 0$ But this is exactly the point where I'm stuck.
I want to use the First-order necessary condition to find the maximizer but how can I find the vector that maximizes the function if I can't use the FONC because $b=0$?
EDIT: Due to the comment section I found out that this function is NOT quadratic. So if I just take the gradient I get
$\nabla f(x) = \begin{bmatrix} 4x_1+2x_2\\4x_2+2x_1\\-3x_3^2\end{bmatrix} $ but still, can someone show me how to do it from here?
EDIT2: Using Lagrange multiplier I get the Lagrange function:
$L(x,y) = 2x_1^2+2x_2^2-x_3^3+2x_1x_2-\lambda(x_1^2+x_2^2+x_3^2-1)$
Taking partial derivatives and setting it equal to zero I get
$\begin{bmatrix} 4x_1+2x_2-2\lambda x_1\\4x_2+2x_1-2\lambda x_2\\-3x_3^2-2\lambda x_3\\-x_1^2-x_2^2-x_3^2+1 \end{bmatrix} = \begin{bmatrix} 0\\0\\0\\0\end{bmatrix}$
But I get from the third equation that lambda equals -1 and then filling it in the other equations I get $x_1=0, x_2=0$ and $x_3 = 1$ or $x_3 = -1$ But as the person below kindly showed the answer should be 3.