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!
course home page

Econ 50Q Section 3: Using the KKT with Multiple Constraints


Click here for the quiz on this reading.

Using KKT for Corner Solutions

In lecture 7 of Econ 50, you learned about “corner solutions,” in which the optimal solution lies at the boundary of the budget constraint; and in lecture 8, you learned about solutions at “kinks.” In both of these, the Econ 50 class was told that these were “situations in which calculus (i.e. Lagrange) didn’t work, so you needed to apply logic.”

This was not, strictly speaking, true! We can actually use the KKT method we developed last week to handle cases with multiple constraints, including both inequality constraints and equality constraints. And with this method, we can solve all the problems from lectures 7 and 8, plus a lot more.

In fact, the case of corner solutions is very much like the example we saw last week in which you weren’t allowed to buy more than 4 units of good 1 ($x_1 \ge 4$). We always have two additional constraints for any budget constraint problem in which you can’t buy negative quantities: $x_1 \ge 0$ and $x_2 \ge 0$. We can therefore set up a Lagrangian using KKT with one equality two inequality constraints: \(\mathcal{L}(x_1,x_2,\lambda) = u(x_1,x_2) + \overbrace{\lambda(m - p_1x_1 - p_2x_2)}^{p_1x_1 + p_2x_2 = m} + \overbrace{\mu_1x_1}^{x_1 \ge 0} + \overbrace{\mu_2x_2}^{x_2 \ge 0}\) We can then proceed using the KKT as usual!

Worked example

Let’s see how this works with the example from lecture 7: maximizing the quasilinear utility function \(u(x_1,x_2) = 100 \ln x_1 + x_2\) subject to the budget constraint \(x_1 + 2x_2 = 100\)

We saw in the main class that the binding constraint was $x_2 \ge 0$:

See interactive graph online here.

