I've been given the following constrained optimization problem, but I'm having trouble even getting the critical points out - the numbers just seem way too complicated...
Find the local maxima and minima of the following problem by introducing two Lagrange multipliers: $$f(x_1,x_2,x_3) = 2x_1 + x_2 + x_3$$ Subject to: $$g_1 = x_1^2 + x_2^2 + x_3^2 = 2, g_2 = x_1^2 + (x_2-1)^2 + x_3^2 = 3$$
So first, I set my Lagrangian, $L$;
$$L = f + \lambda_1 g_1 + \lambda_2 g_2$$ $$L = 2x_1 + x_2 + x_3 + \lambda_1 (x_1^2 + x_2^2 + x_3^2 - 2) + \lambda_2 (x_1^2 + x_2^2 -2x_2 + x_3^2 - 2)$$
Then, calculating the gradient of $L$, I get the following three equations; $$2 + 2x_1 (\lambda_1 + \lambda_2) = 0$$ $$1 + 2x_2 (\lambda_1 + \lambda_2) - 2\lambda_2 = 0$$ $$1 + 2x_3 (\lambda_1 + \lambda_2) = 0$$
Now, for starters, I did the following operation;
$$g_1 - g_2 : 2x_2 = 0$$ $$x_2 = 0$$
Then, we have;
$$1 + 0 * (\lambda_1 + \lambda_2) - 2\lambda_2 = 0$$
So, we have $\lambda_2 = \frac{1}{2}$
Now, here's where I start running into problems. With $\lambda_2 = \frac{1}{2}$, we get; $$2 + 2x_1 (\lambda_1 + \frac{1}{2}) = 0$$ $$1 + 2x_3 (\lambda_1 + \frac{1}{2}) = 0$$
Rearranging these equations, we get; $$\lambda_1 = \frac{-1}{x_1} - \frac{1}{2} = \frac{-1}{2x_3} - \frac{1}{2}$$
Clearly, we can see that $x_1 = 2x_3$.
Now, with $x_2 = 0$, $g_1$ and $g_2$ imply that; $$(2x_3)^2 + x_3^2 = 2$$ $$x_3 = \pm\sqrt{\frac{2}{5}}$$ $$x_1 = \pm2\sqrt{\frac{2}{5}}$$
Now, it's pretty evident to see from here that the $\lambda_1$ value is going to look absolutely terrible, which clearly makes working with the Hessian and Bordered Hessian matrices pretty horrible.
Has my working thus far been correct?? For an assigned problem, these numbers really seem very horrible.