MATH 250 · Mathematics for Economics II
Integration and Consumer Surplus
Integrals add up a curve's height over a range, which is how economists measure consumer and producer surplus.
Key takeaways
- A definite integral adds up a function's height across an interval; it equals the signed area under the curve.
- The fundamental theorem of calculus says you find it by taking an antiderivative F and computing F(b) − F(a).
- Consumer surplus is the area under the demand curve and above the price, up to the quantity bought.
- Producer surplus is the area above the supply curve and below the price.
- Integrating a marginal quantity (marginal cost, marginal benefit) over a range gives the total change.
Picture Maya, who runs a smoothie cart, on a hot afternoon. The first customer in line is desperate for something cold and would happily pay $19 for a smoothie. The next would pay $16, the one after that $11. But Maya charges everyone the same $11. The first customer pays $11 for something she valued at $19, and walks away $8 ahead. Add up every customer's gain like that and you get a number economists call consumer surplus: the total bonus buyers receive from a market.
When customers come one at a time, you add the bonuses on a calculator. When demand is a smooth curve, with millions of buyers each willing to pay a slightly different amount, you need a tool for adding up infinitely many tiny pieces. That tool is the integral. In Areas Under Curves: A First Look at Integrals you met integrals as areas. Here we use them for work: finding surplus, measuring a policy's cost, and adding up a rate over time.
The integral in four lines
Suppose f(x) is a curve above the horizontal axis. Slice the interval from a to b into thin vertical strips. Each strip has height f(x) and a tiny width dx, so its area is f(x) × dx. Add them all:
∫ from a to b of f(x) dx
The integral sign is a stretched S, for "sum." As the strips get thinner, the total settles on the exact area.
You rarely add strips by hand. The fundamental theorem of calculus gives a shortcut. If F is an antiderivative of f, meaning F′(x) = f(x), then
∫ from a to b of f(x) dx = F(b) − F(a)
Antiderivatives run derivatives backward. By the power rule for derivatives (the family of rules that includes Derivatives of Exponentials and Logarithms), the derivative of xⁿ⁺¹/(n + 1) is xⁿ. So the antiderivative of xⁿ is xⁿ⁺¹/(n + 1) (for n not equal to −1). The antiderivative of a constant c is c × x.
A tiny example: the area under f(x) = x² from 0 to 3. F(x) = x³/3. So the area is 3³/3 − 0 = 9.
Why surplus is an area
Think again about the line at the cart. Demand tells you the marginal willingness to pay: the amount the next customer would pay, as a function of how many have already bought. Call it P(Q). The first unit is worth P(0) to someone, the second a bit less, and so on, since demand slopes down.
If Maya sells Q* units at a market price p*, each buyer pays p* but the buyer of unit Q valued it at P(Q). The gain on that unit is P(Q) − p*. Add up the gains for all units from 0 to Q*:
Consumer surplus = ∫ from 0 to Q* of (P(Q) − p*) dQ = ∫ from 0 to Q* of P(Q) dQ − p* × Q*
The first term is the total value buyers place on what they get (the area under demand). The second is what they actually pay (a rectangle). The difference is the surplus. The same idea is behind the graph in Consumer Surplus, Producer Surplus and Efficiency, where you found it using triangles. Integrals let us handle demand curves that are not straight lines.
Likewise, producer surplus is what sellers receive minus the least they would have accepted. With a supply curve S(Q) giving the marginal cost of each unit:
Producer surplus = p* × Q* − ∫ from 0 to Q* of S(Q) dQ
The area under supply is the total cost of producing, and what is left over from revenue is profit above variable cost.
A worked example
Let us invent a market. Demand is P = 20 − Q² and supply is P = 2 + Q², with Q in thousands of smoothies and P in dollars. (Real demand curves are rarely so tidy, but the arithmetic is what we are after.)
Step 1: equilibrium. Set demand equal to supply: 20 − Q² = 2 + Q². So 18 = 2Q², Q² = 9, and Q* = 3. The price is p* = 2 + 9 = 11. (Check with demand: 20 − 9 = 11 ✓.)
Step 2: consumer surplus. The antiderivative of 20 − Q² is 20Q − Q³/3. At Q = 3 this is 60 − 9 = 51. At 0 it is 0. So the area under demand is 51. Buyers pay p* × Q* = 11 × 3 = 33. Consumer surplus = 51 − 33 = 18.
Step 3: producer surplus. The antiderivative of 2 + Q² is 2Q + Q³/3. At Q = 3 this is 6 + 9 = 15. Revenue is 33. Producer surplus = 33 − 15 = 18.
Step 4: total. Total surplus is 18 + 18 = 36 (thousand dollars, given our units). That is the most this market can create, a point developed further in Consumer Surplus, Producer Surplus and Efficiency.
Notice the symmetry. Buyers and sellers each walk away with 18, and nothing in the formulas forced that; it is a coincidence of the numbers we picked. With a steeper supply curve the sellers would get less and the buyers more. Real markets split the surplus in all sorts of ways, and who gets how much is often the heart of a policy argument. Economists measure the sizes first, then people argue about fairness.
A useful habit is to estimate before you integrate. The demand curve falls from 20 at Q = 0 to 11 at Q = 3, so the triangle above the price has height 9 and base 3, with area about 13.5. The true curve bows outward (it falls slowly at first), so the real area should be larger than the straight-line triangle. Our answer of 18 passes that sanity check.
What a price change costs buyers
Integrals make it easy to measure how much a policy hurts. Suppose a regulation pushes Maya's price to $16. Then buyers purchase only the quantity where demand equals 16: 20 − Q² = 16, so Q² = 4 and Q = 2.
New consumer surplus = ∫ from 0 to 2 of (20 − Q²) dQ − 16 × 2. The antiderivative at 2 is 40 − 8/3 = 37 and one third (112/3). Minus the payment of 32 gives 112/3 − 96/3 = 16/3, which is about 5.33.
Consumer surplus fell from 18 to 5.33, a drop of 38/3, about 12.67. Some of that is simply money that moved to sellers as higher prices. Some is a pure loss from trades that no longer happen. You can see which is which by splitting the area, and that leftover loss is the dead-weight loss of the policy.
Example with made-up numbers.
To check the split: at the new quantity 2, buyers pay 5 more per unit ($16 versus $11), costing them 5 × 2 = 10. The remaining 38/3 − 10 = 8/3, about 2.67, is the surplus of the one thousand customers who no longer buy. The numbers add: 18 − 10 − 2.67 = 5.33 ✓.
Integrals beyond surplus
Whenever you know a rate and want a total, you integrate.
- From marginal cost to total cost. If marginal cost is MC(Q) = 2 + Q², then variable cost to make Q units is the integral of MC from 0 to Q. We used that for the supply curve.
- From flow to stock. If a country invests at a rate I(t) per year, the capital added between years a and b is the integral of I(t). The same idea underlies Differential Equations for Growth Models.
- Present value of a stream. A payment flow of $100 per year, discounted continuously, has value equal to an integral of 100 × e^(−rt), the continuous version of the arithmetic in Discounting and Present Value Arithmetic.
- Income distributions. The share of people below an income level is the integral of a density curve, which is how measures of inequality are built.
A common mistake: wrong limits, wrong quantity
Check three things before computing a surplus.
First, integrate to the quantity that is actually bought, not to the point where demand hits zero. In our market demand reaches zero at about Q = 4.47, but only 3 units trade. Using the wrong upper limit gives a surplus far too big.
Second, subtract the payment. The area under demand is total value, not surplus. Forgetting the rectangle p* × Q* gives 51 instead of 18.
Third, mind the units. If Q is in thousands and P in dollars, surplus is in thousands of dollars. State the units in your answer.
A last slip is algebraic: forgetting that the antiderivative of Q² is Q³/3, not Q³. Differentiate your antiderivative as a quick check; you should get the original function back.
Words to know
Definite integral the signed area under a curve between two points, written with limits a and b.
Antiderivative a function whose derivative is the one you started with.
Fundamental theorem of calculus the rule that a definite integral equals F(b) − F(a) for any antiderivative F.
Consumer surplus the area under the demand curve and above the price, up to the quantity bought.
Producer surplus the area above the supply curve and below the price, up to the quantity sold.
Marginal willingness to pay the most the next buyer would pay for one more unit, read off the demand curve.
Dead-weight loss surplus that vanishes because trades that would have benefited both sides do not happen.
Check yourself
- Find the antiderivative of 6Q² and use it to compute the integral from 0 to 2.
- Demand is P = 10 − Q. The price is $4. Find the quantity bought and the consumer surplus by integration.
- In the lesson's market, find the producer surplus if the price were fixed at $11 but supply were P = 2 + Q² (confirm the 18).
- At a price of $16 the market of the lesson trades 2 thousand units. What is the consumer surplus, and how much of the fall from 18 is simply a transfer to sellers?
- Marginal cost is MC = 4 + 3Q². Find the variable cost of producing the first 2 units.
- Explain why consumer surplus is the area under demand minus a rectangle, and not just the area under demand.
Show the answers
- The antiderivative is 2Q³. At 2 it is 16 and at 0 it is 0, so the integral is 16.
- Set 10 − Q = 4, so Q = 6. The area under demand is 10 × 6 − 36/2 = 60 − 18 = 42, minus payment 4 × 6 = 24, giving consumer surplus 18 (equal to the triangle: ½ × 6 × 6).
- Revenue is 11 × 3 = 33; the integral of 2 + Q² from 0 to 3 is 6 + 9 = 15; producer surplus is 33 − 15 = 18.
- Consumer surplus is 112/3 − 32 = 16/3, about 5.33; the transfer to sellers is 5 × 2 = 10 of the 12.67 fall.
- The antiderivative is 4Q + Q³; at 2 it is 8 + 8 = 16, so the variable cost is 16.
- The area under demand is the total value buyers place on the units; they hand over p* × Q* of it, so only the remainder is a bonus.