<p>The two ways of <strong>properly</strong> setting up Lagrangian are completely equivalent (although you have mistakes above) so it does not matter which way you set it up.</p>
<p>You actually have mistake there resulting in the two ways being different:</p>
<p>In the first equation you forgot minus sign since: <span class="math-container">$ \sum_i^l p_i w_i = \sum_i^l p_i x_i \implies 0 = \sum_i^l p_i w_i - \sum_i^l p_i x_i \neq  0 = \sum_i^l p_i w_i + \sum_i^l p_i x_i $</span></p>
<p>Thus the first lagrangian set up properly will look like</p>
<p><span class="math-container">$L_1=u(X)+\lambda (  \sum_i^l p_i w_i - \sum_i^l p_i x_i) = u(X)+\lambda ( \sum_i^l p_i w_i) - \lambda  (\sum_i^l p_i x_i)) $</span></p>
<p>In the second equation you make mistake of forgetting that in the second way of setting up lagrangian the multiplier has negative sign <span class="math-container">$-\lambda$</span> (see  Hammond et al Essential Mathematics for Economic Analysis pp 499  for full explanation why)</p>
<p><span class="math-container">$L_2=u(X)-\lambda (  \sum_i^l p_i x_i -\sum_i^l p_i w_i) = u(X)+\lambda ( \sum_i^l p_i w_i) - \lambda  (\sum_i^l p_i x_i))$</span></p>
<p>Hence clearly both <span class="math-container">$L_1$</span> and <span class="math-container">$L_2$</span> are completely equivalent you just have to set them up without making typos/mistakes.</p>

