Optimization problem in KKT $(x_{1}-1)^2+(x_{2}-2)^2$

67 Views Asked by At

Given an optimization as follows: \begin{align} \text{minimize}\quad (x_{1}-1)^2+(x_{2}-2)^2 \\ \text{subject to}\quad (x_{1}-1)^2 = 5x_{2} \quad \\ \end{align}

Guys I'm new here, I'm with this problem that I can not solve.

My resolution

Lagrangian

$L(x_{1},x_{2}, \lambda ) = (x_{1}-1)^2+(x_{2}-2)^2+\lambda(x_{1}^2-2x_{1}-5x_{2}+1)$

$\frac{\partial L }{\partial x_{1}} = 2\left(x_1-1\right) + 2\lambda x_{1} - 2 \lambda = 0$

$\frac{\partial L }{\partial x_{2}} = 2\left(x_2-2\right)-5\lambda = 0$

$\frac{\partial L }{\partial \lambda} = x_{1}^2-2x_{1}-5x_{2}+1 = 0$

$\lambda = \frac{2\left(x_2-2\right)}{5}$

How do I find the optimal solution? I don't know what to do

3

There are 3 best solutions below

2
On BEST ANSWER

So our two equations you found combined imply that

$$ \lambda = \frac{2(x_2 -2)}{5} $$

[I didn't check this and will just assume you did the algebra correctly].

So now what to do with this information? We need to go ahead and grab one of your unused original equations. I will select

$$ \frac{\partial L}{\partial x_1} = 0 \rightarrow (2 x_2 - 2) - 5 \lambda = 0$$

And we need to recall the third equation you forgot

$$ \frac{\partial L}{\partial \lambda } = 0 $$

This of course just gives

$$ (x_1 - 1)^2 - 5x_2 = 0 $$

Which you might recognize as the original constraint. (The derivative w.r.t the lagrange parameter always gives the constraint)

So now we have our three equations

$$ \lambda = \frac{2(x_2 - 2)}{5} $$ $$ 2(x_1 - 1) + 2\lambda (x_1 - 1) = 0 $$ $$ (x_1 - 1)^2 - 5x_2 = 0 $$

We eliminate the $\lambda$ term.

$$ 2(x_1 - 1) - 2(x_1 - 1) \frac{2(x_2 - 2)}{5} = 0$$ $$ (x_1 -1)^2 - 5x_2 = 0$$

And now we can solve this system of two equations in two unknowns but observe carefully a little earlier:

$$ 2(x_1 - 1) + 2\lambda (x_1 - 1) = 0 $$

Implies

$$ 2(x_1 - 1)(1 + \lambda) = 0 $$

So this simplifies your work considerably see @subrosar's answer for how that works/how to observe that trick even earlier in the problem.

2
On

The first partial of the Lagrangian simplifies to $2(x_1-1)(1+\lambda),$ so either $x_1=1$ or $\lambda=-1.$ If $x_1=1$ then the constraint tells us $x_2=0.$ If $\lambda=-1$ then the constraint on the second partial tells us $x_2=-\frac{1}{2}.$

0
On

Steps required:

Substitute $ x_2-2 = \frac52\lambda $ into $\frac{\partial L}{\partial x_2}$, you get a linear equation only in $\lambda$. Hence you can solve for $\lambda$.

After you get $\lambda$, you can solve for $x_1$ using $\frac{\partial L}{\partial x_1}$.

Now you can use the constraint to fidn the value of $x_2$.