Consumer Theory
Shephard's Lemma
Differentiate the expenditure function in any price — and out pops the Hicksian demand for that good
h_i(p, u) = ∂e(p, u)/∂p_i. Once you have the expenditure function, every compensated demand drops out by a single derivative — no optimization required.
- Formulah_i = ∂e/∂p_i
- What it recoversHicksian demand
- From whatExpenditure function
- Proof techniqueEnvelope theorem
- Producer versionHotelling's lemma
- DiscoveredShephard 1953
Interactive visualization
Press play, or step through manually. The visualization is yours to drive — try it before reading on.
Watch the 60-second explainer
A condensed visual walkthrough — narrated, captioned, under a minute.
How Shephard's lemma works
Picture an economist with the expenditure function in hand — a formula e(p, u) that tells you the minimum cost of reaching utility u at price vector p. The expenditure function encodes the entire compensated-demand structure of the consumer; it's the value function for the cost-minimization problem. Shephard's lemma is the rule for unpacking that information one good at a time:
h_i(p, u) = ∂e(p, u) / ∂p_i
Differentiate e in the i-th price and you get the i-th Hicksian demand. No Lagrangian, no FOCs, no constrained optimization. The expenditure function already solved that problem; Shephard's lemma reads the answer back out via differentiation. Shephard: ∂e/∂p_i = h_i directly — derivative replaces minimization.
Geometrically the lemma says something almost magical: at any point on the expenditure-vs-price curve, the slope equals the consumed quantity of that good. Plot e against p_1 holding p_2 and u fixed; the slope at every price is the compensated demand h_1 at that price. Slopes are demands.
Formal statement and proof
Let e(p, u) = min_x p · x subject to u(x) ≥ u. The Hicksian demand is the minimizer h(p, u) = argmin. Shephard's lemma:
∂e(p, u)/∂p_i = h_i(p, u)
Proof via the envelope theorem. By definition:
e(p, u) = p · h(p, u) = Σ_j p_j · h_j(p, u)
Differentiate with respect to p_i, applying the chain rule:
∂e/∂p_i = h_i + Σ_j p_j · ∂h_j/∂p_i
The first term is the direct effect of the price change at fixed quantities; the sum is the indirect effect through quantity adjustments. The miracle is that the sum equals zero at the optimum. Why? Because h(p, u) satisfies the FOCs of the constrained minimization: at the optimum, ∂u/∂x_j = λ · p_j for some Lagrange multiplier λ. Differentiating the constraint u(h(p, u)) = u with respect to p_i:
0 = Σ_j (∂u/∂x_j) · ∂h_j/∂p_i = λ · Σ_j p_j · ∂h_j/∂p_i
For λ ≠ 0 (positive marginal utility of income), the sum vanishes. So ∂e/∂p_i = h_i. The envelope theorem in one line.
Intuition: why the substitution term vanishes
The non-obvious step is why the consumer's reoptimization doesn't add anything to the first-order effect on e. Here's the geometric story.
The expenditure function e(p, u) is the lower envelope of all hyperplanes of the form p · x for x on the indifference surface u(x) = u. Each x defines a hyperplane in price space whose value at price vector p is p · x; e(p, u) is the lowest such value as you vary x. Now, if you sit at a particular price p^0 with optimal bundle x^0 = h(p^0, u), the hyperplane of that bundle, p · x^0, agrees with e(p, u) at p = p^0 and lies above it everywhere else. So the two functions are tangent at p^0 — their derivatives match. The derivative of the hyperplane p · x^0 in p_i is just x^0_i = h_i. Hence ∂e/∂p_i = h_i.
This geometric view also reveals why the expenditure function is concave in prices (linearity of the hyperplane plus the min operator), and why the Slutsky matrix is negative semi-definite: e is the lower envelope of linear functions, so it inherits concavity.
Worked example: Cobb-Douglas expenditure
For U(x, y) = x^α · y^(1−α), the expenditure function (derived by minimizing p_x · x + p_y · y subject to the utility constraint) is:
e(p, u) = u · (p_x / α)^α · (p_y / (1 − α))^(1 − α)
Apply Shephard's lemma to find the Hicksian demand for x:
h_x = ∂e/∂p_x
= u · α · p_x^(α−1) / α^α · (p_y / (1 − α))^(1 − α)
= u · (p_x/α)^(α−1) · (p_y / (1 − α))^(1 − α)
= u · (α · p_y / ((1 − α) · p_x))^(1 − α)
For α = 0.5, this simplifies to h_x = u · (p_y / p_x)^0.5 — exactly what direct optimization would have given. And for the income-symmetric piece, h_y = ∂e/∂p_y = u · (p_x / p_y)^0.5. Same derivative trick, no need to redo the Lagrangian.
Verify by plugging into the original definition: h_x · p_x + h_y · p_y should equal e(p, u). For α = 0.5: u·(p_y/p_x)^0.5 · p_x + u·(p_x/p_y)^0.5 · p_y = u·(p_x p_y)^0.5 + u·(p_x p_y)^0.5 = 2u·(p_x p_y)^0.5 = e(p, u). Check.
Shephard, Roy, Slutsky — side by side
| Identity | Recovers | From | Formula | Proof tool |
|---|---|---|---|---|
| Shephard's lemma | Hicksian demand h_i | Expenditure function e(p, u) | h_i = ∂e/∂p_i | Envelope theorem |
| Roy's identity | Marshallian demand x_i | Indirect utility v(p, m) | x_i = −(∂v/∂p_i)/(∂v/∂m) | Envelope theorem + Walras |
| Slutsky equation | Decomposition of ∂x_i/∂p_j | Both demands | ∂x/∂p = ∂h/∂p − x·∂x/∂m | Chain rule on h = x(p, e(p,u)) |
| Hotelling's lemma | Supply y_i | Profit function π(p) | y_i = ∂π/∂p_i | Envelope theorem |
| Shephard (producer) | Conditional factor demand x_i | Cost function C(w, y) | x_i = ∂C/∂w_i | Envelope theorem (original 1953) |
| McFadden's lemma | Net supply | Restricted-profit function | z_i = ∂π^R/∂p_i | Envelope theorem |
All six identities follow from the same envelope-theorem template: the value function of a constrained-optimization problem inherits the derivatives of the Lagrangian at the optimum, with all substitution-margin adjustments killed by the FOCs. Once you've seen the pattern in one, you've seen it in all.
Practical uses
- Empirical demand estimation. Postulate a flexible functional form for e(p, u) (Translog, Almost Ideal, CES) and differentiate to get the Hicksian demand equations. Estimate via Generalized Method of Moments on observed prices and budget shares. The Almost Ideal Demand System (Deaton-Muellbauer 1980) is the industry standard built directly from Shephard's lemma.
- Welfare measures. Compensating variation CV = e(p^1, u^0) − e(p^0, u^0) and equivalent variation EV use the expenditure function directly. Shephard's lemma gives the integral form: CV = ∫ h(p, u^0) dp along the price path. Closed-form welfare numbers from observed price changes.
- Cost-of-living indices. The Konüs (true) cost-of-living index is e(p^1, u)/e(p^0, u) — a ratio of expenditure functions. Differentiating in prices gives the Hicksian quantity weights that approximate a chained-CPI index, fixing the substitution bias of a Laspeyres index.
- Optimal taxation. Ramsey's inverse-elasticity rule and Mirrlees-Saez optimal-income tax rely on compensated elasticities, recovered from estimated expenditure functions via Shephard's lemma. The compensated channel isolates the distortion margin from the income margin.
- Trade gravity equations. Armington-style CES expenditure functions for varieties from different countries get their bilateral trade demand equations directly from Shephard's lemma — modern quantitative trade theory (Eaton-Kortum, Anderson-van Wincoop) is built on this scaffolding.
- Producer-side cost minimization. The original Shephard (1953) result. Estimate a cost function from input prices and output, then differentiate to get the conditional factor demands. Used in productivity studies, input-substitution analysis, and CGE modeling.
Where Shephard's lemma breaks (and what to do)
| Failure mode | Where it occurs | Fix |
|---|---|---|
| e(p, u) non-differentiable in p | Perfect complements (Leontief preferences); kinked indifference curves | Replace derivative by subdifferential; h becomes set-valued |
| Multiple optimal bundles | Linear utility (perfect substitutes) at the price ratio | Hicksian demand is a correspondence; pick any element |
| Corner solutions | One good's price very high relative to MU | Lemma still holds — h_i = 0 means slope of e in p_i is 0 |
| Non-smooth e(p, u) | Discrete choice; price-induced regime switches | Use directional derivatives or stochastic-choice generalizations |
| Discontinuous demand | Indivisibilities (cars, houses) | Local Shephard + interval inference; full discrete-choice machinery |
Related theorems and identities
- Envelope theorem. The general result that the derivative of a constrained value function with respect to a parameter equals the partial derivative of the Lagrangian at the optimum. Shephard's lemma is its consumer-side specialization.
- Roy's identity. The indirect-utility counterpart. Together with Shephard, the two halves of consumer duality.
- Slutsky equation. Derived from Shephard plus the duality identity h(p, u) = x(p, e(p, u)). The bridge between Hicksian and Marshallian demand.
- Hotelling's lemma. Profit-function version: y_i = ∂π/∂p_i. Same envelope-theorem proof.
- McFadden's lemma. Restricted-profit function with some inputs fixed. Generalizes Hotelling to short-run analysis.
- Adding up. Σ_i p_i · h_i = e(p, u) — the budget identity for Hicksian demand. Differentiate and use Shephard to get cross-Slutsky constraints used to check empirical demand systems.
Common pitfalls
- Applying Shephard's lemma to non-differentiable expenditure functions. At kinks (Leontief preferences, perfect complements) the derivative doesn't exist as a function. The lemma generalizes via the subdifferential but requires careful handling.
- Confusing the expenditure function with the cost-minimization Lagrangian. e(p, u) is the value function — the minimum value. The Lagrangian is the auxiliary object used in the optimization. Shephard differentiates the value function, not the Lagrangian.
- Forgetting that h depends on u not m. Shephard returns Hicksian demand indexed by utility level u, not Marshallian demand indexed by income m. The two are equal at the optimum (h(p, v(p, m)) = x(p, m)) but differ off-optimum.
- Misapplying the producer version. Shephard's original 1953 result is about firms: x_i = ∂C/∂w_i where C is the cost function and w_i is input price. Hotelling's lemma uses the profit function and output prices. The two are easily confused.
- Treating Shephard as evidence of cardinality. The expenditure function is ordinal — it depends on the ranking of bundles, not cardinal utility levels. Shephard's lemma holds for any monotonic transformation of u; only the specific u-level indexing changes.
- Reading h_i = ∂e/∂p_i as a definitional identity. It's a theorem requiring the envelope-theorem hypotheses (continuous differentiability of e, interior optimum, regularity conditions on preferences). At boundary points (corner solutions, kinks) the theorem still holds in modified form but the simple gradient identity needs care.
Frequently asked questions
What is Shephard's lemma?
Shephard's lemma states that the Hicksian (compensated) demand for good i equals the partial derivative of the expenditure function with respect to that good's price: h_i(p, u) = ∂e(p, u)/∂p_i. In words, once you have the cheapest-cost-of-utility function, differentiating it in any price returns the optimal quantity of that good — no separate minimization needed. The lemma was originally formulated by Ronald Shephard in 1953 for the dual problem on the production side (cost functions, conditional factor demands), and the same identity governs consumer expenditure functions.
Why does Shephard's lemma work?
It's a one-line consequence of the envelope theorem. The expenditure function is e(p, u) = p · h(p, u), the price-weighted optimal bundle. Differentiate with respect to p_i: ∂e/∂p_i = h_i + Σ_j p_j · ∂h_j/∂p_i. The second sum vanishes at the optimum because of the first-order conditions of the constrained minimization (the bundle shifts to keep utility fixed, and the price-weighted shift is zero at the tangency). So ∂e/∂p_i = h_i — the entire derivative of the value function is just the optimal-quantity term.
How is Shephard's lemma proved?
Two ways. First, the envelope-theorem proof: differentiate e(p, u) = p · h(p, u) using the chain rule and use the FOCs of the minimization to kill the substitution term, leaving h_i. Second, the geometric proof: at any tangent point on the expenditure-vs-price plot, the slope of e in p_i equals the consumed quantity h_i — because a unit increase in p_i raises expenditure by exactly h_i units of cost (price × quantity) at the optimum, while any quantity adjustment is second-order.
How does Shephard's lemma differ from Roy's identity?
Shephard recovers Hicksian (compensated) demand from the expenditure function: h_i = ∂e/∂p_i. Roy recovers Marshallian (uncompensated) demand from the indirect utility function: x_i = −(∂v/∂p_i)/(∂v/∂m). They're dual results: Shephard works on the expenditure-side value function, Roy on the utility-side value function. Together they form the two halves of consumer duality theory — you can start from either value function and recover both demands via the lemmas plus the Slutsky equation.
What is the producer-side version of Shephard's lemma?
On the producer side, the analogous result is that the conditional factor demand for input i equals the derivative of the cost function with respect to input i's price: x_i(w, y) = ∂C(w, y)/∂w_i, where C is the cost function and w_i is the price of input i. This was the original Shephard 1953 result. Hotelling's lemma is the same idea applied to the profit function: y_i(p) = ∂π(p)/∂p_i — derivative of profit in output price returns optimal output.
Where does Shephard's lemma fail?
Shephard's lemma assumes the expenditure function is differentiable in prices, which requires the cost-minimizing bundle to be unique. At kinks in preferences (perfect complements, Leontief production functions), the optimal bundle is set-valued and e(p, u) has corners — the derivative is replaced by a subdifferential, and h_i becomes a set-valued correspondence. The lemma still works in this generalized form but the simple closed-form derivative interpretation breaks down. Differentiability holds "almost everywhere" under standard preferences and is the workhorse case in empirical work.
How is Shephard's lemma used in practice?
Empirically: if you postulate a parametric form for the expenditure function (Cobb-Douglas, CES, Translog, Almost Ideal), differentiating in prices gives ready-to-estimate Hicksian demand equations. The same trick works on the production side with cost functions and conditional factor demands. Theoretically: Shephard's lemma is the bridge that converts the Slutsky equation into a Hicksian-demand-only statement, and the channel through which welfare measures (CV, EV) are written as expenditure-function differences.