Microeconomics

Utility Function

Numbers attached to bundles, just enough to preserve a ranking

A utility function U(x) assigns a real number to each consumption bundle so that the consumer prefers a to b exactly when U(a) > U(b). The numbers themselves carry no meaning beyond the ranking. From this minimal scaffold, microeconomics builds demand curves, the Slutsky equation, expected utility under risk, and the entire welfare apparatus — though prospect theory has shown the standard form leaks badly when people face gains and losses.

  • Modern interpretationOrdinal (rankings only)
  • Existence theoremDebreu (1954)
  • Most common parametric formCobb-Douglas
  • Choice under riskExpected utility (vN-M, 1944)
  • Behavioral alternativeProspect theory (1979)

Interactive visualization

Press play, or step through manually. The visualization is yours to drive — try it before reading on.

Open visualization fullscreen ↗

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

What a utility function actually is

Suppose a consumer has preferences over consumption bundles — pairs of apples and bread, or any list of goods. A preference relation says, for any two bundles a and b, whether a is preferred to b, b to a, or they're indifferent. If those preferences are complete (any two bundles can be compared), transitive (a≥b and b≥c implies a≥c), and continuous, then there exists a utility function U such that a ≥ b if and only if U(a) ≥ U(b). This is Debreu's representation theorem.

The utility function is not unique. If U represents the preferences, then so does any strictly increasing transformation of U — V(x) = log U(x), V(x) = eU(x), V(x) = U(x)3+5, all represent the same preferences. The numbers carry only ordinal information.

Cobb-Douglas: a worked example

The most-used parametric form is Cobb-Douglas: U(x, y) = xα · y1-α, with 0 < α < 1. This form has remarkable algebraic properties.

Suppose α = 0.4, prices px = $2, py = $3, income I = $60. The consumer's optimization problem is:

max  x^0.4 · y^0.6
s.t. 2x + 3y = 60

Setting up the Lagrangian and taking first-order conditions gives the demand functions:

x* = α · I / p_x = 0.4 · 60 / 2 = 12
y* = (1-α) · I / p_y = 0.6 · 60 / 3 = 12

Maximized utility: U = 120.4 · 120.6 = 12. (For Cobb-Douglas, this works out neatly.) The total expenditure is 2·12 + 3·12 = $60. Spending on x: $24 (40% of income). Spending on y: $36 (60% of income). Cobb-Douglas's signature property: expenditure shares are constant at α and 1-α regardless of prices.

The marginal rate of substitution at the optimum is:

MRS = (∂U/∂x) / (∂U/∂y) = (α/x) · (y/(1-α)) = (α/(1-α)) · (y/x)

At the optimum, MRS = px/py = 2/3. With α=0.4 and y/x = 1, we get (0.4/0.6) · 1 = 2/3. Check.

Utility specifications, side-by-side

FormFunctional formExpenditure sharesGoods areIncome elasticitiesUse case
Cobb-Douglasxαy1-αConstant (α, 1-α)Substitutes (Hicks)Unit (= 1)Default workhorse
Perfect substitutesax + byCorner solutionsPerfect substitutesLumpyIdentical goods (brand A vs B)
Perfect complements (Leontief)min(ax, by)Fixed ratioPerfect complementsUnitLeft and right shoes
CES(αxρ + (1-α)yρ)1/ρVaries with pricesConstant elasticity of substitutionUnit (homothetic)Production and growth models
Quasi-linearv(x) + yx has zero income effectx special, y numeraire0 for x, all in yWelfare analysis (no income effect)
Stone-Geary(x-x̄)α(y-ȳ)1-αSubsistence-adjustedWith minima x̄, ȳVariableSubsistence-economy demand
CRRA (under risk)x1-γ/(1-γ)Asset pricing, growth theory

Cardinal vs ordinal — the long story

Early utility theorists (Bentham, Jevons, Edgeworth) treated utility as cardinal — a quantity, like temperature or weight, with meaningful magnitudes. Edgeworth's "hedonimeter" (1881) was meant to measure utility in standardized units. But cardinal utility was hard to defend; nothing in choice data lets you say "twice as preferred."

The 1930s ordinal revolution (Hicks, Allen, Samuelson) replaced cardinal utility with ordinal preferences. The shift mattered because it eliminated assumptions that couldn't be verified. From the 1930s onward, microeconomics has been ordinal: utility numbers are mere ranking devices.

One subtle exception: expected utility over lotteries (vN-M) is cardinal up to affine transformations. Linearity in probabilities pins down more than ranking — though even here the levels are not interpersonally comparable.

Expected utility under risk

When outcomes are uncertain, the consumer is choosing among lotteries. Von Neumann and Morgenstern (1944) showed that if preferences over lotteries satisfy four axioms — completeness, transitivity, continuity, and independence — they can be represented as the expected value of a utility function:

EU(L) = Σ p_i · u(x_i)