CC BY-SA 4.0
2020-12-20T16:56:37.807Z
Hi, @imuflon1, I made a typo. At first equation, pw+px should be changed at pw-px. Now, two equation is different (different sing of lambda). You are saying first equation is correct (in modified version) and second equation is wrong. Right? Why second equation is wrong?
martian03
CC BY-SA 4.0
2020-12-20T17:01:34.323Z
@martian03 because depending on how you solve the constraint for zero you need to change sign of lambda - lambda cant just be positive no matter what - the sign of lambda is dictated by constraint i.e. $g(x,y)=c$ can be solved for zero as $0=c-g(x,y)$ and in that case lambda has to be positive $\lambda$ or as $g(x,y)-c=0$ in which case it has to be $-\lambda$.
1muflon1
CC BY-SA 4.0
2020-12-20T11:33:26.000Z
2020-12-20T11:33:26.000Z
1muflon1
<p>It's a matter of choice how one writes the Lagrangian in the context of Lagrange/KKT. Depending on how it's written, the gradients of the objective and constraint functions are either parallel or anti-parallel at a (suitable) optimum, and the Lagrange multiplier is neither negative or positive. At the end of the day, it is the same (subset of) optima that are covered by the Lagrangian FOC.</p>
<p>However, there is a standard choice---sometimes called the <em>standard form</em> in optimization literature---that ensures the Lagrange multipliers <span class="math-container">$\lambda$</span>'s are <strong>non-negative</strong>. (See, for example, <em>Convex Optimization</em> by Boyd and Vandenberghe.)</p>
<p><em><strong>In the standard form, the Lagranian is always written in such a way that it improves the objective function.</strong></em></p>
<p>This convention is not always pointed out/followed in economics texts.
When it is followed in economic contexts, then the Lagrange multipliers admit the usual interpretation as marginal values of the corresponding constraints---a kind of &quot;indirect marginal utility&quot;. E.g. the standard-form Lagrange multiplier is the derivative of the indirect utility function with respect to wealth---which must be non-negative.</p>
<p>For example, consider the maximization problem
<span class="math-container">$$
\max_{g(x) \geq 0} u(x) 
$$</span>
where <span class="math-container">$u : \mathbb{R}^n \rightarrow \mathbb{R}$</span> and <span class="math-container">$g : \mathbb{R}^n \rightarrow \mathbb{R}^p$</span>. E.g. in a consumer's problem, <span class="math-container">$u$</span> is utility function, <span class="math-container">$p = 1$</span>, and <span class="math-container">$g(x) = p^T(w-x)$</span>.</p>
<p>Then the standard form Lagrangian is
<span class="math-container">$$
L(x, \lambda) = u(x) + \lambda^T g(x).
$$</span>
It improves the objective function <span class="math-container">$u$</span> when <span class="math-container">$\lambda \geq 0$</span>. This means that, for maximization problems, <span class="math-container">$L(x, \lambda) \geq u(x)$</span> for all <span class="math-container">$x$</span> and all <span class="math-container">$\lambda \geq 0$</span>.
Since you're trying to maximize <span class="math-container">$u$</span>, improving on <span class="math-container">$u$</span> means being larger than <span class="math-container">$u$</span>.</p>
<ol>
<li><p>In the standard form, the Lagrange multiplers must be non-negative., i.e. at an (suitable) optimum <span class="math-container">$x^*$</span>, we must have <span class="math-container">$D u(x^*) + \lambda^T D g(x^*) = 0$</span> for some <span class="math-container">$\lambda$</span> with <strong>non-negative</strong> entries. This is easy to see, especially in the case of single constraint <span class="math-container">$p = 1$</span>. If constraint <span class="math-container">$g$</span> is slack, then <span class="math-container">$\lambda  = 0$</span>. If <span class="math-container">$g$</span> binds, then the gradient <span class="math-container">$D g(x^*)$</span> must point toward the interior <span class="math-container">$\{ g &gt; 0 \}$</span>. On the other hand, <span class="math-container">$D u(x^*)$</span> cannot point toward the interior---otherwise there would be an optimum in the interior. So <span class="math-container">$D u(x^*)$</span> and <span class="math-container">$D g(x^*)$</span> are anti-parallel and <span class="math-container">$\lambda &gt; 0$</span>.</p>
</li>
<li><p>If the maximization problem is formulated as
<span class="math-container">$$
\max_{g(x) \leq 0} u(x) 
$$</span>
then the standard form Lagrangian is <span class="math-container">$L(x, \lambda) = u(x) - \lambda^T g(x)$</span>. Again, <span class="math-container">$L$</span> is written in such a way that, when <span class="math-container">$\lambda$</span> is non-negative, <span class="math-container">$L$</span> improves <span class="math-container">$u$</span>.
Similar for a minimization problem.</p>
</li>
<li><p>&quot;Suitability&quot; of an optimum means that <span class="math-container">$D g(x^*)$</span> must be full-rank. This type of condition is called <em>constraint qualification</em>. The general KKT theorem says that the Lagrangian FOC is a necessary condition for local optima where constraint qualification holds. When the objective function is concave or quasi-concave (convex or quasi-conconvex, for minimization), then constraint qualification is not needed and Lagrangian FOC is sufficient for global optima.</p>
</li>
</ol>

CC BY-SA 4.0
2020-12-22T00:28:17.523Z
'+1' brilliant explanation and notation. I like the phrase "written in such a way that it improves the objective function." So just to be perfectly clear the standard form has two requirements : 1) $\lambda \geq 0$ for critical points and 2) $L(x,\lambda)$ improves is written so as to improve obejctive function implying that $(+-)\lambda g(x) \geq 0$ for maximization and $(+-)\lambda g(x) \leq 0$ for minimization?
Jesper Hybel
CC BY-SA 4.0
2020-12-22T01:00:24.550Z
@JesperHybel Yes re your comment 2), in particular the $+/-$ in front of $\lambda g(x)$, which points out the choice of $\geq/\leq$ in the inequality constraint. 1) is a consequence, rather than a requirement. If 2) is followed, then $\lambda^*$ must be non-negative at a suitable optimum.
Michael
CC BY-SA 4.0
2020-12-21T23:30:54.023Z
2020-12-22T04:18:48.260Z
2020-12-22T04:18:48.260Z
Michael
<p>Consider a simple consumer's problem:</p>
<p>Max <span class="math-container">$u(X)$</span> s.t.  <span class="math-container">$\sum_i^l p_i x_i\leq \sum_i^l p_i w_i$</span></p>
<p><span class="math-container">$w$</span> is initial endowment.</p>
<p>We can set the Lagrangian function to solve this problem.</p>
<p><span class="math-container">$L=u(X)+\lambda (  \sum_i^l p_i w_i +\sum_i^l p_i x_i)$</span></p>
<p>But some may set the Lagrangian function as differenct way.</p>
<p><span class="math-container">$L=u(X)+\lambda (  \sum_i^l p_i x_i -\sum_i^l p_i w_i)$</span></p>
<p>The result of calculation is same except the sign of Lagrangian multiplier <span class="math-container">$\lambda$</span></p>
<p>For the consumer's problem, which way is correct?</p>
<p><strong>Edit after comment: There is a typo at the first equation in this
question. <span class="math-container">$\sum_i^l p_i w_i +\sum_i^l p_i x_i$</span> should be changed as
<span class="math-container">$\sum_i^l p_i w_i -\sum_i^l p_i x_i$</span></strong></p>

