0

Optimization, under costraint $f(x_1,\ldots,x_n)=\sum a_k x_k^2$ under the constraint $\sum x_k =c$ with $a_k > 0,$ $k=1,\ldots,n$

The associated Lagrangian is : $L(x_1,\ldots, x_n)=f(x_1,\ldots,x_n)+ \lambda(\sum x_k -c)$

How to deduce that: $\lambda = \dfrac{-2c}{\sum \dfrac 1 {a_k}}$ and the value of $x_k$

I can not show it, someone can help me thanks

mlc
  • 5,478
  • Very difficult to follow what you ask because no index is represented as an index. $a_k$ for example is obtained by typing five items: "dollar sign", "a", "underscore" symbol, then "k", then "dollar sign". Thanks to @Michael Hardy for fixing it... – Jean Marie Apr 24 '17 at 19:20
  • Your Lagrangian had no $\lambda$ and one extra equality sign. Let me fix this. – mlc Apr 24 '17 at 19:24
  • @JeanMarie: I am not French, but "je approuve". Fixed this as well. – mlc Apr 24 '17 at 19:34

2 Answers2

2

You can also argue via Cauchy-Schwarz inequality. First, $$ \left(\sum_k a_k x_k^2 \right)\left(\sum_{k}\frac{1}{a_k}\right) \geq \left(\sum_k |x_k|\right)^2 \geq \left(\sum_k x_k\right)^2 = c^2. $$

Equality holds if and only if, $$ \frac{a_k x_k^2}{\frac{1}{a_k}} $$ is constant, namely if and only if, $x_k$ is proportional with $\frac{1}{a_k}$. Letting $x_k =\theta \frac{1}{a_k}$, we obtain $$ \theta = \frac{c}{\sum_k \frac{1}{a_k}} \implies x_k = \frac{c\frac{1}{a_k}}{\sum_k \frac{1}{a_k}}. $$

TBTD
  • 3,516
1

Differentiating the Lagrangian wrt to $x_k$ gives you $$2a_k x_k + \lambda = 0 \qquad \mbox{for } k=1,\ldots,n$$ that yields $$x_k = -\frac{\lambda}{2a_k} \mbox{for } $k=1,\ldots,n$$ Replace these in the constraint $\sum_k x_k = c$ to obtain $$\lambda = - \frac{2c}{\sum_k (1/a_k)}$$ Plug $\lambda$ back into the equation for $x_k$ and get $$x_k = c \left( \frac{(1/a_k)}{\sum_k (1/a_k)}\right)$$

mlc
  • 5,478