Sub topic 4
Equilibrium price and quantity
This chapter assumes you can read a linear demand or supply equation such as P = a − bQ, solve two linear equations for two unknowns, and sketch supply and demand curves. The earlier chapters in this tutorial covered willingness to pay, the demand curve, and seller cost. Here we combine the two curves to find the price and quantity where the market settles. The surplus chapters that follow all measure areas relative to this point.
What equilibrium means
A market equilibrium is a price at which the quantity buyers want to purchase equals the quantity sellers want to sell. Economists call this price the market-clearing price, and the matching quantity the equilibrium quantity. At that price, every buyer who is willing to pay it can buy, and every seller who is willing to sell at it can sell.
Two facts make this point useful for surplus analysis:
- On the demand curve, the price of each unit is the maximum willingness to pay of the marginal buyer, the person who would buy that unit and no more.
- On the supply curve, the price of each unit is the minimum payment the marginal seller needs, which is that unit's marginal cost.
At the equilibrium quantity, the last unit traded is worth exactly what it costs to produce. Every earlier unit was worth more than it cost. Every later unit would cost more than it is worth. That is why equilibrium is the quantity that squeezes out all the gains from trade, a point the total surplus chapter will make precise.
Finding equilibrium algebraically
Take the linear market used throughout this tutorial:
- Demand: P = 100 − 2Q
- Supply: P = 10 + Q
Set the two prices equal, because at equilibrium both curves give the same price for the same quantity:
100 − 2Q = 10 + Q
Collect terms: 90 = 3Q, so Q = 30. Substitute into either curve: P = 10 + 30 = 40. Check with demand: 100 − 2(30) = 40. Both agree.
For general curves P = a − bQ and P = c + dQ, the formulas are:
- Q* = (a − c) / (b + d)
- P = c + d·Q
The numerator a − c is the vertical gap between the two intercepts. It measures the gain from the very first unit: the most any buyer would pay minus the least any seller would accept. If this gap is zero or negative, no trade is mutually beneficial and the equilibrium quantity is zero.
def equilibrium(a, b, c, d):
"""Demand: P = a - b*Q. Supply: P = c + d*Q.
Returns (quantity, price), or (0.0, None) if no trade is worthwhile."""
if a <= c:
return 0.0, None
q = (a - c) / (b + d)
p = c + d * q
return q, p
print(equilibrium(100, 2, 10, 1)) # (30.0, 40.0)
print(equilibrium(5, 2, 10, 1)) # (0.0, None)Why the market moves to equilibrium
The equilibrium is a resting point because prices away from it create pressure to change. The table shows our market at several prices. Quantity demanded is Qd = (100 − P) / 2, and quantity supplied is Qs = P − 10.
| Price | Quantity demanded | Quantity supplied | Qs − Qd | Situation |
|---|---|---|---|---|
| 20 | 40 | 10 | −30 | Shortage |
| 30 | 35 | 20 | −15 | Shortage |
| 40 | 30 | 30 | 0 | Equilibrium |
| 50 | 25 | 40 | 15 | Excess supply |
| 60 | 20 | 50 | 30 | Excess supply |
At a price above 40, sellers want to sell more than buyers want to buy. Unsold goods pile up, and sellers who want to move stock have a reason to cut prices. At a price below 40, buyers want more than sellers offer. Some buyers cannot get the good, and they have a reason to offer more. Both pressures push the price toward 40.
This adjustment story is a model, not a law. It works when prices can move freely and quickly. Section "Edge cases" below covers situations where it fails.
You can check the table in code by computing excess supply at any price:
a, b = 100, 2 # demand: P = a - b*Q
c, d = 10, 1 # supply: P = c + d*Q
def excess_supply(price):
qd = (a - price) / b
qs = (price - c) / d
return qs - qd
for p in (20, 30, 40, 50, 60):
print(p, excess_supply(p))
# 20 -30.0
# 30 -15.0
# 40 0.0
# 50 15.0
# 60 30.0A negative value is a shortage and a positive value is excess supply. The function crosses zero exactly once, at P = 40, because both curves are straight lines with opposite slopes.
How shifts move the equilibrium
A change in anything other than the good's own price moves a whole curve. That changes the equilibrium. Using the formulas above, here are two shifts from the base case (a = 100, c = 10):
- Demand rises, so the intercept goes from a = 100 to a = 120. Then Q = (120 − 10) / 3 ≈ 36.67 and P = 10 + 36.67 ≈ 46.67. Price and quantity both rise.
- Supply falls, as when input costs rise, so the intercept goes from c = 10 to c = 20. Then Q = (100 − 20) / 3 ≈ 26.67 and P = 20 + 26.67 ≈ 46.67. Price rises and quantity falls.
def equilibrium(a, b, c, d):
q = (a - c) / (b + d)
return q, c + d * q
base = equilibrium(100, 2, 10, 1)
demand_up = equilibrium(120, 2, 10, 1)
supply_down = equilibrium(100, 2, 20, 1)
for name, (q, p) in [("base", base), ("demand up", demand_up), ("supply down", supply_down)]:
print(f"{name}: Q = {q:.2f}, P = {p:.2f}")
# base: Q = 30.00, P = 40.00
# demand up: Q = 36.67, P = 46.67
# supply down: Q = 26.67, P = 46.67The direction rule is worth memorizing. A demand shift moves price and quantity in the same direction. A supply shift moves them in opposite directions. When both curves shift at once, the effect on one of the two variables is ambiguous without numbers.
The two shifts above happen to give the same new price. That is a coincidence of the chosen numbers, not a general result. The quantity effects differ, and so will the surplus effects, which later chapters examine.
Equilibrium as the benchmark for surplus
The surplus chapters use equilibrium as a reference point. Once you know Q and P, three things follow directly:
- Consumer surplus is the area between the demand curve and the price line P, from 0 to Q.
- Producer surplus is the area between the price line P and the supply curve, from 0 to Q.
- Total surplus is their sum, which for linear curves is the triangle between the two curves out to Q*.
For our market, the triangle between the curves has base Q* = 30 and height a − c = 90. Its area is 0.5 × 30 × 90 = 1350, which matches the total surplus in the worked example from the topic overview (900 for consumers plus 450 for producers).
Edge cases and common errors
Intermediate learners often make the following mistakes. Check for each one when your answer looks wrong.
- Mixing up the axes. Textbooks draw price on the vertical axis, so a curve written as P = a − bQ has slope −b in the usual diagram. If a problem gives you Q = 50 − 0.5P instead, invert it before applying the formulas: P = 100 − 2Q. Using the coefficients of a quantity-form equation as if they were price-form coefficients gives wrong numbers.
- Forgetting the corner case. If the demand intercept is not above the supply intercept, the formula returns a negative or zero quantity. Negative quantity is meaningless, so the correct answer is no trade.
- Assuming one equilibrium. With linear curves of opposite slope there is exactly one. With nonlinear curves, such as a backward-bending supply curve or demand with network effects, there can be several, or none. The adjustment argument above then needs more care, because only some equilibria are stable.
- Ignoring that adjustment takes time. The model describes where prices head, not how fast. Markets with sticky prices, such as labor markets with contracts or regulated rents, can sit away from equilibrium for long periods.
- Treating the price line as fixed. Equilibrium price is an outcome of the model. When a policy sets a price instead, as a ceiling or floor does, the market no longer sits at P*, and the quantity traded is the smaller of Qd and Qs. A later chapter works through that case.
- Confusing a shift with a movement along a curve. A change in the good's own price moves you along the curve. A change in income, input cost, or tastes moves the curve.
Practice
Exercise
A market has demand P = 120 − 3Q and supply P = 20 + 2Q. (a) Find the equilibrium quantity and price. (b) At a price of 70, how large is the excess supply or shortage, and in which direction will the price tend to move?
Show answer
(a) Set 120 − 3Q = 20 + 2Q, so 100 = 5Q and Q = 20. Then P = 20 + 2(20) = 60; check with demand: 120 − 60 = 60. (b) At P = 70, quantity demanded is (120 − 70) / 3 ≈ 16.67 and quantity supplied is (70 − 20) / 2 = 25. Excess supply is 25 − 16.67 ≈ 8.33 units. Sellers cannot sell all they want to, so the price tends to fall toward 60.
Exercise
In the base market (demand P = 100 − 2Q, supply P = 10 + Q), a new tax on inputs raises the supply intercept from 10 to 25 while leaving the slopes unchanged. Find the new equilibrium and say whether quantity rises or falls.
Show answer
Q = (100 − 25) / (2 + 1) = 25, and P = 25 + 25 = 50. Quantity falls from 30 to 25 and price rises from 40 to 50. This is a supply decrease, so price and quantity move in opposite directions.