<p>Actually you can use the normal KT condition. However, you need to explicitly add the non-negativity constraints <span class="math-container">$x, y, z \ge 0$</span> as additional inequality constraints when specifying the Lagrangian.</p>
<p>So the Lagrangian looks like this:
<span class="math-container">$$
L = 2xy + yz - \lambda(x + y + 2z - 1) + \mu(x-0) + \delta(y - 0) + \eta(z - 0).
$$</span>
Here <span class="math-container">$\mu, \delta, \eta$</span> are the three Lagrange multipliers for the three non-negativity constraints <span class="math-container">$x \ge 0, y \ge 0$</span> and <span class="math-container">$z \ge 0$</span>.</p>
<p>The KT first order conditions are:
<span class="math-container">$$
\begin{align*}
&amp;2 y - \lambda + \mu = 0,\\
&amp;2x + z - \lambda + \delta = 0,\\
&amp;y - 2 \lambda + \eta = 0,\\
&amp;\lambda(x + y + 2z - 1) = 0,\\
&amp;\mu x = 0,\\
&amp;\delta y = 0,\\
&amp;\eta z = 0.
\end{align*}
$$</span>
The 1st and 5th can be used to get rid of <span class="math-container">$\mu$</span>. In particular, notice that (from the 5th condition) either <span class="math-container">$\mu = 0$</span> or <span class="math-container">$x = 0$</span>. So, we get the condition:
<span class="math-container">$$
x(2y - \lambda) = 0.
$$</span>
Indeed, if <span class="math-container">$x = 0$</span> then above condition is always satisfied. If <span class="math-container">$x &gt; 0$</span> then <span class="math-container">$\mu = 0$</span>, so by the 1st condition (setting <span class="math-container">$\mu = 0$</span>) we get <span class="math-container">$2 y - \lambda = 0$</span>.</p>
<p>Similarly, the 2nd and 6th condition can be combined to:
<span class="math-container">$$
y(2 x + z - \lambda) = 0,
$$</span>
and the 3rd and 7th condition can be combined to:
<span class="math-container">$$
z(y - 2 \lambda) = 0.
$$</span></p>

CC BY-SA 4.0
2024-03-14T16:30:28.597Z
Thank you so much! A question: could I do some trick like solving the problem with only the first constraint, and only in the end check if the points I found have all positive coordinates?
Heidegger
CC BY-SA 4.0
2024-03-14T10:16:48.700Z
2024-03-14T10:16:48.700Z
tdm
<p>The generalized Lagrangian function is:
<span class="math-container">$$L(x,y,\lambda) = 2xy+yz+\lambda (1-x-y-2z)$$</span>
The Kuhn-Tucker conditions for maximum:
<span class="math-container">$$\begin{cases} L_x=2y-\lambda \le0, \quad \quad \quad \quad x\ge 0, \quad xL_x=0\\
L_y=2x+z-\lambda \le 0 , \quad \ \quad y\ge 0, \quad yL_y=0\\
L_z=y-2\lambda\le0, \quad \ \quad \quad \ \ \ z\ge 0, \quad zL_z=0\\
L_\lambda = 1-x-y-2z\ge 0 , \ \  \lambda\ge 0, \quad \lambda L_\lambda=0
\end{cases}$$</span>
Now you need to check 16 cases (each of <span class="math-container">$x,y,z,\lambda$</span> is zero or positive). However, you can take shortcuts.</p>
<p>If <span class="math-container">$\lambda=0$</span>, then from the 1st and/or 3rd inequalities we get <span class="math-container">$y=0$</span>.</p>
<ol>
<li><span class="math-container">$x=z=0$</span>, so <span class="math-container">$\color{red}{f(0,0,0)=0}$</span></li>
<li><span class="math-container">$x=0,z&gt;0$</span> or <span class="math-container">$x&gt;0,z=0$</span> or <span class="math-container">$x&gt;0,z&gt;0$</span> are impossible, because 2nd equation fails.</li>
</ol>
<p>If <span class="math-container">$\lambda&gt;0$</span>, then:</p>
<ol>
<li><span class="math-container">$x,y,z=0$</span> is impossible, because <span class="math-container">$L_\lambda \ne 0$</span>.</li>
<li><span class="math-container">$x=y=0,z&gt;0$</span> is impossible, because <span class="math-container">$L_z=0\Rightarrow \lambda=0$</span> (contradiction).</li>
<li><span class="math-container">$x=0,y&gt;0,z=0$</span> is impossible, because <span class="math-container">$L_y=0 \Rightarrow \lambda=0$</span> (contradiction).</li>
<li><span class="math-container">$x&gt;0,y=z=0$</span> is impossible, because <span class="math-container">$L_x=0 \Rightarrow \lambda=0$</span> (contradiction).</li>
<li><span class="math-container">$x=0,y&gt;0,z&gt;0$</span>, then <span class="math-container">$\begin{cases}L_y=0 \\ L_z=0 \\ L_\lambda =0\end{cases}\Rightarrow (y,z,\lambda)=(0.5,0.25,0.25)$</span> So, <span class="math-container">$\color{red}{f=0.125}$</span>.</li>
<li><span class="math-container">$x&gt;0,y=0, z&gt;0$</span> is impossible, because <span class="math-container">$L_z=0 \Rightarrow \lambda=0$</span> (contradiction).</li>
<li><span class="math-container">$x&gt;0,y&gt;0,z=0$</span>, then <span class="math-container">$\begin{cases}L_x=0 \\ L_y=0 \\ L_\lambda =0\end{cases}\Rightarrow (x,y,\lambda)=(0.5,0.5,1)$</span> So, <span class="math-container">$\color{red}{f=0.5 \text{ (max)}}$</span>.</li>
<li><span class="math-container">$x&gt;0,y&gt;0,z&gt;0$</span> is impossible, because <span class="math-container">$\begin{cases}L_x=0 \\ L_z=0\end{cases}\Rightarrow \begin{cases}y=0.5\lambda \\ y=2\lambda\end{cases}$</span> (contradiction).</li>
</ol>

