The Lagrange method and implicit functions

27 min · 4 drills

In the textbook: Ch. 8.7 Kettenregel und implizite Funktionen8.8 Optimierung unter Nebenbedingungen

In the last article mugs and plates could be chosen freely, and the best plan sat on the peak. More often the choice is limited: there is only so much money, and whatever goes on one thing is no longer there for the other.

A farmer is getting his field ready for spring. The harvest depends on fertiliser and on seed, and one does not work without the other. A sack of fertiliser costs 4 €, a packet of seed 2 €, and the farmer has 80 € in all. He spends all of it, so every extra sack of fertiliser costs him two packets of seed. He compares the combinations that cost exactly 80 €:

Sacks of fertiliserPackets of seedHarvest, kg
530150
824192
1020200
1216192
1510150

The best combination is 10 sacks and 20 packets. From there no swap pays: 11 sacks and 18 packets give 198 kg, and 9 sacks and 22 packets give 198 as well. In the best combination one more sack adds exactly as much harvest as the two packets of seed given up to pay for it would have added.

A condition that links the two quantities, here the budget of 80 €, is called a constraint (“Nebenbedingung”). There is no need to try out combinations: the Lagrange method finds the best one directly.

Three sections of the article look for such an optimum:

  • what to buy on a budget;
  • how to make a set output most cheaply;
  • how to split output between two plants.

The first two sections answer the question the farmer settled with his table: how much of one thing replaces the other. They supply the tool for the other three. Partial derivatives and level curves (“Niveaulinie”) are explained in the article “Functions of two variables”.

At a glance

The farmer looked for the best combination on a fixed budget. Two more sections of the article are built the same way. Before them come two shorter ones, on the slope of the isoquant and the rate of substitution: they supply the tool for the rest. The overview puts all their steps side by side:

  • Slope of the isoquant and marginal rate of substitution

    A curve f(x,y)=c (an isoquant) and a point are given; the slope or the “Grenzrate der Substitution” (marginal rate of substitution) is asked for. The slope equals −fx/fy, the MRS the same fraction without the minus.
    dydx=−fxfy

    Trap: turning the fraction over or losing the minus; fx goes on top, fy below.

  • Maximum utility on a budget

    A utility U(x,y), the prices px, py and the budget B are given; a quantity or the largest utility is asked for. Goal and budget go into one function with the multiplier λ.
    L=U(x,y)−λ (pxx+pyy−B)

    Trap: turning the price ratio over; the right condition is Ux/Uy=px/py.

  • Minimum cost at a set output

    The output is fixed and the factor prices are p and q; the lowest cost is asked for. At the optimum Qx/Qy equals the price ratio, and the multiplier λ equals the marginal cost.
    QxQy=pq,λ=pQx

    Trap: giving quantities when the cost is asked for, or not subtracting a stock already held from the quantity needed.

  • Minimum cost in two plants

    The output Q is split between two plants with costs K1(x) and K2(y). You shift it to where the next unit is cheaper until the marginal costs meet at λ.
    K1′(x)=K2′(y)=λ,x+y=Q

    Trap: halving the output or taking λ for the cost per unit; λ equals the marginal cost.

Full list: Formula sheet and what to memorise.

Implicit derivative: slope of the isoquant

In the farmer's best combination one more sack of fertiliser brings as much harvest as two packets of seed. Such trades are worked out from the slope of the line along which the result does not change. That slope is where the article starts.

How to recognise the task. “Steigung der Isoquante” (slope of the isoquant), “y als Funktion von x” (y as a function of x) on the curve f(x,y)=c, or “bei welchem k ist die Steigung …” (for which k is the slope …).

dydx=−fxfy

Where the formula comes from is shown in the section “The slope of the level curve”: along the curve fx dx+fy dy=0. For Cobb-Douglas Q=Axayb the fraction is shorter: QxQy=a yb x, the factor A cancels.

  • Steps: Derivative with respect to x → Derivative with respect to y → The fraction at the point → Read it as a slope.
  • Formula sheet (“Formelsammlung”, the printed sheet): f′(t)=−F1′(t,f(t))F2′(t,f(t)) (on the sheet F stands for our f, t for x, and f(t) for y on the level curve; F1′ and F2′ correspond to our fx and fy).
  • Memorise: slope −fxfy, with the minus: as x grows along the level curve, y falls.