<microeconomics><utility><consumer-theory><optimization><multiplier>
setting of Lagrangian function
martian03
# setting of Lagrangian function

(Asked by: username_0 on 2020-12-20)

Consider a simple consumer's problem:

Max $u(X)$ s.t. $\sum\_i^l p\_i x\_i\leq \sum\_i^l p\_i w\_i$

$w$ is initial endowment.

We can set the Lagrangian function to solve this problem.

$L=u(X)+\lambda ( \sum\_i^l p\_i w\_i +\sum\_i^l p\_i x\_i)$

But some may set the Lagrangian function as differenct way.

$L=u(X)+\lambda ( \sum\_i^l p\_i x\_i -\sum\_i^l p\_i w\_i)$

The result of calculation is same except the sign of Lagrangian multiplier $\lambda$

For the consumer's problem, which way is correct?

**Edit after comment: There is a typo at the first equation in this
question. $\sum\_i^l p\_i w\_i +\sum\_i^l p\_i x\_i$ should be changed as
$\sum\_i^l p\_i w\_i -\sum\_i^l p\_i x\_i$**

**Tags:** microeconomics, utility, consumer-theory, optimization, multiplier

---

## 2 answers

### Answer by username_2 on 2020-12-21. Score: 5 | Accepted answer

It's a matter of choice how one writes the Lagrangian in the context of Lagrange/KKT. Depending on how it's written, the gradients of the objective and constraint functions are either parallel or anti-parallel at a (suitable) optimum, and the Lagrange multiplier is neither negative or positive. At the end of the day, it is the same (subset of) optima that are covered by the Lagrangian FOC.

However, there is a standard choice---sometimes called the *standard form* in optimization literature---that ensures the Lagrange multipliers $\lambda$'s are **non-negative**. (See, for example, *Convex Optimization* by Boyd and Vandenberghe.)

***In the standard form, the Lagranian is always written in such a way that it improves the objective function.***

This convention is not always pointed out/followed in economics texts.
When it is followed in economic contexts, then the Lagrange multipliers admit the usual interpretation as marginal values of the corresponding constraints---a kind of "indirect marginal utility". E.g. the standard-form Lagrange multiplier is the derivative of the indirect utility function with respect to wealth---which must be non-negative.

For example, consider the maximization problem
$$
\max\_{g(x) \geq 0} u(x)
$$
where $u : \mathbb{R}^n \rightarrow \mathbb{R}$ and $g : \mathbb{R}^n \rightarrow \mathbb{R}^p$. E.g. in a consumer's problem, $u$ is utility function, $p = 1$, and $g(x) = p^T(w-x)$.

Then the standard form Lagrangian is
$$
L(x, \lambda) = u(x) + \lambda^T g(x).
$$
It improves the objective function $u$ when $\lambda \geq 0$. This means that, for maximization problems, $L(x, \lambda) \geq u(x)$ for all $x$ and all $\lambda \geq 0$.
Since you're trying to maximize $u$, improving on $u$ means being larger than $u$.

