Behind every demand curve lies a model of how individual consumers make choices. The starting point is the concept of utility, the satisfaction a consumer derives from goods. A utility function assigns a numerical value to each consumption bundle, allowing us to rank preferences. Marginal utility is the additional satisfaction from consuming one more unit of a good, and the law of diminishing marginal utility says that, holding consumption of other goods constant, marginal utility eventually declines as more of a good is consumed. This tendency explains, at a basic level, why consumers are willing to pay less and less for successive units.
Consumers are constrained by income and prices. The budget constraint expresses the combinations of two goods that a consumer can afford: \( P_1 Q_1 + P_2 Q_2 = \text{Income} \). Within this affordable set, the consumer's preferences are represented by indifference curves, each of which shows all bundles of two goods that yield the same utility. Indifference curves are typically downward-sloping and convex, and the marginal rate of substitution (MRS) is the rate at which the consumer is willing to trade one good for another while staying on the same indifference curve, equal to the absolute slope of the curve. The consumer's optimal choice occurs where the budget constraint is tangent to the highest attainable indifference curve, where \( \text{MRS} = P_1/P_2 \).
When a price changes, the consumer's response can be decomposed into two effects. The substitution effect is the change in quantity demanded that comes from the altered relative prices, holding utility constant; consumers substitute toward the good that has become relatively cheaper. The income effect is the change in quantity demanded that comes from the change in purchasing power, real income, induced by the price change. Together these effects determine the slope of the demand curve and explain unusual cases like Giffen goods. Underpinning all of consumer theory is the concept of opportunity cost, the value of the next best alternative forgone when a choice is made.