For Q=20 x0.6y0.4 at the point (50,120) the figure shows the isoquant through this point and its tangent.

The tangent falls 3.6 units of y per unit of x: GRS 3.610050120xy(50, 120)slope −3.6

Qx=0.6⋅Qx.

Qy=0.4⋅Qy.

GRS=0.6⋅1200.4⋅50=7220=3.6.

The slope of the isoquant is −3.6: one unit of x replaces about 3.6 units of y.

Where the slope is a given number. Set the fraction equal to the number and solve the system together with the equation of the curve. An example: the curve k0.5w0.5=4, you need the k with slope w′(k)=−0.25: −wk=−0.25, w=k4, into the curve k⋅k4=16, k=8, w=2. If one coordinate is given, the other follows from the curve: at k=2, 2w=4, w=8, the slope is −wk=−4.

Your turn1 of 4

The production function is Q(x,y)=10 x0.3y0.7, x is labour and y capital. What is the slope of the isoquant through the point (14,6) at this point? Round to four decimal places.

Trap. Turning the fraction upside down: 2072≈0.28 instead of 3.6. Putting in x and y swapped: 0.6⋅500.4⋅120=0.625.

Rate of substitution: the quotient of marginal utilities at a point

The slope of the isoquant is negative: more of one factor means less of the other. The exam more often asks for the same number without the sign and under its own name:

Exam-style task

Der Nutzen zweier Güter wird beschrieben durch

U(x,y)=xy+3x+y

Berechnen Sie im Punkt (9,4) die Grenzrate der Substitution.

  1. a)2.4
  2. b)1.4
  3. c)7.0
  4. d)1.5
  5. e)0.7

How to recognise the task. “Grenzrate der (technischen) Substitution” (marginal rate of (technical) substitution, GRS) at a point: how many units of one input or good one unit of the other replaces while output or utility stay the same.

GRS=fxfy

This is the same fraction as in the slope of the level curve in the section above, only without the minus: the slope shows that y falls, the rate says by how much.

The GRS needs the ratio of the two partial derivatives at the point.

Ux=y+3, at the point (9,4) this is 7.

Uy=x+1, at this point this is 10.

GRS=710=0.7.

The indifference curve has slope −0.7 at the point: for one extra unit of x one can give up about 0.7 units of y. The answer is 0.7.

Replacing one input by the other. If x grows by Δx at the same output, y falls by about GRS⋅Δx (in the example above 3.6⋅0.5=1.8). If y grows by Δy at the same output, x falls by about fyfx Δy (in the example above, for Δy=1.8 that is 1.83.6=0.5).

What to buy on a budget: maximum utility

The rate of substitution says how many units of one good a buyer is willing to give for a unit of the other. The best bundle lies where this value matches the price ratio in the shop. That bundle, 10 sacks and 20 packets, is what the farmer from the introduction found in his table.

How to recognise the task. Amounts are in GE (Geldeinheiten, money units). “Ein Haushalt bewertet zwei Güter mit der Nutzenfunktion U(x,y). Eine Einheit des ersten Gutes kostet …, des zweiten … Der Haushalt gibt genau … GE aus.” (A household rates two goods with the utility function U(x,y). One unit of the first good costs …, of the second … The household spends exactly … GE.)

The goal is U(x,y), the constraint pxx+pyy=B. The Lagrange method adds a new unknown λ, the Lagrange multiplier (“Lagrange-Multiplikator”), and puts goal and constraint together in one Lagrange function (“Lagrange-Funktion”):

L(x,y,λ)=U(x,y)−λ (pxx+pyy−B)

All three partial derivatives, with respect to x, y and λ, are set to zero.

  • Steps: Set up the Lagrange function → Set three derivatives to zero → Eliminate λ by dividing → Put into the budget.
  • Formula sheet: not on it.
  • Memorise: UxUy=pxpy; for xayb the share aa+b of the budget goes to the first good.

These are the farmer's numbers from the introduction: prices 4 and 2 €, a budget of 80 €. The harvest U(x,y)=x y plays the part of utility; every number in his table comes from this formula. In the figure below the curve xy=200 touches the budget line 4x+2y=80 at the point (10,20), and that is the optimum.

The curve xy = 200 touches the budget line at (10, 20)20401020xybest bundle (10, 20)xy = 100xy = 200xy = 300budget 4x + 2y = 80