Here u(·) is the von Neumann-Morgenstern utility function, distinct from the deterministic utility function above. Concavity of u captures risk aversion: u'' < 0 means the marginal utility of wealth is diminishing, so a fair gamble is rejected. The Arrow-Pratt coefficient of absolute risk aversion is r(x) = -u''(x)/u'(x).

Prospect theory — the behavioral challenge

Kahneman and Tversky (1979) showed expected utility fails systematically in lab data. Their replacement, prospect theory, has three departures:

  1. Reference dependence. Outcomes are coded as gains and losses relative to a reference point, not absolute wealth.
  2. Loss aversion. Losses hurt about 2× more than equivalent gains feel good. The value function is steeper for losses than gains.
  3. Probability weighting. Small probabilities are overweighted (lottery tickets), moderate-to-large probabilities are underweighted. The decision weight π(p) is concave for low p and convex for high p.

Prospect theory explains the Allais paradox (where independence axiom fails empirically), the equity premium puzzle, the disposition effect in investing, and many other anomalies. It earned Kahneman the 2002 Nobel Prize in economics.

Limits and critiques

Utility is hard to interpret. Sen (1977) argued that economic models conflate three distinct things — well-being, choice, and preference — under one utility-function umbrella. People sometimes choose against their well-being out of commitment, and choice does not reveal welfare directly.

Interpersonal comparisons. Ordinal utility cannot be compared across people. Modern welfare economics either uses willingness to pay (with the income-distribution caveats Kaldor and Hicks introduced) or uses outside ethical criteria — utility is not enough.

Bounded rationality. Real consumers don't compute optima of complex utility functions. Simon's satisficing models, Gigerenzer's heuristics, and modern behavioral economics all argue the formal apparatus over-idealizes the agent.

Adaptation and the hedonic treadmill. Subjective well-being adapts to changes — a major win or loss has temporary effects. Utility functions that ignore adaptation overstate the welfare implications of permanent changes.

Variants beyond the basics

  • Random utility. Adds idiosyncratic shocks U(x) + ε; underpins logit and probit choice models.
  • Discounted utility. For intertemporal choice, U = Σ βtu(ct). Hyperbolic-discounting variants account for present bias.
  • Multi-attribute utility. Disaggregates U into components (health, income, leisure) — useful in policy analysis.
  • Rank-dependent expected utility. Bridges expected utility and prospect theory by allowing probability weighting without reference dependence.
  • Mean-variance utility. U = E[X] - λ·Var[X]. Standard in finance; tractable but inconsistent with expected utility except for normal returns and quadratic u.

Common pitfalls

  • Reading levels as meaningful. "U(a) = 10 and U(b) = 5, so a is twice as good" — wrong under ordinal interpretation. Only the ranking matters.
  • Confusing deterministic utility with vN-M utility. The same notation U(·) is used for both, but the cardinal status is different. Risk premiums depend on the curvature of vN-M, not on deterministic preferences.
  • Adding utilities across people. Interpersonal sums require an ethical assumption (utilitarianism), not anything from utility theory itself.
  • Assuming all preferences admit a utility function. Lexicographic preferences (always pick a over b unless tied on first attribute, etc.) violate continuity and have no utility representation.
  • Confusing utility with happiness. Utility is a representation of choice; subjective well-being is a measured psychological state. They overlap but are not identical.

Frequently asked questions

What is a utility function?

A utility function U(x) assigns a real number to each consumption bundle x such that the consumer prefers bundle a to bundle b if and only if U(a) > U(b). It's a mathematical convenience for representing preferences. Under modest assumptions (completeness, transitivity, continuity), preferences can always be represented by some utility function.

What's the difference between cardinal and ordinal utility?

Cardinal utility treats utility numbers as meaningful — saying U=10 is twice as good as U=5. Ordinal utility treats only the rankings as meaningful — U=10 just means "preferred to U=5," nothing more. Modern microeconomics is ordinal: any monotone transformation of a utility function represents the same preferences.

What's the Cobb-Douglas form?

U(x, y) = xα · y1-α for some 0 < α < 1. Cobb-Douglas preferences are homothetic and have constant expenditure shares — the consumer always spends fraction α of income on x and 1-α on y, regardless of prices. It's the most-used parametric utility form in applied work because of its tractability.

What's expected utility?

When choices involve risk, von Neumann and Morgenstern (1944) showed that under axioms including independence, preferences over lotteries can be represented as the expected value of a utility function: EU(L) = Σ pi · u(xi). Expected utility is the dominant model of choice under uncertainty in economics and finance.

How does prospect theory differ?

Kahneman and Tversky's prospect theory (1979) replaces expected utility with a value function defined over gains and losses relative to a reference point, exhibiting loss aversion (losses hurt more than equivalent gains feel good) and probability weighting (small probabilities are overweighted). It explains the Allais paradox, the equity premium puzzle, and many other empirical anomalies.

Can utility be measured?

Ordinal utility is identified by choice data (revealed preference). Cardinal utility — beyond rankings — generally cannot be inferred from choice. Some experimental work measures "experienced utility" via subjective well-being or neural activity, but in standard economic analysis utility is treated as ordinal and not directly measurable.