# Trouble about first order optimality conditions for programming problems with equality constraint.

I am having trouble understanding the following question.

Question. Take the following non-linear programming problem.

$$\begin{equation*} \min f(x_1,x_2,x_3) = x_1^2-3x_1x_2+x_2^2+x_3^2 \\[.15cm] \text{s.t.} \hspace{1cm} x_1+x_2+x_3 = 6 \end{equation*}$$

Indicate the necessary optimality conditions (of first order) and show that $$x^* = (4,4,-2)$$ is a global minimum for the given problem.

My idea and knowledge. We are working with a non linear programming problem that has equality constraints. I know that, if we were working with a problem that had no constraints at all, the optimality condition of first order would simply be $$\nabla f(x_1,x_2,x_3) = 0$$. The only optimality conditions I know for equality constraint problems are the geometric conditions, the KKT conditions and the FJ conditions which I don't know as being first order conditions.

Related to the second question, my idea was to show that in the given point, the KKT conditions are satisfied and also to show that $$H_f(4,4,-2)$$ ($$H$$ represents the Hessian matrix) is semidefinite positive and the given equality constraint is linear, and thus the KKT conditions are sufficient (thus the given point is a global minimum).

Thanks for any help in advance.

Solution using elementary methods: $$f(x_1,x_2,x_3)=x_1^2+x_2^2-3x_1x_2+(6-x_1-x_2)^2=(x_1+x_2)^2-5x_1x_2+(x_1+x_2-6)^2$$ Define, $$x_2+x_2=s\implies s^2\ge4x_1x_2$$, since $$x_1^2+x_2^2\ge 2x_2x_2$$ for all reals. $$f(x_1,x_2,x_3)\ge s^2-\frac{5s^2}{4}+(s-6)^2=\frac{3}{4}s^2-12s+36=\frac{3}{4}(s-8)^2-12.$$ Hence, the minima is $$-12$$ at $$s=x_1+x_2=8$$.