Sub topic 13
A Worked Example with Linear Curves
This chapter puts numbers on the ideas from earlier chapters. You will solve for a market equilibrium, shift each curve, and split every result into a shift and a movement along a curve. It assumes you can solve one linear equation for one unknown and can read a price-quantity graph. Price is on the vertical axis and quantity on the horizontal axis.
The model
A linear model writes each curve as a straight line:
- Demand: Qd = a - b·P
- Supply: Qs = c + d·P
Each letter has a job:
| Symbol | Meaning | What changes it |
|---|---|---|
| a | Demand intercept: quantity demanded if price were 0 | A demand shifter (income, tastes, and so on) |
| b | Demand slope: units lost per $1 price rise | The buyers' responsiveness to price |
| c | Supply intercept: quantity supplied if price were 0 | A supply shifter (input costs, technology, and so on) |
| d | Supply slope: units gained per $1 price rise | The sellers' responsiveness to price |
Price appears only as the variable P. A change in P never changes a, b, c, or d. This is the formal version of the chapter-long rule. A change in the good's own price moves you along a curve, and a change in a or c shifts the curve.
The baseline uses a = 100, b = 2, c = 20, and d = 3. That gives Qd = 100 - 2P and Qs = 20 + 3P.
Solving the baseline
The equilibrium is the price where quantity demanded equals quantity supplied:
- Set Qd = Qs: 100 - 2P = 20 + 3P.
- Collect the P terms on one side: 80 = 5P.
- Solve for price: P = 16.
- Substitute into either curve: Qd = 100 - 2(16) = 68, and Qs = 20 + 3(16) = 68.
Always substitute into both curves. If the two quantities differ, you made an algebra error.
The general solution follows the same steps:
- Equilibrium price: P* = (a - c) / (b + d)
- Equilibrium quantity: Q = a - b·P
The formula shows what drives the price. The numerator, a - c, is the gap between the two intercepts. The denominator, b + d, is the combined price responsiveness of both sides.
Moving along a curve
Before shifting anything, check the movement-along-a-curve idea with the same demand curve.
def quantity_demanded(price, a=100, b=2):
return a - b * price
# Movement along the curve: only the price changes.
print(quantity_demanded(16)) # 68
print(quantity_demanded(20)) # 60
# Shift of the curve: a non-price factor raises the intercept a.
print(quantity_demanded(16, a=120)) # 88Raising the price from 16 to 20 changes quantity demanded from 68 to 60. The curve stays the same, and this is a decrease in quantity demanded. Raising a from 100 to 120 changes the quantity demanded at the same price of 16 from 68 to 88. The curve itself moved, and this is an increase in demand.
Three shifts and their equilibria
The function below finds the equilibrium for any parameter set. Four calls reproduce the baseline and three scenarios.
def equilibrium(a, b, c, d):
# Demand: Qd = a - b*P Supply: Qs = c + d*P
price = (a - c) / (b + d)
quantity = a - b * price
return price, quantity
print(equilibrium(100, 2, 20, 3)) # baseline: (16.0, 68.0)
print(equilibrium(120, 2, 20, 3)) # demand increases: (20.0, 80.0)
print(equilibrium(100, 2, 40, 3)) # supply increases: (12.0, 76.0)
print(equilibrium(120, 2, 40, 3)) # both increase: (16.0, 88.0)| Scenario | a | c | Price | Quantity |
|---|---|---|---|---|
| Baseline | 100 | 20 | 16 | 68 |
| Demand increases | 120 | 20 | 20 | 80 |
| Supply increases | 100 | 40 | 12 | 76 |
| Both increase | 120 | 40 | 16 | 88 |
The pattern matches the single-shift rules from earlier chapters. A demand increase raises both price and quantity. A supply increase lowers price and raises quantity. When both increase, quantity rises in all cases. The price effect is ambiguous in general. Here the two shifts are the same size (20 units each), so the price effects cancel exactly and the price stays at 16. With different sizes the price would move.
Splitting a result into a shift and a movement
The demand-increase row hides two steps. The next script separates them.
def qd(price, a, b):
return a - b * price
def qs(price, c, d):
return c + d * price
a_old, a_new, b = 100, 120, 2
c, d = 20, 3
p_old = 16
# Step 1: the demand curve shifts; price is still 16.
print(qd(p_old, a_new, b)) # 88
print(qs(p_old, c, d)) # 68
print(qd(p_old, a_new, b) - qs(p_old, c, d)) # 20 (shortage)
# Step 2: price rises to 20, moving along both curves.
p_new = (a_new - c) / (b + d)
print(p_new) # 20.0
print(qd(p_new, a_new, b)) # 80
print(qs(p_new, c, d)) # 80The sequence is:
- Shift. The demand curve moves right. At the old price of 16, buyers now want 88 units and sellers still offer 68. The shortage is 20 units, which equals the change in a.
- Movement along the new demand curve. The shortage pushes the price up. As the price rises, quantity demanded falls from 88 to 80.
- Movement along the unchanged supply curve. The same price rise makes sellers offer more, so quantity supplied rises from 68 to 80.
The supply curve never shifted. Quantity supplied rose from 68 to 80, and that is a change in quantity supplied, not a change in supply. This is the most common wording error on this topic.
The net change in quantity, +12, is the sum of the +20 from the shift and the -8 from the movement along the new demand curve. The graph shows only the end state, but the algebra shows both parts.
Why the price rises by exactly 4
Each $1 of price increase closes 5 units of the gap. It cuts quantity demanded by b = 2 and raises quantity supplied by d = 3, and 2 + 3 = 5. A 20-unit shortage therefore needs a 20 / 5 = $4 price increase. This is the formula for any shift:
- Demand shift of Δa: ΔP = Δa / (b + d), and ΔQ = d·Δa / (b + d)
- Supply shift of Δc: ΔP = -Δc / (b + d), and ΔQ = b·Δc / (b + d)
Check them against the table. For the demand shift, ΔP = 20/5 = 4 and ΔQ = 3·20/5 = 12. For the supply shift, ΔP = -20/5 = -4 and ΔQ = 2·20/5 = 8. Both match the table (16 to 20 and 68 to 80, then 16 to 12 and 68 to 76).
The slope that sits in the numerator of ΔQ belongs to the curve that did not shift. A demand shift raises quantity more when supply is steeply responsive (large d), because sellers then supply most of the extra units.
Edge cases
- Negative values. A linear curve can give a negative price or quantity outside the range where the model makes sense. If c rises above a, the formula returns a negative price. Treat that result as a sign the market does not clear at any positive price. Do not report it as an answer.
- Choke price. Demand reaches zero at P = a / b, which is 50 for the baseline. Above that price, Qd = 100 - 2P would be negative, so the real demand is zero.
- Direction of the intercept. In the quantity form Qd = a - b·P, a larger a is a rightward shift. If you write price as a function of quantity (P = 50 - Q/2), a rightward shift is an upward shift of the intercept. Both describe the same move, so be sure which form you are using.
- Slope changes. Changing b or d changes the slope and responsiveness. That is not the same as the shifts studied here, which are parallel moves. Most demand and supply shifters in this tutorial are modeled as changes in a or c.
- Rounding. With non-integer parameters, floating-point results can differ in the last digits. Round before comparing Qd and Qs.
The workflow as a diagram
Exercises
Exercise
Start from the baseline (Qd = 100 - 2P, Qs = 20 + 3P). A drought cuts supply so that the supply intercept falls from 20 to 0, giving Qs = 3P. Find the new equilibrium price and quantity. Then say whether the quantity demanded at the new price is a change in demand or a change in quantity demanded.
Show answer
Set 100 - 2P = 3P, so 100 = 5P and P = 20. Then Q = 100 - 2(20) = 60, and Qs = 3(20) = 60. Price rises from 16 to 20 and quantity falls from 68 to 60. Demand did not shift, so the fall in quantity from 68 to 60 is a decrease in quantity demanded, a movement up along the unchanged demand curve.
Exercise
Demand rises from a = 100 to a = 110, and supply rises from c = 20 to c = 40, with b = 2 and d = 3. Find the new equilibrium. Which outcome, price or quantity, was ambiguous before you calculated, and which way did it go?
Show answer
P = (110 - 40) / (2 + 3) = 14, and Q = 110 - 2(14) = 82. Check supply: 40 + 3(14) = 82. Quantity was unambiguous because both increases raise it (68 to 82). Price was ambiguous, and here it fell from 16 to 14 because the supply shift (20 units) was larger than the demand shift (10 units).