Lagrange Multipliers: Practice
Twenty constrained-optimisation problems in three levels: numbers only, then the standard economic problems with parameters, then two constraints, inequalities and the traps. Every solution is worked in full. Convention throughout: \( \mathcal{L} = f - \lambda\,(g - c) \), so \( \lambda \) is the value of relaxing the constraint by one unit.
Set each one up on paper before opening the solution. The theory is in the Lagrange multipliers note; if the derivatives themselves are the problem, start with the derivatives refresher; the other sheets are on the resources page.
Starter
- 1.Maximise \( f(x, y) = xy \) subject to \( x + y = 12 \). Find \( x^*, y^* \) and \( \lambda^* \).
Solution
Lagrangian: \( \mathcal{L} = xy - \lambda(x + y - 12) \).
\[ \mathcal{L}_x = y - \lambda = 0, \qquad \mathcal{L}_y = x - \lambda = 0, \qquad \mathcal{L}_\lambda = 12 - x - y = 0 \]The first two give \( x = y = \lambda \). The constraint then gives \( 2x = 12 \).
\[ x^* = y^* = 6, \qquad \lambda^* = 6, \qquad f^* = 36 \]Reading \( \lambda \): raising the right-hand side from 12 to 13 would raise the maximum by about 6. Check: \( 13^2/4 - 12^2/4 = 6.25 \).
- 2.Find the maximum and the minimum of \( f(x, y) = x + y \) on the circle \( x^2 + y^2 = 8 \).
Solution
\( \mathcal{L} = x + y - \lambda(x^2 + y^2 - 8) \).
\[ 1 - 2\lambda x = 0, \qquad 1 - 2\lambda y = 0, \qquad x^2 + y^2 = 8 \]So \( x = y = 1/(2\lambda) \), and \( 2x^2 = 8 \) gives \( x = \pm 2 \).
\[ \text{Maximum at } (2, 2): f = 4,\ \lambda = \tfrac14. \qquad \text{Minimum at } (-2, -2): f = -4,\ \lambda = -\tfrac14. \]The Lagrangian finds both. Deciding which is which is your job: evaluate \( f \) at each candidate, or note that the constraint set is a closed curve, so both a max and a min exist.
- 3.Minimise \( x^2 + y^2 \) subject to \( x + 2y = 10 \). Interpret \( \lambda \).
Solution
\( \mathcal{L} = x^2 + y^2 - \lambda(x + 2y - 10) \).
\[ 2x = \lambda, \qquad 2y = 2\lambda, \qquad x + 2y = 10 \]So \( x = \lambda/2 \) and \( y = \lambda \). Substituting: \( \lambda/2 + 2\lambda = 10 \), hence \( \lambda = 4 \).
\[ x^* = 2, \qquad y^* = 4, \qquad \lambda^* = 4, \qquad f^* = 20 \]\( \lambda = 4 \) is the rate at which the minimum value rises if the constraint constant moves from 10 to 11. Geometrically this is the squared distance from the origin to the line, so \( (2, 4) \) is the foot of the perpendicular; note \( (2, 4) \) is proportional to the normal vector \( (1, 2) \).
- 4.A consumer has \( U(x, y) = x^{1/2} y^{1/2} \), prices \( p_x = 2 \), \( p_y = 1 \) and income \( 40 \). Find the demands and \( \lambda \).
Solution
\( \mathcal{L} = x^{1/2} y^{1/2} - \lambda(2x + y - 40) \).
\[ \tfrac12 x^{-1/2} y^{1/2} = 2\lambda, \qquad \tfrac12 x^{1/2} y^{-1/2} = \lambda \]Divide the first by the second: \( y/x = 2 \), the MRS equals the price ratio. So \( y = 2x \), and the budget gives \( 2x + 2x = 40 \).
\[ x^* = 10, \qquad y^* = 20, \qquad \lambda^* = \tfrac12 \sqrt{20/10} \big/ 2 = \tfrac{\sqrt 2}{4} \approx 0.354 \]With equal exponents the consumer spends half the income on each good: \( 2 \cdot 10 = 20 \) and \( 1 \cdot 20 = 20 \).
- 5.Minimise the cost \( 3x + 2y \) of reaching the target \( xy = 24 \), with \( x, y > 0 \).
Solution
\( \mathcal{L} = 3x + 2y - \lambda(xy - 24) \).
\[ 3 = \lambda y, \qquad 2 = \lambda x, \qquad xy = 24 \]Dividing: \( 3/2 = y/x \), so \( y = 1.5x \). Then \( 1.5x^2 = 24 \), \( x^2 = 16 \).
\[ x^* = 4, \qquad y^* = 6, \qquad \lambda^* = 3/y = \tfrac12, \qquad \text{cost} = 24 \]\( \lambda = 1/2 \): one more unit of target costs about half a unit more. Sanity check with the target 25: cost is \( 2\sqrt{6 \cdot 25} \approx 24.49 \), a rise of about 0.49.
- 6.Maximise \( f(x, y) = xy + x \) subject to \( x + y = 10 \).
Solution
\( \mathcal{L} = xy + x - \lambda(x + y - 10) \).
\[ y + 1 = \lambda, \qquad x = \lambda, \qquad x + y = 10 \]So \( x = y + 1 \). Then \( (y + 1) + y = 10 \), \( y = 4.5 \).
\[ x^* = 5.5, \qquad y^* = 4.5, \qquad \lambda^* = 5.5, \qquad f^* = 30.25 \]Compare with exercise 1: the extra \( +x \) in the objective tilts the solution towards \( x \), by exactly half a unit.
Intermediate
- 7.Cobb-Douglas demand. Maximise \( U = x^{1/3} y^{2/3} \) subject to \( 2x + y = 90 \). Find the demands, the expenditure shares and \( \lambda \).
Solution
\( \mathcal{L} = x^{1/3} y^{2/3} - \lambda(2x + y - 90) \).
\[ \tfrac13 x^{-2/3} y^{2/3} = 2\lambda, \qquad \tfrac23 x^{1/3} y^{-1/3} = \lambda \]Divide: \( \dfrac{y}{2x} = 2 \), so \( y = 4x \). Budget: \( 2x + 4x = 90 \).
\[ x^* = 15, \qquad y^* = 60 \]Shares: \( 2 \cdot 15 = 30 \) on \( x \) (one third of 90) and \( 60 \) on \( y \) (two thirds). With Cobb-Douglas utility the exponents are the expenditure shares, whatever the prices.
\[ \lambda^* = \tfrac23 (15)^{1/3} (60)^{-1/3} = \tfrac23 \cdot 4^{-1/3} \approx 0.42 \] - 8.Quasi-linear preferences. Maximise \( U = \ln x + y \) subject to \( x + 2y = 20 \).
Solution
\( \mathcal{L} = \ln x + y - \lambda(x + 2y - 20) \).
\[ \tfrac1x = \lambda, \qquad 1 = 2\lambda, \qquad x + 2y = 20 \]The second condition pins \( \lambda = 1/2 \) directly, so \( x = 2 \). Then \( 2 + 2y = 20 \).
\[ x^* = 2, \qquad y^* = 9, \qquad \lambda^* = \tfrac12 \]Notice that the demand for \( x \) does not depend on income: any extra euro goes entirely to \( y \). That is the signature of quasi-linear utility, and it is also why \( \lambda \), the marginal utility of income, is constant. The solution needs income at least \( 2 \) so that \( y \geq 0 \).
- 9.Cost minimisation. A firm with technology \( q = K^{1/2} L^{1/2} \) faces \( w = 4 \) (labour) and \( r = 1 \) (capital). Find the cheapest way to produce \( q = 10 \), the cost, and interpret \( \lambda \).
Solution
Minimise \( 4L + K \) subject to \( K^{1/2} L^{1/2} = 10 \). Lagrangian \( \mathcal{L} = 4L + K - \lambda(K^{1/2} L^{1/2} - 10) \).
\[ 4 = \lambda \tfrac12 K^{1/2} L^{-1/2}, \qquad 1 = \lambda \tfrac12 K^{-1/2} L^{1/2} \]Divide: \( 4 = K/L \), the technical rate of substitution equals the input price ratio. So \( K = 4L \), and \( \sqrt{4L \cdot L} = 2L = 10 \).
\[ L^* = 5, \qquad K^* = 20, \qquad C^* = 4 \cdot 5 + 20 = 40, \qquad \lambda^* = 4 \]\( \lambda = 4 \) is marginal cost: producing the 11th unit costs about 4 more. Here the technology has constant returns, so cost is exactly \( 4q \) and marginal cost equals average cost.
- 10.Expenditure minimisation. Find the cheapest bundle that reaches utility \( xy = 16 \) at prices \( p_x = 2 \), \( p_y = 8 \).
Solution
\( \mathcal{L} = 2x + 8y - \lambda(xy - 16) \).
\[ 2 = \lambda y, \qquad 8 = \lambda x, \qquad xy = 16 \]Divide: \( 1/4 = y/x \), so \( x = 4y \). Then \( 4y^2 = 16 \).
\[ x^* = 8, \qquad y^* = 2, \qquad E^* = 16 + 16 = 32, \qquad \lambda^* = 2/y = 1 \]\( \lambda \) here is the marginal cost of utility: reaching \( xy = 17 \) instead of 16 costs about one more euro. This is the dual of the utility-maximisation problem: the same tangency condition, read the other way round.
- 11.Envelope theorem. Maximise \( xy \) subject to \( x + y = c \) for a general \( c > 0 \). Find the value function \( V(c) \) and check that \( V'(c) = \lambda^* \).
Solution
From the first-order conditions \( y = \lambda \), \( x = \lambda \), so \( x^* = y^* = c/2 \) and \( \lambda^* = c/2 \).
\[ V(c) = x^* y^* = \frac{c^2}{4}, \qquad V'(c) = \frac{c}{2} = \lambda^* \]That is the envelope theorem in one line: the derivative of the optimal value with respect to the constraint constant is the multiplier. You did not need to know how \( x^* \) and \( y^* \) move with \( c \); those effects cancel at the optimum. At \( c = 12 \) this gives \( \lambda = 6 \), matching exercise 1.
- 12.A firm produces two goods with cost \( C(x, y) = 3x^2 + 2y^2 \) and must meet a quota \( x + y = 50 \). Find the cheapest split and the marginal cost of the quota.
Solution
\( \mathcal{L} = 3x^2 + 2y^2 - \lambda(x + y - 50) \).
\[ 6x = \lambda, \qquad 4y = \lambda, \qquad x + y = 50 \]Equal marginal costs across the two goods: \( 6x = 4y \), so \( y = 1.5x \) and \( 2.5x = 50 \).
\[ x^* = 20, \qquad y^* = 30, \qquad C^* = 1200 + 1800 = 3000, \qquad \lambda^* = 120 \]\( \lambda = 120 \): one more unit of quota costs the firm about 120, whichever good it comes from, because at the optimum both goods have the same marginal cost. Check: with a quota of 51, \( C^* = 3060 + 0.6 \approx 3120.6 \).
- 13.Three goods. Maximise \( U = xyz \) subject to \( x + 2y + 4z = 24 \).
Solution
\( \mathcal{L} = xyz - \lambda(x + 2y + 4z - 24) \).
\[ yz = \lambda, \qquad xz = 2\lambda, \qquad xy = 4\lambda \]Dividing the second by the first: \( x/y = 2 \), so \( x = 2y \). Dividing the third by the first: \( x/z = 4 \), so \( x = 4z \). The budget becomes \( x + x + x = 24 \).
\[ x^* = 8, \qquad y^* = 4, \qquad z^* = 2, \qquad \lambda^* = yz = 8 \]Each good takes a third of the budget (8 each), as it must with equal Cobb-Douglas exponents. Three variables, one constraint, and the method is unchanged: tangency conditions plus the constraint.
- 14.Maximise \( U = \sqrt{x} + \sqrt{y} \) subject to \( x + 4y = 20 \). Then verify the envelope theorem by computing \( V(m) \) for a general income \( m \).
Solution
\( \mathcal{L} = \sqrt x + \sqrt y - \lambda(x + 4y - 20) \).
\[ \frac{1}{2\sqrt x} = \lambda, \qquad \frac{1}{2\sqrt y} = 4\lambda \]Divide: \( \sqrt x / \sqrt y = 4 \), so \( x = 16y \). Budget: \( 16y + 4y = 20 \).
\[ x^* = 16, \qquad y^* = 1, \qquad \lambda^* = \frac{1}{2 \cdot 4} = \frac18, \qquad U^* = 5 \]For general \( m \): \( y = m/20 \), \( x = 4m/5 \), so \( V(m) = \sqrt{4m/5} + \sqrt{m/20} = \tfrac{\sqrt5}{2}\sqrt m \). Then \( V'(m) = \tfrac{\sqrt5}{4\sqrt m} \), and at \( m = 20 \) this is \( \tfrac{\sqrt5}{4\sqrt{20}} = \tfrac18 = \lambda^* \).
Upper Intermediate
- 15.Two constraints. Minimise \( x^2 + y^2 + z^2 \) subject to \( x + y + z = 6 \) and \( x - z = 0 \).
Solution
One multiplier per constraint: \( \mathcal{L} = x^2 + y^2 + z^2 - \lambda(x + y + z - 6) - \mu(x - z) \).
\[ 2x = \lambda + \mu, \qquad 2y = \lambda, \qquad 2z = \lambda - \mu \]The second constraint says \( x = z \), so the first and third conditions give \( \lambda + \mu = \lambda - \mu \), hence \( \mu = 0 \). Then \( x = y = z = \lambda/2 \) and the first constraint gives \( 3\lambda/2 = 6 \).
\[ x^* = y^* = z^* = 2, \qquad \lambda^* = 4, \qquad \mu^* = 0, \qquad f^* = 12 \]\( \mu = 0 \) is telling you something: the point that minimises \( x^2 + y^2 + z^2 \) on the plane \( x + y + z = 6 \) already has \( x = z \). The second constraint costs nothing, so its shadow price is zero.
- 16.Inequality constraints. Maximise \( xy \) subject to \( x + y \leq 10 \) and \( x \leq 3 \), with \( x, y \geq 0 \). Use the Karush-Kuhn-Tucker conditions.
Solution
\( \mathcal{L} = xy - \lambda(x + y - 10) - \mu(x - 3) \), with \( \lambda, \mu \geq 0 \) and complementary slackness \( \lambda(x + y - 10) = 0 \), \( \mu(x - 3) = 0 \).
Guess. Ignore \( x \leq 3 \): the budget-only problem gives \( x = y = 5 \), which violates \( x \leq 3 \). So that constraint must bind: \( x = 3 \). Then \( y \) is chosen to use the whole budget, \( y = 7 \).
Check the multipliers. From \( \mathcal{L}_x = y - \lambda - \mu = 0 \) and \( \mathcal{L}_y = x - \lambda = 0 \):
\[ \lambda = x = 3, \qquad \mu = y - \lambda = 4 \]Both non-negative, both constraints satisfied, both binding. The solution is \( (3, 7) \) with \( f = 21 \). Reading \( \mu = 4 \): letting \( x \) rise to 4 would raise the objective by roughly 4 (exactly: \( 4 \cdot 6 - 21 = 3 \); the multiplier is a marginal rate).
- 17.A slack constraint. Maximise \( f(x, y) = -(x - 2)^2 - (y - 1)^2 \) subject to \( x + y \leq 10 \). Show that the constraint does not bind and find the multiplier.
Solution
Try the constraint slack first, \( \lambda = 0 \). The first-order conditions of \( f \) alone are \( -2(x - 2) = 0 \) and \( -2(y - 1) = 0 \), so \( (x, y) = (2, 1) \).
Feasibility: \( 2 + 1 = 3 \leq 10 \). The constraint holds with room to spare, so complementary slackness \( \lambda(x + y - 10) = 0 \) is satisfied with \( \lambda = 0 \), and \( \lambda \geq 0 \) holds.
\[ x^* = 2, \qquad y^* = 1, \qquad \lambda^* = 0, \qquad f^* = 0 \]A constraint that does not bind has no shadow price: relaxing \( 10 \) to \( 11 \) changes nothing. If instead the constraint had been \( x + y \leq 2 \), the unconstrained optimum would be infeasible and you would redo the problem with equality and a positive \( \lambda \).
- 18.The convexity trap. Someone asks you to maximise \( 2x^2 + 3y^2 \) subject to \( x + y = 10 \). Find the stationary point of the Lagrangian and explain what it actually is. Then find the true maximum when \( x, y \geq 0 \).
Solution
\( \mathcal{L} = 2x^2 + 3y^2 - \lambda(x + y - 10) \) gives \( 4x = \lambda \), \( 6y = \lambda \), so \( x = 1.5y \) and \( 2.5y = 10 \).
\[ (x, y) = (6, 4), \qquad \lambda = 24, \qquad f = 72 + 48 = 120 \]This is a minimum, not a maximum. The objective is convex, so along the line \( x + y = 10 \) it is a convex function of one variable, and its only stationary point is its lowest point. First-order conditions give candidates; they never tell you which kind.
Without further restrictions the maximum does not exist: moving along the line towards \( (100, -90) \) makes \( f \) as large as you like. With \( x, y \geq 0 \) the feasible set is the segment from \( (10, 0) \) to \( (0, 10) \), and a convex function on a segment is maximised at an endpoint:
\[ f(10, 0) = 200, \qquad f(0, 10) = 300 \quad\Longrightarrow\quad \text{maximum at } (0, 10). \]The Lagrangian does not find corner solutions; you have to check the boundary yourself.
- 19.General expenditure function. Minimise \( p_x x + p_y y \) subject to \( x^{1/2} y^{1/2} = \bar u \). Find \( x^*, y^* \), the expenditure function \( E(p_x, p_y, \bar u) \), and show that \( \lambda^* = \partial E / \partial \bar u \).
Solution
\( \mathcal{L} = p_x x + p_y y - \lambda(x^{1/2} y^{1/2} - \bar u) \).
\[ p_x = \lambda \tfrac12 x^{-1/2} y^{1/2}, \qquad p_y = \lambda \tfrac12 x^{1/2} y^{-1/2} \]Divide: \( p_x / p_y = y / x \), so \( y = (p_x/p_y)\, x \). The constraint gives \( x \sqrt{p_x / p_y} = \bar u \).
\[ x^* = \bar u \sqrt{\frac{p_y}{p_x}}, \qquad y^* = \bar u \sqrt{\frac{p_x}{p_y}}, \qquad E = p_x x^* + p_y y^* = 2\bar u \sqrt{p_x p_y} \]From the first condition, \( \lambda^* = 2 p_x \sqrt{x^*/y^*} = 2 p_x \sqrt{p_y/p_x} = 2\sqrt{p_x p_y} \), and indeed \( \partial E / \partial \bar u = 2\sqrt{p_x p_y} \). The multiplier is the marginal cost of utility, and it is constant here because the utility function is homogeneous of degree one.
- 20.Interpretation. A planner maximises \( W = \ln x + \ln y \) subject to a resource constraint \( 3x + y = 60 \). Find the allocation and \( \lambda \). Then explain, in one sentence each, what \( \lambda \) means and what would happen to it if the resource constant rose to 120.
Solution
\( \mathcal{L} = \ln x + \ln y - \lambda(3x + y - 60) \).
\[ \tfrac1x = 3\lambda, \qquad \tfrac1y = \lambda, \qquad 3x + y = 60 \]So \( y = 3x \), and \( 3x + 3x = 60 \).
\[ x^* = 10, \qquad y^* = 30, \qquad \lambda^* = \tfrac{1}{30}, \qquad W^* = \ln 300 \]Meaning: \( \lambda = 1/30 \) is the shadow value of the resource, the increase in welfare from one more unit of it (about 0.033 in log units).
With 120 units: the allocation doubles to \( (20, 60) \) and \( \lambda \) halves to \( 1/60 \). Each extra unit is worth less because both goods are already more abundant; diminishing marginal utility shows up as a falling shadow price. Check: \( W(120) - W(60) = \ln 4 \approx 1.39 \), and \( \int_{60}^{120} \tfrac{2}{c}\, dc = 2 \ln 2 \) since \( \lambda(c) = 2/c \).