EconGraphs Logo BETA
Note: This work is under development and has not yet been professionally edited.
If you catch a typo or error, or just have a suggestion, please submit a note here. Thanks!
Chapter 2 / Inequality Constraints and the KKT

2.2 Inequality Constraints with One Choice Variable


Let’s put this to the test with the simple univariate example we were looking at before: maximizing $f(x) = 12x - x^2$ subject to the constraint $x \le K$:

See interactive graph online here.

Recall that the solution we found via logic was \(x^\star = \argmax_{x \le K} 12x - x^2 = \begin{cases}K & \text{ if }K \le 6\\ 6 & \text{ if }K \ge 6\end{cases}\) Let’s see how to solve this using the KKT method. First, we rewrite the constraint in the form $h(x) \ge 0$, where $h(x) = K - x$. Since there is no equality constraint, the Lagrangian is \(\mathcal{L}(x,\mu) = f(x) + \mu h(x) = 12x - x^2 + \mu(K - x)\) The conditions for optimality are therefore: \(\begin{aligned} \textbf{First-order condition: } & {\partial \mathcal{L}(x,\mu) \over \partial x} = 12 - 2x - \mu = 0\\ \\ \textbf{Complementary slackness condition: } & \mu(K-x) = 0\\ \\ \textbf{Inequality constraint: } & K - x \ge 0\\ \\ \textbf{Multiplier condition: } & \mu \ge 0 \end{aligned}\) Note that we can write the first-order condition as \(\mu = 12 - 2x\) If we plug this into the complementary slackness condition, we get \((12 - 2x)(K - x) = 0\) In order for this to hold, one of two things must be true: either $x = 6$, or $x = K$ (or both). This is just what we found when we played around with the graph!

But which is it? Well, if $x = 6$, $\mu = 12 - 2x = 0$; in order for the inequality constraint $K - x \ge 0$ to hold, we must have $K - 6 \ge 0$, or $K \ge 6$. On the other hand, if $x = K$, then $\mu = 12 - 2K$; in order for the multiplier condition $\mu \ge 0$ to hold, it must therefore be the case that $12-2K \ge 0$, or $K \le 6$. In other words, one of two cases must occur:

For example, if $K = 8$, the complementary slackness condition is \((12 - 2x)(8 - x) = 0\) This could hold true if $x = 6$ or $x = 8$; but if $x = 8$, then $\mu = -4$ which violates the constraint condition $\mu \ge 0$, so it must be that $x = 6$.

On the other hand, if $K = 4$, the complementary slackness condition is \((12 - 2x)(4 - x) = 0\) Now we might have $x = 6$ or $x = 4$; but if $x = 6$, then $4 - x < 0$, which violates the inequality constraint $x \le 4$, so it must be that $x = 4$.

In other words, by searching for a value of $x$ that satisfies all four conditions, we find the optimum systematically, regardless of whether the constraint binds or not!

It might help to look at what’s happening here visually by plotting out the Lagrangian function itself, and thinking about what $\mu$ really means. You can think of $\mu$ as being a reward for being within the constraint, and a punishment for exceeding it. Therefore, the Lagrangian is higher than the objective function $f(x)$ to the left of the constraint, and lower than $f(x)$ to the right:

See interactive graph online here.

As a sort of mnemonic, I like to think of the numerical value of $\mu$ as a “pushing force” from the inequality constraint on the optimal point. If $\mu=0$, then the inequality constraint doesn’t really affect/push on us, and so we aren’t actually at the constraint. If $\mu>0$, then we want to go past the constraint, but can’t since it’s pushing us back. Larger $\mu$ indicates that we want to go past the constraint even more. In order for the first-order condition to hold – that is, in order for the Lagrange function to reach its peak at $x = K$ – the punishment $\mu$ for exceeding the constraint must be exactly equal to the value of exceeding the constraint at that point, i.e. $f^\prime(K)$.

For this reason, in a utility setting, you can think of $\mu$ as the marginal utility of “relaxing” the constraint, meaning the marginal utility of taking a constraint like $x \leq K$ and making it $x \leq K + 1$. If $K = 8$, then relaxing the constraint $x \leq K$ makes no difference to us, because it’s not binding anyway, so we need no punishment for exceeding the constraint to get us to do the right thing. But if $K = 4$, relaxing the constraint would allow us to get to a higher value of $f(x)$, so we need a punishment $\mu > 0$ for exceeding the constraint.

Practically, this leaves us with two cases to check when doing KKT problems:

Let’s wrap this up by looking at how this applies to a standard utility maximization problem with two choice variables.

Previous: The Karush-Kuhn-Tucker Method
Next: Inequality Constraints with Two Choice Variables
Copyright (c) Christopher Makler / econgraphs.org