# Demand aggregation with CES

I am reading the following paper by Angeletos and Lian and got stuck on equation (3). The problem is the standard optimal consumption bundle choice. Namely, aggregate consumption of "farmer" $$i$$ is

$$c_i = \left(\int c_{ij}^{1-\eta} \mathrm{d}j\right)^{\frac{1}{1 - \eta}},$$

and the budget constraint of the farmer is $$\int p_j c_{ij}\mathrm{d}j = p_i q_i$$, where $$q_i$$ is production of farmer $$i$$. Maximization of $$c_i$$ subject to a fixed aggregate expenditure yields the standard result

$$\int p_j c_{ij}\mathrm{d}j = Pc_i$$ and

$$\frac{c_{ij}}{c_i} = \left(\frac{p_j}{P}\right)^{-\frac{1}{\eta}}$$ for all $$j$$, where $$P = (\int p_j^{1 - 1/\eta}\mathrm{d}j)^{1/(1- 1/\eta)}$$ is the ideal price index. Now the authors impose the market clearing condition $$\int c_{ji} \mathrm{d}j = q_i$$ for all $$i$$ and conclude from this that

$$p_i = P\left(\frac{q_i}{Q}\right)^{-\eta}$$ for all $$i$$, where $$Q = (\int q_j^{1 - \eta} \mathrm{d}j)^{1/(1-\eta)}$$ is supposed to be aggregate output. I cannot derive this result under the above assumptions.

What I tried was starting from

$$c_{ji} = \left(\frac{p_i}{P}\right)^{-\frac{1}{\eta}}c_j$$

(note this is just the optimal demand with switched indices). Integrating over $$j$$, and solving for $$p_i$$, I get

$$p_i = P\left(\frac{q_i}{\int c_j \mathrm{d}j}\right)^{-\eta}.$$ This is almost what I want, but I would need that $$Q = \int c_j \mathrm{d}j$$, which although maybe intuitive, does not seem to hold (compare by plugging in the definitions of $$c_j$$ and $$q_j$$). What am I missing? Thanks in advance!

Let us show that: $$\int c_j {\rm d}j = \left(\int q_j^{1 - \eta} {\rm d}j \right)^{\frac{1}{1 - \eta}}.$$ This is true if: \begin{align*} &\left(\int c_j {\rm d}j\right)^{1 - \eta} = \int q_j^{1 - \eta} {\rm d}j,\\ \iff &\left(\int c_j {\rm d}j \right)^{1 - \eta} = \int\left[\left(\int c_{ij} {\rm d}i \right)^{1 - \eta} \right] {\rm d}j,\\ \iff & \left(\int c_j {\rm d}j\right)^{1 - \eta} = \int\left[\int c_i \left(\frac{p_j}{P}\right)^{-1/\eta} {\rm d}i\right]^{1 - \eta} {\rm d}j,\\ \iff & \left(\int c_j {\rm d}_j\right)^{1 - \eta} = \left(\int \left(\frac{p_j}{P}\right)^{-\frac{1 - \eta}{\eta}} {\rm d}j \right) \left(\int c_i {\rm d}i\right)^{1 - \eta},\\ \iff &\left(\int c_j {\rm d}_j\right)^{1 - \eta} =\underbrace{\frac{\int p_j^{1 - \frac{1}{\eta}} {\rm d}j}{P^{1 - \frac{1}{\eta}}}}_{=1} \left(\int c_i {\rm d}_i\right)^{1 - \eta},\\ \iff & \left(\int c_j {\rm d}j\right)^{1 - \eta} = \left(\int c_i {\rm d}_i\right)^{1 - \eta}. \end{align*}