Sub topic 3
Measuring gains from trade: consumer and producer surplus
This chapter assumes you can read supply and demand curves, find an equilibrium price and quantity, and compute the area of a triangle. It uses one running example throughout: demand P = 100 − Q and supply P = 20 + Q. Setting the two equal gives an equilibrium quantity of 40 and an equilibrium price of 60.
Why we need a measure of gains
A market trade happens only if both sides come out ahead. To say how much a tax or a price control destroys, we first need a number for how much a market creates. Consumer surplus and producer surplus supply that number. Deadweight loss, defined in a later chapter, is the drop in their sum.
Willingness to pay and cost
The demand curve can be read in two ways. Horizontally, it tells you the quantity buyers want at a price. Vertically, it tells you the maximum price the marginal buyer would pay for a given unit. That maximum is the buyer's willingness to pay.
The supply curve has the same two readings. Read vertically, it gives the minimum price a seller must receive to supply a given unit. For a competitive seller this is the marginal cost of that unit.
In the running example, the 10th unit is worth 90 to the buyer who takes it, since P = 100 − 10. It costs 30 to produce, since P = 20 + 10. If that unit trades at 60, both sides gain.
Consumer surplus
Consumer surplus is the total willingness to pay of the buyers who purchase, minus what they actually pay. On a diagram it is the area below the demand curve and above the price, out to the quantity traded.
For linear demand this area is a triangle:
- Base: the quantity traded, 40.
- Height: the choke price (the price where demand reaches zero quantity, here 100) minus the market price, 100 − 60 = 40.
- Area: 0.5 × 40 × 40 = 800.
Producer surplus
Producer surplus is the revenue sellers receive minus the cost of producing what they sell. On a diagram it is the area above the supply curve and below the price, out to the quantity traded.
- Base: 40.
- Height: the market price minus the supply intercept, 60 − 20 = 40.
- Area: 0.5 × 40 × 40 = 800.
Producer surplus is not the same as profit. It ignores fixed costs, which do not vary with output, so it measures revenue minus variable cost.
Computing surplus in code
For linear curves, the area up to quantity q can be written as a formula. Demand is P = a − bQ and supply is P = c + dQ.
- Total willingness to pay for q units is a·q − 0.5·b·q².
- Total cost of q units is c·q + 0.5·d·q².
Consumer surplus is total willingness to pay minus spending p·q. Producer surplus is revenue p·q minus total cost. The function below takes the price and the quantity actually traded as separate inputs, so it can also describe markets that are not at equilibrium.
def surplus(a, b, c, d, price, quantity):
"""Consumer and producer surplus for demand P = a - b*Q and supply P = c + d*Q.
Assumes the units traded go to the buyers with the highest willingness
to pay and are produced by the sellers with the lowest cost.
"""
total_value = a * quantity - 0.5 * b * quantity**2
total_cost = c * quantity + 0.5 * d * quantity**2
spending = price * quantity
consumer = total_value - spending
producer = spending - total_cost
return {"consumer": consumer, "producer": producer, "total": consumer + producer}
# Competitive equilibrium: price 60, quantity 40
print(surplus(100, 1, 20, 1, price=60, quantity=40))
# {'consumer': 800.0, 'producer': 800.0, 'total': 1600.0}
# A price fixed at 50: sellers supply only 30 units (20 + Q = 50)
print(surplus(100, 1, 20, 1, price=50, quantity=30))
# {'consumer': 1050.0, 'producer': 450.0, 'total': 1500.0}The first call reproduces the triangle areas. The second call shows a preview of what comes later. At a price of 50, buyers gain 250 and sellers lose 350. Total surplus falls from 1600 to 1500, and that 100 is lost outright.
What moves surplus, and what does not
When the price rises with the quantity held fixed, money moves from buyers to sellers. Consumer surplus falls by exactly what producer surplus rises. This is a transfer, and it leaves total surplus unchanged.
Total surplus changes only when the quantity traded changes. A trade that no longer happens takes away a gain that both sides would have shared. The next chapters rely on this distinction.
| Change | Effect on consumer surplus | Effect on producer surplus | Effect on total surplus |
|---|---|---|---|
| Price rises, quantity unchanged | Falls | Rises by the same amount | None |
| Price falls, quantity unchanged | Rises | Falls by the same amount | None |
| Quantity traded falls below equilibrium | Falls | Falls | Falls |
Where surplus sits on the curves
Surplus is made up of many small layers, one per unit. The first units traded produce the largest gains, because they go to the buyer who values them most and the seller who produces them most cheaply. The 40th unit is worth 60 to the marginal buyer and costs 60 to produce, so it adds nothing. Units beyond 40 would cost more than they are worth, so a competitive market stops there.
That is why the triangles have a pointed edge at the equilibrium quantity. Losing a unit near the equilibrium costs little. Losing a unit near the start of the curve costs a lot. When a tax or a price control removes trades, it tends to remove the marginal ones first, and the size of the loss depends on how far the quantity falls.
Common mistakes
- Using the wrong height. The height of the consumer triangle is measured from the price up to the demand intercept, not from zero. The height of the producer triangle is measured from the supply intercept up to the price.
- Treating surplus as money. Consumer surplus is not cash anyone holds. It is the value buyers receive beyond what they paid. It is measured in money units, but no one receives it.
- Applying the triangle formula to a non-linear curve. The area formulas above hold only for straight lines. For curved demand or supply you need to integrate.
- Assuming efficient allocation. The
surplusfunction above assumes the highest-value buyers get the goods. If a shortage is rationed by luck or by queuing, buyers with low values can crowd out buyers with high values, and actual surplus is lower than the formula says. A later chapter returns to this.
Exercises
Exercise
Demand is P = 80 − Q and supply is P = 10 + Q. Find the equilibrium, then compute consumer surplus, producer surplus, and total surplus.
Show answer
Setting 80 − Q = 10 + Q gives Q = 35 and P = 45. Consumer surplus = 0.5 × 35 × (80 − 45) = 612.5. Producer surplus = 0.5 × 35 × (45 − 10) = 612.5. Total surplus = 1225.
Exercise
In the running market (demand P = 100 − Q, supply P = 20 + Q), the price is held at 70 and 40 units are somehow still traded. What happens to consumer surplus, producer surplus, and total surplus compared with the equilibrium?
Show answer
Consumer surplus falls to 600 and producer surplus rises to 1000, because total value is 100 × 40 − 0.5 × 1600 = 3200, spending is 2800, and total cost is 20 × 40 + 800 = 1600. That gives consumer surplus = 3200 − 2800 = 400 and producer surplus = 2800 − 1600 = 1200. Correcting the earlier figures, consumer surplus is 400, producer surplus is 1200, and total is 1600. The 400 lost by buyers is gained by sellers, so it is a transfer. Total surplus is unchanged because the quantity is unchanged.