CC BY-SA 4.0
2024-03-21T07:42:12.403Z
2024-03-21T07:42:12.403Z
farruhota
<p>I have this optimisation problem:</p>
<p><span class="math-container">$$f(x, y, z) = 2xy + yz \qquad \text{subject to} \qquad \begin{cases} x+y+2z \leq 1 \\ x \geq 0, y \geq 0, z\geq 0 \end{cases}$$</span></p>
<p>I solved it with &quot;a certain writing of KT conditions&quot; but with &quot;the usual KT&quot; conditions I cannot solve it.</p>
<p>The point that gives the max is <span class="math-container">$(1/2, 1/2, 0)$</span>.</p>
<p>What I mean is this: creating the Lagrangian:</p>
<p><span class="math-container">$$L = 2xy + yz - \lambda(x+y+2z-1)$$</span></p>
<p><strong>Usual KT conditions</strong></p>
<p><span class="math-container">$$\begin{cases}
2y - \lambda = 0 \\
2x+z - \lambda = 0 \\
y - 2\lambda = 0 \\
x+y+2z = 1 \\
\lambda(x+y+2z-1) \leq 0 
\end{cases}
$$</span></p>
<p>If <span class="math-container">$\lambda = 0$</span> I get <span class="math-container">$(-1/3, 0, 2/3)$</span> not admissible. If <span class="math-container">$\lambda \neq 0$</span> I get <span class="math-container">$y = 0$</span> and I cannot solve for <span class="math-container">$x$</span> and <span class="math-container">$z$</span>. In any case the solution is wrong.</p>
<p><strong>Different KT conditions</strong></p>
<p>Those are not really &quot;different&quot;, but they come from the notes I found online. Basically they state that since <span class="math-container">$x, y, z \geq 0$</span> I have to add complementarity equations, that is:</p>
<p><span class="math-container">$$\begin{cases}
2y - \lambda = 0 \quad ; \quad x(2y - \lambda) = 0\\
2x+z - \lambda = 0 \quad ; \quad y(2x+z - \lambda) = 0\\
y - 2\lambda = 0 \quad ; \quad z(y - 2\lambda) = 0\\
x+y+2z = 1 \\
\lambda(x+y+2z-1) \leq 0 
\end{cases}
$$</span></p>
<p>From this, solving and paying attention, I can really find the desired solution.</p>
<p>Can someone please explain me better why I cannot solve the problem with &quot;usual&quot; KT conditions?</p>

<mathematical-economics><optimization>
Why this optimisation problem cannot be solved with "usual" KT conditions?
Heidegger
# Why this optimisation problem cannot be solved with "usual" KT conditions?

(Asked by: username_0 on 2024-03-14)

I have this optimisation problem:

$$f(x, y, z) = 2xy + yz \qquad \text{subject to} \qquad \begin{cases} x+y+2z \leq 1 \\ x \geq 0, y \geq 0, z\geq 0 \end{cases}$$

I solved it with "a certain writing of KT conditions" but with "the usual KT" conditions I cannot solve it.

The point that gives the max is $(1/2, 1/2, 0)$.

What I mean is this: creating the Lagrangian:

$$L = 2xy + yz - \lambda(x+y+2z-1)$$

**Usual KT conditions**

$$\begin{cases}
2y - \lambda = 0 \\
2x+z - \lambda = 0 \\
y - 2\lambda = 0 \\
x+y+2z = 1 \\
\lambda(x+y+2z-1) \leq 0
\end{cases}
$$

If $\lambda = 0$ I get $(-1/3, 0, 2/3)$ not admissible. If $\lambda \neq 0$ I get $y = 0$ and I cannot solve for $x$ and $z$. In any case the solution is wrong.

**Different KT conditions**

Those are not really "different", but they come from the notes I found online. Basically they state that since $x, y, z \geq 0$ I have to add complementarity equations, that is:

