<p>The way I’d do it is to simply optimize the usual Lagrangian</p>
<p><span class="math-container">$\mathcal{L} = f(x,y) + \lambda (k - g(x,y))$</span>.</p>
<p>If all variables end up being non-negative, that is your solution.</p>
<p>If any variable, let’s say <span class="math-container">$x$</span> ends up being negative, you take <span class="math-container">$x^\star = 0$</span> in your optimal solution, then substitute and solve for the other variables.</p>
<p>An alternative way to solve it but a bit more complicated is to optimize the bigger Lagrangian you proposed</p>
<p><span class="math-container">$\mathcal{L}(x, y, λ) = f(x,y) + λ_1(k - g(x,y)) +λ_x(x) + λ_y(y)$</span>.</p>
<p>When the variables would’ve still been non-negative without adding the non-negativity constraints, you’d get <span class="math-container">$\lambda_x = \lambda_y = 0$</span>.</p>
<p>This could be interpreted as the constraints being non-binding, therefore representing no marginal benefit/cost as in your other question: <a href="https://economics.stackexchange.com/questions/55275/lagrange-multiplier-duel-meaning/55278#55278">Lagrange Multiplier Dual Meaning?</a></p>

CC BY-SA 4.0
2023-05-06T14:37:50.157Z
Hi Nicholas, thanks again for this! I appreciate wha you are saying here, and in principle it make sense. If no $x \le 0$, then all those non-negativity constraints disapear. However my concern is for when we "test" for $x = 0$. With the context of this question in mind, I'd be so grateful if you could check out the linked question below. In it my original question at the top, and then i post an answer trying to clarify the question further. Thanks so much! https://economics.stackexchange.com/questions/55161/missing-non-negativity-constraint/55296#55296
CormJack
CC BY-SA 4.0
2023-05-03T12:58:35.283Z
2023-05-03T12:58:35.283Z
Nicolas Torres
<p>When we take our Lagrangian and we include non-negativity constraints. If a variable <span class="math-container">$x = 0$</span> do we take FOC first or set <span class="math-container">$x=0$</span> first?</p>
<p>E.g.</p>
<p><span class="math-container">$Max \; L(x, y, λ) = f(x,y) - λ_1(g(x,y) - k) - λ_x(-x) - λ_y(-y)$</span></p>
<p>Or alternately written as :</p>
<p><span class="math-container">$Max \;(x, y, λ) = f(x,y) + λ_1(k - g(x,y)) +λ_x(x) + λ_y(y)$</span></p>
<p>In the case where one of our variables is actually = 0,
E.g. <span class="math-container">$x=0$</span> hence <span class="math-container">$λ_x &gt; 0$</span></p>
<ol>
<li>Do we differentiate first getting the FOC.</li>
</ol>
<blockquote>
<p><span class="math-container">$\frac{\partial d}{\partial x} = f_x - λ_1g_x + λ_x \le 0$</span></p>
</blockquote>
<ol start="2">
<li>Or do we take <span class="math-container">$x = 0$</span> first and then derive our FOC.</li>
</ol>
<blockquote>
<p><span class="math-container">$\frac{\partial d}{\partial x} = f_x - λ_1g_x\le 0$</span></p>
</blockquote>
<ul>
<li><p>The reason i ask is that i assumed it would be the first way. Because otherwise what is the point of the Lagrange multiplier for the non-negativity constraint. Either it's 0 because <span class="math-container">$x &gt; 0$</span> or it disappears because we get <span class="math-container">$λ(0) = 0)$</span> in the Lagrangian.</p>
</li>
<li><p><strong>The mark scheme for this <a href="https://economics.stackexchange.com/questions/55161/missing-non-negativity-constraint">question i asked here</a> would suggest it's actually the second approach</strong>? This tiny thing ruined the rest of my analysis, as the following questions relied on their being no <span class="math-container">$λ_κ$</span>.</p>
</li>
<li><p>This problem is really bugging me as exam commentaries are incredibly vague as to when they subtly do and don't use non-negativity constraints.  Please let me know your thoughts, thanks!</p>
</li>
</ul>

