Cobb-Douglas utility, $U = x^a y^b$ from Substitutes, Complements, Cobb-Douglas and Quasilinear, is the workhorse of applied economics, because its The Best Affordable Bundle has a short closed form you can remember and check.
Key idea
With $U = x^a y^b$ (or $a\ln x + b\ln y$), income $m$ and prices $p_1, p_2$: $$x^* = \frac{a}{a + b}\cdot\frac{m}{p_1}, \qquad y^* = \frac{b}{a + b}\cdot\frac{m}{p_2}.$$ The consumer spends the fixed share $a/(a + b)$ of income on $x$ and $b/(a + b)$ on $y$, whatever the prices.
Why it works
Tangency: $MRS = \dfrac{ay}{bx} = \dfrac{p_1}{p_2}$, so spending on $y$ is $p_2y = \dfrac{b}{a}p_1x$. Put that into the budget: $p_1x + \dfrac{b}{a}p_1x = m$, so $p_1x\cdot\dfrac{a + b}{a} = m$ and $$p_1x^* = \frac{a}{a + b}m.$$ Spending on $x$ is a fixed fraction of income. That is why $x^*$ moves in proportion to income, falls in proportion as $p_1$ rises (own-price elasticity $-1$), and does not depend on $p_2$ at all.
Worked example: Using the share rule
$U = xy^2$, $m = 90$, $p_1 = 3$, $p_2 = 2$. Find $x^*$ and $y^*$.
- $a = 1$, $b = 2$: the share for $x$ is $1/3$ and for $y$ is $2/3$.
- Spending on $x$: $90/3 = 30$, so $x^* = 30/3 = 10$.
- Spending on $y$: $60$, so $y^* = 60/2 = 30$.
- Check with the tangency: $MRS = \dfrac{y}{2x} = \dfrac{30}{20} = \dfrac{3}{2} = \dfrac{p_1}{p_2}$.
Answer: $(10, 30)$.
Worked example: The other price changes
Same consumer, but the price of $y$ doubles to 4. What happens to $x^*$?
- $x^* = \dfrac{1}{3}\cdot\dfrac{90}{3} = 10$: $p_2$ is not in the formula.
- $y^* = \dfrac{2}{3}\cdot\dfrac{90}{4} = 15$: she halves her $y$ and keeps spending \$60 on it.
Answer: $x^*$ stays at 10.
Worked example: Reading the exponents from spending data
Year after year, Hiro spends 25% of his income on rent and the rest on everything else, even as rents and his income change. If his utility is $U = x^a y^b$ with $a + b = 1$ ($x$ = housing), what is $a$?
- Cobb-Douglas says the share of income spent on $x$ is $\dfrac{a}{a + b}$.
- With $a + b = 1$ that share is $a$ itself, so $a = 0.25$ and $b = 0.75$.
- A constant budget share in the data is the fingerprint of Cobb-Douglas preferences.
Answer: $a = 0.25$.
Common mistake
Expecting the quantity of $x$ to depend on the price of $y$. With Cobb-Douglas utility it does not: a higher $p_2$ makes $x$ relatively cheaper (pushing $x$ up) but also makes the consumer poorer (pushing $x$ down), and for this utility the two effects cancel exactly. Check: compute spending $p_1x^*$. If it is the same share of income before and after, you have it right.
Real budget shares are not exactly constant (food takes a smaller share of income as people get richer), so Cobb-Douglas is a benchmark, not a law. It is popular because it is easy to solve and often fits well enough for a first estimate.