because the unconstrained maximum (i.e. without the constraint $x_2 \ge 0$ would have occurred at $(200,-50)$:

See interactive graph online here.

Let’s see how to solve this with KKT. The Lagrangian is \(\mathcal{x_1,x_2,\lambda} = 100 \ln x_1 + x_2 + \lambda(100-x_1-2x_2) + \mu_1x_1 + \mu_2x_2\)

Notice that we will never choose to have strictly zero of good 1: indeed, since the utility derived from good 1 is $100\ln x_1$, having $x_1=0$ would imply infinitely negative utility! Thus we can save ourselves a step and conclude $x_1>0$ and so $\mu_1=0$.

From here, the first order conditions and complementary slackness conditions are: \(\frac{\partial \mathcal{L}}{\partial x_1} = \frac{100}{x_1} - \lambda + \mu_1 = 0\) \(\frac{\partial \mathcal{L}}{\partial x_2} = 1 - 2\lambda + \mu_2 = 0\) \(\frac{\partial \mathcal{L}}{\partial \lambda} = 100 - x_1 - 2x_2 = 0\) \(\mu_1 x_1 = 0, \qquad \mu_2 x_2 = 0\)

With $\mu_1 = 0$, the first condition gives $\lambda = \frac{100}{x_1}$. Suppose the constraint $x_2 \ge 0$ does not bind, so $\mu_2 = 0$. Then the second condition gives $\lambda = \tfrac{1}{2}$, so $x_1 = 200$ and the budget forces $x_2 = -50 < 0$, which is infeasible. We can therefore conclude the nonnegativity constraint binds and $x_2 = 0$.

With $x_2 = 0$, the budget gives $x_1 = 100$, hence $\lambda = \frac{100}{100} = 1$, and the second condition gives $\mu_2 = 2\lambda - 1 = 1 > 0$. The optimum is therefore \(x_1 = 100, \quad x_2 = 0, \quad \mu_1 = 0, \quad \mu_2 = 1.\) This is another good example of us “earning” some results from Econ 50. Not only does this formally verify that the solution without calculus is correct, but the values of those Lagrange multipliers are informative about marginal utilities in ways that help us quantify the “stress” on the solution, in particular how badly the consumer wants to break past each constraint. In future econ, engineering, or computer science courses, you’ll see how leveraging these multipliers can help solve more difficult optimization problems.

Leveraging Monotonicity for Kinked KKT Problems

Last week we learned how to use the KKT method to solve optimization problems involving both equality and inequality constraints. We’re going to extend that method today, in particular for problems with kinked budget sets.

See interactive graph online here.

There’s a key insight that will let us take KKT to these kinds of problems really easily. In Econ 50, these problems are expressed as an optimization with respect to a single equality constraint, namely the kinked budget line. If you think about it though, an equality constraint is really just an inequality constraint where we are guaranteed that the constraint will bind. This is in fact why we take first order conditions with respect to equality multipliers: it’s the same thing as a complementary slackness condition where we know the multiplier will be positive. So long as utility is monotonic in both goods, we can safely think of budget lines as equality or inequality constraints, since we know we’re not going to end up consuming anywhere except along the budget line.

Since simple lines are so much easier to deal with directly than kinked constraints, we’re going to leverage this idea and replace the single kinked equality constraint with two linear inequality constraints. Monotonicity of the objective (utility) function guarantees that this substitution is without loss.

Example (Optional)

Let’s try this method out on an example problem.

Arthur is looking to put together a birthday gift for his good friend Lancelot, a bird enthusiast who has been hoping to grow his collection of African and European Swallows.

Arthur already keeps his own aviary, and starts with an endowment of 8 African Swallows ($x_1$) and 16 European Swallows ($x_2$). He can adjust this bundle by trading at the Camelot Bird Market before handing it over, but the market has a strange policy for African Swallows: Arthur can buy them for €2.00 each, but can only sell them for €0.50 each. European Swallows trade freely at €1.00 each, whether he is buying or selling.

Because African Swallows are cheaper to sell than to buy, the rate at which Arthur can trade birds changes depending on whether he is buying or selling them, so his budget line has a kink at his endowment. He wants to end up holding his utility maximizing bundle, reachable by buying and selling from his starting endowment.

What We Want To Know

1. Budget sets. Write two linear inequality constraints whose intersection gives Arthur’s feasible set.

2. Cobb-Douglas preferences. Suppose Lancelot has Cobb-Douglas utility that Arthur wants to emulate: \(u(x_1,x_2) = x_1^{\alpha} x_2^{1-\alpha}, \qquad \alpha = \tfrac{3}{4}.\)

3. Perfect complements. Now suppose Lancelot instead views the birds as perfect complements, $u(x_1,x_2) = \min\lbrace x_1/a,\, x_2/b \rbrace$. What ratio $a:b$ (and hence what utility function) would give Arthur the same optimal bundle as the Cobb-Douglas case above? Provide a mathematical argument as well as a rough sketch showing the budget set and optimal choice.

Solutions

1. Budget sets. Let $x_1 \ge 0$ be African Swallows and $x_2 \ge 0$ be European Swallows. \(\begin{aligned} \text{Buying African Swallows:}\quad & 2x_1 + x_2 \le 32 \\ \text{Selling African Swallows:}\quad & 0.5\,x_1 + x_2 \le 20 \end{aligned}\)

Arthur’s feasible set is the intersection of these two half-spaces (together with $x_1,x_2 \ge 0$, which you may safely ignore due to the monotonicity of the Cobb-Douglas utility function).

2. Cobb-Douglas (with $\alpha = 3/4$).

i. Lagrangian. Introduce multipliers $\mu_1,\mu_2 \ge 0$ for the two budget constraints: \(\mathcal{L}(x_1,x_2,\mu_1,\mu_2) = x_1^{3/4}x_2^{1/4} + \mu_1(32 - 2x_1 - x_2) + \mu_2(20 - 0.5x_1 - x_2)\)

ii. KKT conditions. \(\begin{aligned} \frac{\partial \mathcal{L}}{\partial x_1} &: \tfrac{3}{4}x_1^{-1/4}x_2^{1/4} - 2\mu_1 - 0.5\mu_2 = 0 \\ \frac{\partial \mathcal{L}}{\partial x_2} &: \tfrac{1}{4}x_1^{3/4}x_2^{-3/4} - \mu_1 - \mu_2 = 0 \\ \text{Complementary slackness:} & \quad \mu_1(32 - 2x_1 - x_2) = 0, \quad \mu_2(20 - 0.5x_1 - x_2) = 0 \\ \text{Inequality Constraints:} & \quad 2x_1 + x_2 \le 32, \quad 0.5x_1 + x_2 \le 20 \end{aligned}\)

A highly technical note: doing the Lagrangians and FOCs without taking the log of the utility is gross and bad. I did it here only to match the utility function exactly as it was written above, but in practice you should almost always take the log of a Cobb-Douglas utility function first. As we saw in the Week 1 reading, a monotonically transformed utility such as $\ln u(\vec x)$ represents the same underlying preferences, so this step is without loss of generality. Taking the log leaves the optimal bundle unchanged, but it does change the numerical values of the Lagrange multipliers — essentially this is comes from unit conversion between the original “utils” and “log utils.” Either way, you’ll receive full credit as long as your answers are internally consistent.

iii. Optimal Bundle. Arthur will not optimally leave money unspent, so we have 3 cases: constraint 1 will bind, constraint 2 will bind, or they both will bind (which corresponds to being at the kink). Monotonicity guarantees that at least one constraint will bind.

First, suppose $\mu_2 = 0$ and the first constraint binds: $2x_1 + x_2 = 32$. Then the problem reduces to the standard Cobb-Douglas with prices $(p_1,p_2) = (2,1)$ and income $M = 32$. The optimal demand is \(x_1^* = \frac{\alpha M}{p_1} = \frac{\tfrac{3}{4}\cdot 32}{2} = 12, \qquad x_2^* = \frac{(1-\alpha)M}{p_2} = \frac{\tfrac{1}{4}\cdot 32}{1} = 8.\)

This bundle satisfies the second constraint as well, since $0.5\cdot 12 + 8 = 14 \le 20$. Thus $(12,8)$ is feasible under both budget sets.

Second, suppose $\mu_1 = 0$ and the second constraint binds: $0.5x_1 + x_2 = 20$. Solving the Cobb-Douglas problem with prices $(0.5,1)$ and income $M = 20$ gives an optimal bundle $(x_1,x_2) = (30,5)$. However, this candidate violates the first budget constraint, since $2\cdot 30 + 5 = 65 > 32$. Therefore it is infeasible.

We conclude that the true optimum is the first case, with solution $(x_1^\star,x_2^\star) = (12,\,8)$. We do not need to check the third case, in which both constraints bind, because we have already found a feasible solution.

This is illustrated in the following diagram. Note what happens when you change $\alpha$…can you figure out when each constraint binds?

See interactive graph online here.

3. Perfect complements. As we saw in week 1, perfect complements utility can be written as $u(x_1,x_2) = \min\lbrace a x_1,\, b x_2 \rbrace$. We want to find values of $a$ and $b$ which lead Arthur to select the bundle (12,8).

Knowing the binding budget constraint is half the battle: we generally can find an optimal allocation by choosing a point where the budget line intersects an optimality condition. Here the binding constraint was $2x_1 + x_2 = 32$. The optimality condition is usually something like MRS=price ratio, but for perfect complements problems, a consumer chooses optimally by selecting a point along the so called ridge condition. (That is, points where $a x_1=b x_2$.) Consuming at any other point would mean wasting resources for zero marginal utility.

To get Arthur choosing (12,8) we need to pick $a$ and $b$ so that \(12 a = 8 b\) You can pick any $a$ and $b$ you like with this relationship, one clean one is $a=2, b=3$. The ridge condition $x_2 = \tfrac{2}{3}x_1$ meets the binding constraint $2x_1 + x_2 = 32$ exactly at $(12,8)$, the same bundle as the Cobb-Douglas case.


Reading Quiz

That's it for today! Click here to take the quiz on this reading.

Copyright (c) Christopher Makler / econgraphs.org