CC BY-SA 4.0
2023-05-03T16:42:08.477Z
Do you mean that $x=0$ is part of the given information?  Or just that $0$ has to be considered as a possible value of $x$?
Adam Bailey
CC BY-SA 4.0
2023-05-03T18:52:25.000Z
Yes that x = 0 has to be considered in our cases . I.e. the question provides us with no immidiate intuition as to why we can dismiss x = 0. The quetsion I link to at the end, is from an exam and did exactly this with k.
CormJack
CC BY-SA 4.0
2023-05-03T18:53:11.563Z
It’s actually the question that sparked all this for me. As they didn’t explicitly use a non-negativity constraint, but produced a result kind of as if they had assumed a binding non-negativity constraint.
CormJack
<mathematical-economics><optimization><lagrangian>
Non-Negativity Constraints KKT
CormJack
# Non-Negativity Constraints KKT

(Asked by: username_0 on 2023-05-03)

When we take our Lagrangian and we include non-negativity constraints. If a variable $x = 0$ do we take FOC first or set $x=0$ first?

E.g.

$Max \; L(x, y, λ) = f(x,y) - λ\_1(g(x,y) - k) - λ\_x(-x) - λ\_y(-y)$

Or alternately written as :

$Max \;(x, y, λ) = f(x,y) + λ\_1(k - g(x,y)) +λ\_x(x) + λ\_y(y)$

In the case where one of our variables is actually = 0,
E.g. $x=0$ hence $λ\_x > 0$

1. Do we differentiate first getting the FOC.

> $\frac{\partial d}{\partial x} = f\_x - λ\_1g\_x + λ\_x \le 0$

2. Or do we take $x = 0$ first and then derive our FOC.

> $\frac{\partial d}{\partial x} = f\_x - λ\_1g\_x\le 0$

* The reason i ask is that i assumed it would be the first way. Because otherwise what is the point of the Lagrange multiplier for the non-negativity constraint. Either it's 0 because $x > 0$ or it disappears because we get $λ(0) = 0)$ in the Lagrangian.
* **The mark scheme for this [question i asked here](https://economics.stackexchange.com/questions/55161/missing-non-negativity-constraint) would suggest it's actually the second approach**? This tiny thing ruined the rest of my analysis, as the following questions relied on their being no $λ\_κ$.
* This problem is really bugging me as exam commentaries are incredibly vague as to when they subtly do and don't use non-negativity constraints. Please let me know your thoughts, thanks!

**Tags:** mathematical-economics, optimization, lagrangian

> **Comments:**
> **username_1**: Do you mean that $x=0$ is part of the given information?  Or just that $0$ has to be considered as a possible value of $x$?  
> **username_0**: Yes that x = 0 has to be considered in our cases . I.e. the question provides us with no immidiate intuition as to why we can dismiss x = 0. The quetsion I link to at the end, is from an exam and did exactly this with k.  
> **username_0**: It’s actually the question that sparked all this for me. As they didn’t explicitly use a non-negativity constraint, but produced a result kind of as if they had assumed a binding non-negativity constraint.  

---

## 1 answers

### Answer by username_2 on 2023-05-03. Score: 1 | Accepted answer

The way I’d do it is to simply optimize the usual Lagrangian

$\mathcal{L} = f(x,y) + \lambda (k - g(x,y))$.

If all variables end up being non-negative, that is your solution.

If any variable, let’s say $x$ ends up being negative, you take $x^\star = 0$ in your optimal solution, then substitute and solve for the other variables.

An alternative way to solve it but a bit more complicated is to optimize the bigger Lagrangian you proposed

$\mathcal{L}(x, y, λ) = f(x,y) + λ\_1(k - g(x,y)) +λ\_x(x) + λ\_y(y)$.

When the variables would’ve still been non-negative without adding the non-negativity constraints, you’d get $\lambda\_x = \lambda\_y = 0$.

This could be interpreted as the constraints being non-binding, therefore representing no marginal benefit/cost as in your other question: [Lagrange Multiplier Dual Meaning?](https://economics.stackexchange.com/questions/55275/lagrange-multiplier-duel-meaning/55278#55278)

> **Comments:**
> **username_0**: Hi Nicholas, thanks again for this! I appreciate wha you are saying here, and in principle it make sense. If no $x \le 0$, then all those non-negativity constraints disapear. However my concern is for when we "test" for $x = 0$. With the context of this question in mind, I'd be so grateful if you could check out the linked question below. In it my original question at the top, and then i post an answer trying to clarify the question further. Thanks so much! https://economics.stackexchange.com/questions/55161/missing-non-negativity-constraint/55296#55296  

---

