I've been given a problem:
min $f(x) = c^Tx$
s.t.
$\sum_{i}x_i = 0$
$\sum_{i}x^2_i$ = 1
I've created the Lagrangian function
$L(x,\lambda) = c^Tx - \lambda_1\sum_{i}x_i - \lambda_2\left(\left(\sum_{i}x^2_i\right)-1\right)$
But I'm not sure how I can arrive at any particular solution given the $\nabla_x$ of the Lagrangian doesn't really help me. Should I augment the function to be an unconstrained minimization by replacing the values of $x_i$ using the 2 equalities? I'm not sure where to proceed.
You derivate the Lagrangian with respect to each $x_i$ and $\lambda_1$ and $\lambda_2$ and put it equal to 0. $$ \frac{\partial L}{\partial x_i}=c_i-\lambda_1-2x_i\lambda_2=0 \\ \frac{\partial L}{\partial \lambda_1}=-\sum_{i=1}^{n}x_i=0 \\ \frac{\partial L}{\partial \lambda_2}=-\sum_{i=1}^{n}x_i=0 $$ From the first equation, you get: $$ x_i=\frac{c_i-\lambda_1}{2\lambda_2} $$ If you fill it into the second equation, you get $\lambda_1$: $$ \lambda_1=\frac{1}{n}\sum_{i=1}^{n}c_i $$ If you fill it into the third equation, you get $\lambda_2$: $$ \lambda_2 = \pm\frac{1}{2}\sqrt{\sum_{i=1}^{n}(c_i-\lambda_i)} $$ So you have two solutions: $$ x=\pm\frac{c-\frac{1}{n}\sum_i c_i}{||c-\frac{1}{n}\sum_i c_i||_2} $$ And you can easily check that one is minimum and the other one is maximum. The minimum is this one: $$ x=-\frac{c-\frac{1}{n}\sum_i c_i}{||c-\frac{1}{n}\sum_i c_i||_2} $$