*Warning: Boring technical stuff that’s only here because I needed it for the model in the Helicopter Money paper, and there are no other good references online.*

All the existing resources on the internet that I’ve found are either vague or inconsistent with their *σ*/*ρ* notation (where \(ρ=\frac{σ-1}{σ}\) and *σ* is the elasticity of substitution, which makes the exponents in the utility function look cleaner, though the exponents in the demand function will be correspondingly messier), or don’t derive it with the coefficients. Almost *none* go step by step (with the exception of this video) or carry through the coefficients with exponents, and *literally* none derive a function for more than two goods.

We’re going to do all of these: a fully general derivation of demand functions from an *n*-good CES utility function, carrying through the actual elasticity of substitution as a parameter. I’ll use sum notation throughout, which you can easily expand to a definite number of goods. It’s worth noting though that the elasticity of substitution has to be the same between all pairs of goods, otherwise there’s no fully general form.

We start by writing our CES function this way, raising our coefficient to the 1/*σ* and summing over a set of *n* goods. You might wonder why we’re raising our coefficient to an exponent too. It’ll make our demand function slightly cleaner in the end, and since it’s a parameter, you can just define *α _{n}*

(1) $$U=\left(\sum_n β_n^{1/σ}G_n^\frac{σ-1}{σ} \right)^\frac{σ}{σ-1} $$

A function of this form means that the elasticity of substitution between any pair of goods is *σ*. Our budget constraint, then, is

(2) $$I=\sum_nP_nG_n$$

So we want to maximize (1) subject to (2). So we set up our lagrangian, and derive with respect to each good plus λ, which gives us *n*+1 first-order conditions.

(3) $$\mathcal{L} = \left(\sum_n β_n^{1/σ}G_n^\frac{σ-1}{σ} \right)^\frac{σ}{σ-1} + λ\left(I-\sum_nP_nG_n\right)$$

Since both parts of the Lagrangian are sums, and the parameters of the various goods are all siloed into their own terms, this is actually fairly straightforward to derive with respect to any *G* variable. So we’ll pick any two goods, say *a* and *b*, and derive with respect to *G _{a}* and

To get the derivative of the first part of the Lagrangian, remember the chain rule for deriving *f*(*g*(*x*)): \(\frac{∂ f}{∂ x} = \frac{∂ f}{∂ g}\frac{∂ g}{∂ x}\). Our *f*(*g*) will be \(g^\frac{σ}{σ-1}\), and our *g*(*x*) will be the sum on the inside of the parentheses. This gives us:

(4) $$\frac{∂\mathcal{L}}{∂G_a} = \left(\frac{β_a}{G_a}\right)^\frac{1}{σ} \frac{σ}{σ-1}\left(\sum_n β_n^{1/σ}G_n^\frac{σ-1}{σ}\right)^\frac{1}{1-σ} – \lambda P_a = 0$$

(5) $$\frac{∂\mathcal{L}}{∂ G_b} = \left(\frac{β_b}{G_b}\right)^\frac{1}{σ} \frac{σ}{σ-1}\left(\sum_n β_n^{1/σ}G_n^\frac{σ-1}{σ}\right)^\frac{1}{1-σ} – \lambda P_b = 0$$

(6) $$\frac{∂\mathcal{L}}{∂ \lambda} = I-\sum_nP_nG_n = 0$$

We have *β _{a}*/

From here, we want the relative price of *P _{a}* to

(7) $$\frac{P_a}{P_b} = \frac{(β_a/G_a)^\frac{1}{σ}}{(β_b/G_b)^\frac{1}{σ}} = \left(\frac{β_a G_b}{β_b G_a}\right)^\frac{1}{σ}$$

The right hand side is the marginal rate of substitution between *G _{a}* and

Solving for *G _{b}*, we have

(8) $$G_b = \frac{β_bG_a}{β_a}\left(\frac{P_a}{P_b}\right)^σ$$

And similarly for *G _{c}*, etc. What we’re aiming to do here is to replace all the

So, substituting (8) and its brothers back into the budget constraint (2) gives us

(9) $$I=P_aG_a + \sum_{n\neq a}P_n\frac{β_nG_a}{β_a}\left(\frac{P_a}{P_n}\right)^σ$$

$$= G_a \sum_{n}\frac{β_n}{β_a}P_a^σ P_n^{1-σ}$$

We’ve substituted every *G* term of the sum, except the original *G _{a}* term, with an expression in terms of

All that remains is to solve for *G _{a}*.

(10) $$ G_a = \frac{I}{\sum_{n}\frac{β_n}{β_a}P_a^σ P_n^{1-σ}} $$

$$= \frac{I P_a^{-σ}}{\sum_{n}\frac{β_n}{β_a}P_n^{1-σ}}$$

So there’s our demand function for *G _{a}*, and

**2019**Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec**2018**Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec**2017**Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec**2016**Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec**2015**Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec**2014**Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec**2013**Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec**2012**Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec### All Posts » | RSS »

## mg

Feb 13, 2019 at 19:47 |Thanks this was very helpful to me! But I think you left out a lambda in equations 4 and 5? It would cancel out anyway in the next step so it wouldn’t change the results at all.

## Cameron Harwick

Feb 13, 2019 at 21:52Good catch, thanks – (4) and (5) are updated now.