1. In the standard form, the Lagrange multiplers must be non-negative., i.e. at an (suitable) optimum $x^\*$, we must have $D u(x^\*) + \lambda^T D g(x^\*) = 0$ for some $\lambda$ with **non-negative** entries. This is easy to see, especially in the case of single constraint $p = 1$. If constraint $g$ is slack, then $\lambda = 0$. If $g$ binds, then the gradient $D g(x^\*)$ must point toward the interior $\{ g > 0 \}$. On the other hand, $D u(x^\*)$ cannot point toward the interior---otherwise there would be an optimum in the interior. So $D u(x^\*)$ and $D g(x^\*)$ are anti-parallel and $\lambda > 0$.
2. If the maximization problem is formulated as
   $$
   \max\_{g(x) \leq 0} u(x)
   $$
   then the standard form Lagrangian is $L(x, \lambda) = u(x) - \lambda^T g(x)$. Again, $L$ is written in such a way that, when $\lambda$ is non-negative, $L$ improves $u$.
   Similar for a minimization problem.
3. "Suitability" of an optimum means that $D g(x^\*)$ must be full-rank. This type of condition is called *constraint qualification*. The general KKT theorem says that the Lagrangian FOC is a necessary condition for local optima where constraint qualification holds. When the objective function is concave or quasi-concave (convex or quasi-conconvex, for minimization), then constraint qualification is not needed and Lagrangian FOC is sufficient for global optima.

> **Comments:**
> **username_3**: '+1' brilliant explanation and notation. I like the phrase "written in such a way that it improves the objective function." So just to be perfectly clear the standard form has two requirements : 1) $\lambda \geq 0$ for critical points and 2) $L(x,\lambda)$ improves is written so as to improve obejctive function implying that $(+-)\lambda g(x) \geq 0$ for maximization and $(+-)\lambda g(x) \leq 0$ for minimization?  
> **username_2**: @JesperHybel Yes re your comment 2), in particular the $+/-$ in front of $\lambda g(x)$, which points out the choice of $\geq/\leq$ in the inequality constraint. 1) is a consequence, rather than a requirement. If 2) is followed, then $\lambda^*$ must be non-negative at a suitable optimum.  

---

### Answer by username_1 on 2020-12-20. Score: 1

The two ways of **properly** setting up Lagrangian are completely equivalent (although you have mistakes above) so it does not matter which way you set it up.

You actually have mistake there resulting in the two ways being different:

In the first equation you forgot minus sign since: $ \sum\_i^l p\_i w\_i = \sum\_i^l p\_i x\_i \implies 0 = \sum\_i^l p\_i w\_i - \sum\_i^l p\_i x\_i \neq 0 = \sum\_i^l p\_i w\_i + \sum\_i^l p\_i x\_i $

Thus the first lagrangian set up properly will look like

$L\_1=u(X)+\lambda ( \sum\_i^l p\_i w\_i - \sum\_i^l p\_i x\_i) = u(X)+\lambda ( \sum\_i^l p\_i w\_i) - \lambda (\sum\_i^l p\_i x\_i)) $

In the second equation you make mistake of forgetting that in the second way of setting up lagrangian the multiplier has negative sign $-\lambda$ (see Hammond et al Essential Mathematics for Economic Analysis pp 499 for full explanation why)

$L\_2=u(X)-\lambda ( \sum\_i^l p\_i x\_i -\sum\_i^l p\_i w\_i) = u(X)+\lambda ( \sum\_i^l p\_i w\_i) - \lambda (\sum\_i^l p\_i x\_i))$

Hence clearly both $L\_1$ and $L\_2$ are completely equivalent you just have to set them up without making typos/mistakes.

> **Comments:**
> **username_0**: Hi, @imuflon1, I made a typo. At first equation, pw+px should be changed at pw-px. Now, two equation is different (different sing of lambda). You are saying first equation is correct (in modified version) and second equation is wrong. Right? Why second equation is wrong?  
> **username_1**: @martian03 because depending on how you solve the constraint for zero you need to change sign of lambda - lambda cant just be positive no matter what - the sign of lambda is dictated by constraint i.e. $g(x,y)=c$ can be solved for zero as $0=c-g(x,y)$ and in that case lambda has to be positive $\lambda$ or as $g(x,y)-c=0$ in which case it has to be $-\lambda$.  

---

