MATH 250 · Mathematics for Economics II

Total Differentials and the Chain Rule

Add up each input's marginal effect to estimate the full change in output, then follow that change through time.

Key takeaways

  • The total differential adds up each input's marginal effect times its change: dQ = Q_K × dK + Q_L × dL.
  • It is a linear estimate. It is accurate for small changes and drifts for large ones.
  • When inputs themselves change over time, the chain rule gives dQ/dt = Q_K × dK/dt + Q_L × dL/dt.
  • Setting the differential of a utility function to zero gives the slope of an indifference curve.
  • The slope of a level curve is the negative ratio of the two marginal effects.

Priya's bike shop is growing. Next month she plans to add a repair stand and hire another mechanic, both at once. She already knows what each would do alone, thanks to partial derivatives. But does the combined gain equal the sum of the two separate gains? And what if both inputs creep upward a little every day, so that output slides upward along with them?

This lesson answers both questions. The first answer is the total differential. The second is the chain rule for many variables. Together they let you follow a change from the inputs all the way to the output, no matter how many things move.

The estimate: adding up pieces

Let's reuse the bike shop. Output is Q = 2KL, with K repair stands and L mechanics. Priya starts at K = 3 and L = 4, so Q = 24 bikes a week. The partial derivatives at that point are Q_K = 2L = 8 and Q_L = 2K = 6.

Suppose, to keep it small and clean, that she adds a tenth of a stand (maybe she rents half-time space) and a fifth of a mechanic (a part-timer). So dK = 0.1 and dL = 0.2. The letter d means "a small change in." The total differential is the sum of each input's own contribution:

dQ = Q_K × dK + Q_L × dL
dQ = 8 × 0.1 + 6 × 0.2
dQ = 0.8 + 1.2 = 2.0

So the estimate says output rises by about 2 bikes. Now the truth. The new inputs are K = 3.1 and L = 4.2, so Q = 2 × 3.1 × 4.2 = 26.04. The real gain is 26.04 − 24 = 2.04.

The estimate (2.0) is off by 0.04. Where did the missing 0.04 go? It is the cross effect: the extra stand and the extra mechanic work together, and the pair is worth a bit more than the two pieces added separately. Exactly, that bonus is 2 × dK × dL = 2 × 0.1 × 0.2 = 0.04. The differential ignores it because that term is the product of two small numbers, which is tiny compared with either alone. If both changes are ten times smaller, the error is a hundred times smaller.

Where the extra 2.04 bikes come from
Now (K=3, L=4) 24bikes Extra stand +0.80bikes Extra mechanic +1.20bikes Working together +0.04bikes After the change 26.04bikes Now (K=3, L=4) 24bikes Extra stand +0.80bikes Extra mechanic +1.20bikes Working together +0.04bikes After the change 26.04bikes

The differential captures the two middle steps. The small bonus at the end is what it leaves out. Example with made-up numbers.

This is the core idea. The differential replaces a curved surface with a flat tile that touches it at one point. For a small step, the tile and the surface are nearly the same height. For a big step, they part ways.

The total differential
dQ = Q_K × dK + Q_L × dL dQ = Total change Estimated change in output. Q_K × dK = Stand effect Marginal product of stands times the added stands. Q_L × dL = Mechanic effect Marginal product of mechanics times the added mechanics. dQ = Q_K × dK + Q_L × dL dQ = Total change Estimated change in output. Q_K × dK = Stand effect Marginal product of stands times the added stands. Q_L × dL = Mechanic effect Marginal product of mechanics times the added mechanics.

Each term is a marginal effect times the size of that input's change.

Stay on the same level: indifference curves

Here is a clever use. Suppose you want to change both inputs but leave the output exactly where it is. Then dQ = 0. Set the differential to zero:

0 = Q_K × dK + Q_L × dL

Solve for the ratio dL/dK, which is the slope of the level curve:

dL/dK = − Q_K ÷ Q_L

For Priya's shop at (3, 4): dL/dK = −8 ÷ 6 = −1.33. Add one stand, and you can let go of about 1.33 mechanics without losing output.

Check against the exact level curve. Q = 24 means 2KL = 24, so L = 12 ÷ K. At K = 3, L = 4. At K = 3.1, L = 12 ÷ 3.1 = 3.871. The change is 3.871 − 4 = −0.129 for a step of 0.1, a rate of −1.29. Close to −1.33. The tiny gap shrinks as the step shrinks.