$$\begin{cases}
2y - \lambda = 0 \quad ; \quad x(2y - \lambda) = 0\\
2x+z - \lambda = 0 \quad ; \quad y(2x+z - \lambda) = 0\\
y - 2\lambda = 0 \quad ; \quad z(y - 2\lambda) = 0\\
x+y+2z = 1 \\
\lambda(x+y+2z-1) \leq 0
\end{cases}
$$

From this, solving and paying attention, I can really find the desired solution.

Can someone please explain me better why I cannot solve the problem with "usual" KT conditions?

**Tags:** mathematical-economics, optimization

---

## 2 answers

### Answer by username_1 on 2024-03-14. Score: 3

Actually you can use the normal KT condition. However, you need to explicitly add the non-negativity constraints $x, y, z \ge 0$ as additional inequality constraints when specifying the Lagrangian.

So the Lagrangian looks like this:
$$
L = 2xy + yz - \lambda(x + y + 2z - 1) + \mu(x-0) + \delta(y - 0) + \eta(z - 0).
$$
Here $\mu, \delta, \eta$ are the three Lagrange multipliers for the three non-negativity constraints $x \ge 0, y \ge 0$ and $z \ge 0$.

The KT first order conditions are:
$$
\begin{align\*}
&2 y - \lambda + \mu = 0,\\
&2x + z - \lambda + \delta = 0,\\
&y - 2 \lambda + \eta = 0,\\
&\lambda(x + y + 2z - 1) = 0,\\
&\mu x = 0,\\
&\delta y = 0,\\
&\eta z = 0.
\end{align\*}
$$
The 1st and 5th can be used to get rid of $\mu$. In particular, notice that (from the 5th condition) either $\mu = 0$ or $x = 0$. So, we get the condition:
$$
x(2y - \lambda) = 0.
$$
Indeed, if $x = 0$ then above condition is always satisfied. If $x > 0$ then $\mu = 0$, so by the 1st condition (setting $\mu = 0$) we get $2 y - \lambda = 0$.

Similarly, the 2nd and 6th condition can be combined to:
$$
y(2 x + z - \lambda) = 0,
$$
and the 3rd and 7th condition can be combined to:
$$
z(y - 2 \lambda) = 0.
$$

> **Comments:**
> **username_0**: Thank you so much! A question: could I do some trick like solving the problem with only the first constraint, and only in the end check if the points I found have all positive coordinates?  

---

### Answer by username_2 on 2024-03-21. Score: 1

The generalized Lagrangian function is:
$$L(x,y,\lambda) = 2xy+yz+\lambda (1-x-y-2z)$$
The Kuhn-Tucker conditions for maximum:
$$\begin{cases} L\_x=2y-\lambda \le0, \quad \quad \quad \quad x\ge 0, \quad xL\_x=0\\
L\_y=2x+z-\lambda \le 0 , \quad \ \quad y\ge 0, \quad yL\_y=0\\
L\_z=y-2\lambda\le0, \quad \ \quad \quad \ \ \ z\ge 0, \quad zL\_z=0\\
L\_\lambda = 1-x-y-2z\ge 0 , \ \ \lambda\ge 0, \quad \lambda L\_\lambda=0
\end{cases}$$
Now you need to check 16 cases (each of $x,y,z,\lambda$ is zero or positive). However, you can take shortcuts.

If $\lambda=0$, then from the 1st and/or 3rd inequalities we get $y=0$.

1. $x=z=0$, so $\color{red}{f(0,0,0)=0}$
2. $x=0,z>0$ or $x>0,z=0$ or $x>0,z>0$ are impossible, because 2nd equation fails.

If $\lambda>0$, then:

1. $x,y,z=0$ is impossible, because $L\_\lambda \ne 0$.
2. $x=y=0,z>0$ is impossible, because $L\_z=0\Rightarrow \lambda=0$ (contradiction).
3. $x=0,y>0,z=0$ is impossible, because $L\_y=0 \Rightarrow \lambda=0$ (contradiction).
4. $x>0,y=z=0$ is impossible, because $L\_x=0 \Rightarrow \lambda=0$ (contradiction).
5. $x=0,y>0,z>0$, then $\begin{cases}L\_y=0 \\ L\_z=0 \\ L\_\lambda =0\end{cases}\Rightarrow (y,z,\lambda)=(0.5,0.25,0.25)$ So, $\color{red}{f=0.125}$.
6. $x>0,y=0, z>0$ is impossible, because $L\_z=0 \Rightarrow \lambda=0$ (contradiction).
7. $x>0,y>0,z=0$, then $\begin{cases}L\_x=0 \\ L\_y=0 \\ L\_\lambda =0\end{cases}\Rightarrow (x,y,\lambda)=(0.5,0.5,1)$ So, $\color{red}{f=0.5 \text{ (max)}}$.
8. $x>0,y>0,z>0$ is impossible, because $\begin{cases}L\_x=0 \\ L\_z=0\end{cases}\Rightarrow \begin{cases}y=0.5\lambda \\ y=2\lambda\end{cases}$ (contradiction).


---

