Consider a Cobb–Douglas utility function having the form $$u(x) = \prod_{j=1}^n x_j^{a_j} $$ where $x$ is an allocation vector and $a_j$ are utility parameters with $\sum a_j = 1$. My question has to do with the demand of a buyer with a Cobb–Douglas utility function and fixed prices budget. That is, $$\arg \max_x \lbrace u(x) : \pi^T x \leq w \rbrace$$ where $\pi$ is a fixed price vector and $w$ is the budget.
This is easy to solve, but I am confused by the following claim, which I read in an optimization textbook [1]:
It is not difficult to show that a trader with a Cobb–Douglas utility function spends a fixed fraction of her income on each good.
This is clearly true when $a_j = 1/n, \forall j$ and the prices are the same.
But suppose $n = 2$, $\pi = (1, 1)$, $w = 1$, and $a = 0.8, 0.2$. Then "spending a fixed fraction of the budget on each good" would mean spending $w / n = 0.5$ on each good, or buying $0.5$ units of each good, implying $x^* = (0.5, 0.5)$. This is clearly suboptimal, as the following table of values shows:
x_1 x_2 u(x)
0.0 1.0 0.0
0.1 0.9 0.155185
0.2 0.8 0.263902
0.3 0.7 0.355399
0.4 0.6 0.433789
0.5 0.5 0.5
0.6 0.4 0.553265
0.7 0.3 0.590885
0.8 0.2 0.606287 (*)
0.9 0.1 0.579955
1.0 0.0 0.0
Instead, the maximum is at $x = (0.8, 0.2)$, which I would describe verbally as
A trader with a Cobb–Douglas utility function allocates each good in proportion to its utility per unit cost.
In this example, resource 1 yields $a_1 / \pi_1 = 0.8$ utils per dollar, resource 2 yields $0.2$ utils per dollar, and the optimal allocation is a scalar times $(0.8, 0.2)$.
Is my interpretation correct? Is the textbook's interpretation quoted above correct? If both are correct, what explains the discrepancy in the example above?
Please note that I am not asking how to compute the demand of a trader with a Cobb–Douglas utility function. I am asking about the specific claim that the trader spends a "fixed fraction of her income" on each product.
[1] Nisan, Noam, Tim Roughgarden, Éva Tardos, and Vijay V. Vazirani, eds. 2007. Algorithmic Game Theory. Cambridge University Press.