# 15.3 Consumer and Producer Surplus

Up to now there has been no mention of prices; all we were doing was solving for the optimal quantity. So, how does the equilibrium price in competitive markets result in the optimal quantity? Fundamentally, our model of consumer choice tells us that consumers maximize their utility by setting their marginal benefit equal to the price, while firms set price equal to marginal cost. Therefore, as long as both consumers and firms are *price takers* and “take” the same price, markets will set consumers’ marginal benefit equal to firms’ marginal cost.

Let’s break that down a bit more precisely, by analyzing how total welfare may be thought of as the sum of consumer’s surplus and producer’s surplus.

## Consumer’s Surplus

Recall that our consumer in this example had the quasilinear utility function
\(u(x_1,x_2) = v(x_1) + x_2\)
where $x_2$ was “dollars spent on other goods.” If this consumer has income $m$ and can buy as much good 1 at price $p_1$, then the amount of money they’ll have to spend on other goods if they buy $x_1$ units of good 1 is just $x_2 = m - p_1x_1$. Therefore we can write their utility *just in terms of $x_1$* as
\(u(x_1) = v(x_1) + m - p_1x_1\)
Note that this is their income $m$, plus their **total benefit** from good 1 $v(x_1)$ minus their **total expenditure** on good 1, $p_1x_1$. We can therefore define their **(net) consumer’s surplus** as their total benefit from good 1, minus the total expenditure:
\(CS(x_1) = \overbrace{v(x_1)}^{TB} - \overbrace{p_1x_1}^{TE}\)
Visually, this is the vertical distance between the total benefit curve and a line with slope $p_1$. It’s also the integral, from 0 to $x_1$, of the marginal benefit minus the price — that is, the area of total benefit, minus the green rectangle with width $x_1$ and height $p_1$ representing their total expenditure, $p_1x_1$:

Intuitively, consumer’s surplus is therefore the sum of the value the consumer gets from each unit, above and beyond the price they have to pay for it.

If you set any price in the diagram above, you can see that CS is maximized when the consumer buys the quantity that sets their $MB = p$. Intuitively, if they buy less than that amount, they are giving up their potential surplus from the additional units which would bring them a benefit above and beyond the price; and if they buy more than that amount, they’re paying more for the last units than they are receiving benefit from those units. (This *reduction* in surplus is shown as the negative number in the shaded area below the price line and above the MB curve.)

## Producer’s Surplus

For firms, producer’s surplus is defined as their total revenues minus their total *variable* costs. (This is slightly different than profits, because profits are defined as total revenues minus all total costs, including fixed costs.) To avoid dealing with this disparity, we’ve been looking at a firm with only variable costs in this example; hence producer’s surplus and profits are the same for this example.

Intuitively, producer’s surplus is therefore the sum of the revenue the producer gets from selling each unit, above and beyond the cost they have to pay to produce it.

If you set any price in the diagram above, you can see that PS is maximized when the firm produces the quantity that sets their $MC = p$. Intuitively, if they produce less than that amount, they are giving up their potential surplus from the additional units which would bring them a benefit above and beyond the cost; and if they produce more than that amount, they’re paying more to produce the last units than they are receiving revenue from selling those units. (This *reduction* in surplus is shown as the negative number in the shaded area above the price line and under the MC curve.)

## Total surplus

Let’s bring the consumer and the producer together into a market. Let’s have $Q$ be the quantity bought and sold in the market, and $P$ be the market price. Using the analysis above, we can see that consumers try to maximize $CS = TB(Q) - P \times Q$, while firms try to maximize $PS = P \times Q - TC(Q)$. Note that if we add these together, we get
\(\begin{aligned}
CS + PS &= TB(Q) - P \times Q + P \times Q - TC(Q)\\
&= TB(Q) - TC(Q)\\
\end{aligned}\)
which was our definition of total welfare, or $W(Q)$. Note that this implies that a “social planner” cares only about the benefit to the consumer and the cost to the firm, and *doesn’t care at all* about the transfer of money between them.

Remember that the social planner wanted to choose the quantity that set $MB(Q) = MC(Q)$. Well, since the consumer sets $P = MB(Q)$ to maximize their surplus, and the firm sets $P = MC(Q)$ to maximize its surplus, having a *single price in the market* coordinates their activities so that $MB(Q) = MC(Q)$. Therefore, at the competitive market equilibrium, total welfare is maximized: