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 $1080 on chocolate (X) and strawberries (Y). Her utility is `u \left( X, Y \right) = 3 X^{27} Y^{243}`.
What is her demand for X?
Alice's demand for chocolate (X) is `X = \frac{108}{p_X}`.
Step 1: Equalize MRS and MRT
$$
\begin{align*}
MRS &= MRT \\
- \frac{MU_X}{MU_Y} &= -\frac{p_X}{p_Y} \\
- \frac{3 \times 27 X^{26} Y^{243}}{3 \times 243 X^{27} Y^{242}} &= - \frac{p_X}{p_Y} \\
\frac{Y}{X} &= \frac{243}{27} \frac{p_X}{p_Y} \\
Y &= 9 \frac{p_X}{p_Y} X
\end{align*}
$$
Step 2: Plug into the budget
$$
\begin{align*}
X p_X + Y p_Y &= 1080 \\
X p_X + 9 \frac{p_X}{p_Y} X p_Y &= 1080 \\
X p_X + 9 X p_X &= 1080 \\
\left( 1 + 9 \right) X p_X &= 1080 \\
10 X &= 1080 \\
X &= \frac{1080}{10 p_X} \\
X &= \frac{108}{p_X}
\end{align*}
$$