Each curve collects bundles with the same utility; the farther the curve lies from the origin, the higher the utility. Compare the three curves: xy=100 crosses the budget line, xy=300 does not reach it, and xy=200 touches it at one point.

L=x y−λ (4x+2y−80).

Lx=y−4λ=0, Ly=x−2λ=0, Lλ=−(4x+2y−80)=0.

yx=4λ2λ=2, so y=2x.

4x+4x=80: x=10, y=20, λ=5, U=200.

λ shows by about how much the best utility grows if the budget becomes 1 € larger: with 81 € it is 818⋅814≈205.03, about 5 more.

The short way. For U=xayb (and likewise for aln⁡x+bln⁡y) the share aa+b of the budget goes to the first good, ba+b to the second:

  • for ln⁡(xy) and for xy it is half each: in the example 4x=40 and 2y=40;
  • if part of the income is already spent, say on rent, subtract it first and split only the rest;
  • if a good enters the budget twice, say two equal sides of a fence at p € per metre, its price in the budget is 2p.

Other utility functions:

  • U=(x+c) y with a stock c already at hand: Ux=y, Uy=x+c, the condition is yx+c=pxpy;
  • U=x+y: there is no short way, you go through L. Here Ux=12x, Uy=12y, dividing gives yx=pxpy. With the prices 1 and 4 and the budget 100 this gives y=x16, x+x4=100, x=80, y=5.

Trap. Turning the price ratio upside down: yx=24 gives y=x2, the budget gives 5x=80 and x=16 instead of 10.

Your turn2 of 4

The utility U(x,y)=xy3 is to be maximised at the prices 2 € for x and 3 € for y and the budget 240 €. Which quantity x is optimal?

How to make a set output most cheaply: minimum cost

Let us turn the budget task round. Now it is not the budget that is fixed but the result, and as little as possible should be spent on it.

How to recognise the task. “Mit x Einheiten des ersten und y Einheiten des zweiten Faktors erhält man Q(x,y)=Axayb. Eine Einheit kostet … Es sollen genau … hergestellt werden. Wie hoch sind die minimalen Kosten?” (With x units of the first and y units of the second input you get Q(x,y)=Axayb. One unit costs … Exactly … are to be produced. What is the minimum cost?) Sometimes λ is asked for.

Where each line of the list comes from is shown by the example below.

  • Steps: Set up the Lagrange function → Eliminate λ by dividing → Put into the set output → Work out the cost.
  • Memorise: QxQy=pq; λ=pQx, the marginal cost.

Goal and constraint have swapped places: the cost px+qy (input prices p and q) is minimised, and the output Q(x,y)=Q0 is set. The Lagrange function is L=px+qy−λ (Q(x,y)−Q0). From Lx=0 and Ly=0 follows p=λQx, q=λQy, after dividing pq=QxQy.

A firm produces Q=2 x0.5y0.5, the input prices are 4 and 1 €, 40 units are to be produced. The figure shows the isoquant Q=40 (the black curve) and the blue cost line 4x+y=80 that touches it.

The cost line touches the isoquant at the point (10, 40)2030801040xyx = 10, y = 40Q = 404x + y = 80

L=4x+y−λ (2 x0.5y0.5−40); Lx=4−λ x−0.5y0.5, Ly=1−λ x0.5y−0.5.

41=λ x−0.5y0.5λ x0.5y−0.5=yx, so y=4x.

2x⋅4x=4x=40: x=10, y=40.

4⋅10+40=80 €.

The multiplier as marginal cost. From 4=λ Qx follows λ=4Qx. At the optimum Qx=y/x=2, λ=2 €: this is about what one more unit of output costs (“Grenzkosten”, marginal cost). If part of the order is already in store, the set output is only the rest.

Trap. Answering with the quantities 10 or 40 instead of the cost 80. Turning the price ratio upside down: y=x4 gives x=40, y=10 and the cost 170.

Your turn3 of 4

A firm produces Q=x0.5y0.5; the first input costs 1 €, the second 4 €. Exactly 10 units are to be produced. What is the minimum cost?

How to split output between two plants: minimum cost

In the previous section two factors together gave one output. Here the output is made up of two parts, one per plant, and it has to be split so that the total cost is smallest:

Exam-style task

