Example
Alice has $12 to buy chocolate (X) and strawberries (Y). Her utility is measured by `u \left( X, Y \right) = X Y^2`.
Depending on the prices `p_X` and `p_Y`, what is Alice's demand for chocolate?
Step 1: Equalize MRS and MRT
$$ \begin{align*} MRS &= MRT \\ - \frac{Y}{2X} &= - \frac{p_X}{p_Y} \\ Y &= 2X \frac{p_X}{p_Y} \end{align*} $$Step 2: Plug in the budget constraint
$$ \begin{align*} X p_X + Y p_Y = 12 \\ X p_X + 2X \frac{p_X}{p_Y} p_Y = 12 \\ 3 X p_X = 12 \\ X = \frac{4}{p_X} \\ \end{align*} $$Alice's demand for chocolate is `X = \frac{4}{p_X}`.
Question
Now Alice can spend up to $240 on chocolate (X) and strawberries (Y). Her utility is `u \left( X, Y \right) = 10 X^{30} Y^{30}`.
What is her demand for X?
Alice's demand for chocolate (X) is `X = \frac{120}{p_X}`.
Step 1: Equalize MRS and MRT
$$
\begin{align*}
MRS &= MRT \\
- \frac{MU_X}{MU_Y} &= -\frac{p_X}{p_Y} \\
- \frac{10 \times 30 X^{29} Y^{30}}{10 \times 30 X^{30} Y^{29}} &= - \frac{p_X}{p_Y} \\
\frac{Y}{X} &= \frac{30}{30} \frac{p_X}{p_Y} \\
Y &= 1 \frac{p_X}{p_Y} X
\end{align*}
$$
Step 2: Plug into the budget
$$
\begin{align*}
X p_X + Y p_Y &= 240 \\
X p_X + 1 \frac{p_X}{p_Y} X p_Y &= 240 \\
X p_X + 1 X p_X &= 240 \\
\left( 1 + 1 \right) X p_X &= 240 \\
2 X &= 240 \\
X &= \frac{240}{2 p_X} \\
X &= \frac{120}{p_X}
\end{align*}
$$