The same trick works for Dara's utility U = xy from the first lesson. Here U_x = y and U_y = x, so along an indifference curve dy/dx = −y/x. At the basket (3, 4), the slope is −4/3. Economists call the positive version of that number the marginal rate of substitution: how many coffees Dara will swap for one cupcake and stay equally happy. You can check it with the U = 12 curve: y = 12/x has slope −12/x², which at x = 3 is −12/9 = −4/3. It matches.

The slope of an indifference curve is −U_x ÷ U_y
Cups of coffee (y) U = 12 Slope −4/3 at (3, 4) (3, 4) dy/dx = −y/x Cupcakes (x) Cups of coffee (y) U = 12 Slope −4/3 at (3, 4) (3, 4) dy/dx = −y/x Cupcakes (x)

The dashed line has slope (0 − 6) ÷ (6 − 1.5) = −6 ÷ 4.5 = −4/3, and it passes through (3, 4): from (3, 4), going left 1.5 raises y by 2 to 6, and going right 3 lowers y by 4 to 0. The picture checks out.

When inputs move with time: the chain rule

Now the second question. Suppose K and L are not changed once but drift over time t (measured in weeks). Say Priya's plan is

K(t) = 3 + 0.5 × t
L(t) = 4 + t

so a half stand and one mechanic arrive each week. Output Q depends on K and L, which depend on t. This is a chain: t affects K and L, and K and L affect Q. The chain rule for several variables follows the chain through every link and adds up the paths:

dQ/dt = Q_K × dK/dt + Q_L × dL/dt

It is the total differential, divided by dt. At t = 0, where K = 3 and L = 4:

dK/dt = 0.5      dL/dt = 1
dQ/dt = 8 × 0.5 + 6 × 1 = 4 + 6 = 10 bikes per week

Verify by substituting first. Q(t) = 2 × (3 + 0.5t) × (4 + t) = 2 × (12 + 3t + 2t + 0.5t²) = 24 + 10t + t². The derivative of that is 10 + 2t, which at t = 0 equals 10. It matches.

Notice what the chain rule tells you that the substitution does not. It splits the 10 into causes: 4 bikes per week come from the growing stand count and 6 from the growing staff. For a manager asking where the growth is coming from, that breakdown is the useful part. It is like a derivative with a receipt.

Following the chain from time to output
Q_K × dK/dt = 8 × 0.5 4 bikes per week Q_L × dL/dt = 6 × 1 6 bikes per week through stands through mechanics Output Q grows 10 bikes per week dQ/dt at t = 0 Output Q grows 10 bikes per week dQ/dt at t = 0 through stands: Q_K × dK/dt = 8 × 0.5 4 bikes per week through mechanics: Q_L × dL/dt = 6 × 1 6 bikes per week

The chain rule appears in much of economics. GDP depends on capital and labor, and both change over time, so growth in GDP splits into growth from capital and growth from labor. A firm's profit depends on price and quantity, which both move over the year. Anytime a "final answer" depends on things that themselves depend on something else, the chain rule links them.

A second story: revenue from price and quantity

Differentials are not only for factories. Take a shop that sells phone cases. Revenue is R = p × q, where p is the price and q the number sold. At p = $10 and q = 100, revenue is $1,000. The partial derivatives are R_p = q = 100 and R_q = p = 10.

Suppose the owner raises the price by 50 cents (dp = 0.5) and, as a result, sells 4 fewer cases (dq = −4). The differential says

dR = R_p × dp + R_q × dq
dR = 100 × 0.5 + 10 × (−4)
dR = 50 − 40 = +10

Revenue should rise by about $10. The exact answer: the new price is $10.50 and new quantity 96, so R = 10.5 × 96 = $1,008, a gain of $8. The estimate is $2 too high. The missed cross effect is dp × dq = 0.5 × (−4) = −2. It is negative this time, because the price went up while the quantity went down. Moves in opposite directions give a negative cross effect.

The two terms have a meaning worth saying out loud. The +50 is the gain from charging more on the cases you still sell as before. The −40 is the loss from the buyers who walked away, each worth the old price of $10. Whether a price rise helps revenue depends on which term is larger. That tug of war is the heart of the elasticity idea you met in elasticity with calculus, and the differential gives you a quick way to see it.

How good is the flat tile?

You may wonder how small "small" is. A handy rule of thumb: the error of the differential is about the size of the second-order terms, the cross effect plus the squares of each change times the curvature. For Priya's shop the error was only the cross effect, 2 × dK × dL, because the function has no squared terms. Compare moves of different size.