Ein Unternehmen stellt 166 Stück eines Produkts in zwei Werken her, x Stück im Werk 1 und y Stück im Werk 2. Die Kosten der Werke (in GE) sind

K1(x)=2 x2+8 x,K2(y)=y2+318 y

Wie viele Stück x soll Werk 1 herstellen, damit die Gesamtkosten minimal sind?

  1. a)83
  2. b)107
  3. c)63
  4. d)59
  5. e)159

How to recognise the task. “Ein Unternehmen stellt … Stück in zwei Werken her, x Stück im Werk 1 und y Stück im Werk 2” (a firm makes … pieces in two plants, x pieces in plant 1 and y pieces in plant 2), with two cost functions K1(x) and K2(y). You are asked for the quantity of one plant, the minimum total cost or λ.

The Lagrange function is L=K1(x)+K2(y)−λ (x+y−Q). With respect to x the term K2(y) gives 0, therefore Lx=K1′(x)−λ; with respect to y likewise Ly=K2′(y)−λ:

K1′(x)=K2′(y)=λ,x+y=Q
  • Steps: Lagrange function and marginal costs → Set the marginal costs equal → Put into the set output → Give the quantity asked for.
  • Memorise: K1′(x)=K2′(y)=λ and x+y=Q.

At the optimum both plants have the same marginal cost.

From L=K1(x)+K2(y)−λ⋅(x+y−166) we get K1′(x)=4x+8=λ and K2′(y)=2y+318=λ.

4x+8=2y+318.

y=166−x: 4x+8=2⋅(166−x)+318=650−2x, so 6x=642 and x=107.

The question asks for plant 1: 107 units. Plant 2 makes y=59, both have marginal cost λ=436. The option 59 is the output of the wrong plant.

A firm needs 60 units from two plants, K1(x)=1.5x2+20x, K2(y)=0.5y2+40y. The figure shows the marginal costs of the two plants against the output x of plant 1; plant 2 makes the rest, so its line falls, and the lines cross at the level 80.

The marginal costs of the plants are equal at 20 units in plant 1402080output of plant 1, unitsmarginal cost, €both plants atthe same levelplant 1: 3x + 20plant 2: 100 − x

L=1.5x2+20x+0.5y2+40y−λ (x+y−60); K1′(x)=3x+20, K2′(y)=y+40.

3x+20=y+40.

y=60−x: 3x+20=100−x, x=20, y=40.

λ=80; the cost K1(20)+K2(40)=1000+2400=3400 €.

Trap. Halving the output (cost 3600 instead of 3400), or answering with the average cost (“Durchschnittskosten”) 3400/60≈56.67 instead of λ=80. If x<0 comes out, plant 2 makes everything: x=0, y=Q. If part of the order is already in store, Q is only the rest.

Your turn4 of 4

50 units are made in two plants with K1(x)=x2+10x and K2(y)=1.5y2+30y. What is the multiplier λ at the minimum cost?

Formula sheet and what to memorise

The Lagrange method is not on the formula sheet; only the implicit derivative is there. Everything else from this article you keep in your head.

On the formula sheet:

  • implicit derivative f′(t)=−F1′(t,f(t))F2′(t,f(t)), that is −fxfy: the slope of the isoquant, section “Implicit derivative: slope of the isoquant”

Memorise yourself:

  • GRS =fxfy, the slope of the level curve is −GRS; Cobb-Douglas a yb x (section “Rate of substitution: the quotient of marginal utilities at a point”)
  • Lagrange function: the goal minus λ times (constraint minus number); three derivatives zero, λ is eliminated by dividing (sections “What to buy on a budget” and “How to make a set output most cheaply”)
  • maximum utility: UxUy=pxpy; for xayb the share aa+b of the budget (section “What to buy on a budget”)
  • minimum cost: QxQy=pq, λ=pQx; subtract the stock from the order (section “How to make a set output most cheaply”)
  • two plants: K1′(x)=K2′(y)=λ, x+y=Q (section “How to split output between two plants”)

Cards to memorise

Tap a card to see the formula. All topic cards

Formula

What is the Lagrange function for f(x,y) under the constraint g(x,y)=c?

Formula

What condition holds at the utility maximum under a budget?

Now practise it

The Lagrange method and implicit functions

Trainer · Functions of several variables

Practise
Next: Which method? Functions of two variables
0/4

Was this article helpful?