Move              Differential   Exact change   Error
dK=0.1, dL=0.2        2.0            2.04         0.04
dK=0.5, dL=1         10             11            1
dK=3,   dL=4         48             72           24

Check the middle row. The differential for dK = 0.5 and dL = 1 is 8 × 0.5 + 6 × 1 = 10. The exact change is 2 × 3.5 × 5 − 24 = 35 − 24 = 11. The error is 1, which equals 2 × 0.5 × 1.

When the move grows by a factor of ten, the error grows by a factor of a hundred. That is why careful economists say "for small changes" nearly every time they use a differential. For a rough, back-of-the-envelope feel, the estimate is wonderful. For a final budget, compute the exact figure.

A common mistake

The most common mistake is using the differential for a big jump. Say Priya doubles her shop: dK = 3 and dL = 4. The differential gives dQ = 8 × 3 + 6 × 4 = 24 + 24 = 48. The true answer: K = 6, L = 8, Q = 2 × 6 × 8 = 96, a gain of 72. The estimate is off by 24, a full third of the truth. The cross effect 2 × 3 × 4 = 24 is no longer small. Use differentials only for small moves, or accept the error.

A second error is forgetting a link in the chain. If K depends on t, and L also depends on t, you need both terms. Dropping one means you have counted only half the story. A good check: count the paths from t to Q. Each path gives one term.

A third error is a sign slip on the level curve. The slope is negative Q_K ÷ Q_L. The minus comes from moving the L term to the other side of the equation. Level curves of normal production and utility functions slope downward, so a positive answer should make you pause.

Words to know

Differential a tiny change in a variable, written with a d in front, such as dK.

Total differential the estimated change in output from small changes in all inputs, found by adding each marginal effect times its input change.

Chain rule a rule that follows a change through several links and adds the effects along every path.

Marginal rate of substitution the amount of one good a person will give up for one more unit of another good while staying equally happy.

Linear approximation using a straight line or flat tile in place of a curve, accurate for small changes.

Cross effect the extra change from two inputs moving together, which the total differential leaves out.

Check yourself

  1. For Q = 2KL at K = 3 and L = 4, use the total differential to estimate the change in Q for dK = 0.2 and dL = 0.1.
  2. What is the exact change for the same move, and how far off is the estimate?
  3. For U = xy at the basket (4, 3), find the slope of the indifference curve dy/dx.
  4. K(t) = 3 + 0.5t and L(t) = 4 + t. Use the chain rule to find dQ/dt for Q = 2KL at t = 2.
  5. Why does the differential get worse for large changes?
  6. In a chain-rule problem with three paths from t to the output, how many terms do you need?
Show the answers
  1. dQ = 8 × 0.2 + 6 × 0.1 = 1.6 + 0.6 = 2.2 bikes.
  2. New Q = 2 × 3.2 × 4.1 = 26.24, so the change is 2.24; the estimate is 0.04 low, which is the cross effect 2 × 0.2 × 0.1.
  3. U_x = y = 3 and U_y = x = 4, so dy/dx = −3 ÷ 4 = −0.75.
  4. At t = 2, K = 4 and L = 6, so Q_K = 2L = 12 and Q_L = 2K = 8; dQ/dt = 12 × 0.5 + 8 × 1 = 6 + 8 = 14 (check: Q(t) = 24 + 10t + t², derivative 10 + 2 × 2 = 14).
  5. It replaces a curved surface with a flat tile, and the tile drifts away from the surface as you move farther from the starting point; the cross effect grows with the product of the changes.
  6. Three terms, one for each path, added together.

A free self-study program written for 4Economics with AI writing tools and not reviewed line by line by a person. It is not an accredited degree and awards no credit. Check anything you rely on against a textbook or primary source. Report an error.

In this unit: Several variables

  1. Functions of Several Variables and Level CurvesLearn how a payoff that depends on two or more things is described, and how level curves turn a 3D hill into a flat map.11 min
  2. Partial DerivativesFreeze every input but one and take an ordinary derivative: that is how economists measure one-at-a-time marginal effects.10 min
  3. Total Differentials and the Chain RuleAdd up each input's marginal effect to estimate the full change in output, then follow that change through time.11 min
  4. Implicit Differentiation and Comparative StaticsFind how a market's price and quantity respond to a change in income or taxes without ever solving for the equilibrium.11 min
  5. Homogeneous Functions and Euler's TheoremSee what happens to output when every input is scaled up together, and why paying inputs their marginal products can use up all output.11 min

In the news