# Deriving demand function from utility function

How do I derive the demand function from

$$U=y + 2\sqrt{x}$$

Currently I have $$MRS = \frac{1}{\sqrt{x}} = \frac{P_x}{P_y}$$, so, $$P_y = P_x\sqrt{x}$$

Using the budget line: $$I = xP_x + yP_y \implies I = xP_x +y(P_x\sqrt{x})$$

Which simplifies to $$x = \frac{2I + y^2 P_x \pm y\sqrt{Px(4I+y^2P_x)}}{2P_x}$$

I'm not sure if this is correct, should I have did $$MRS = \frac{1}{\sqrt {x}} = \frac{P_x}{P_y}$$, so, $$P_x = \frac{P_y}{\sqrt{x}}$$ instead and substitute $$\frac{P_y}{\sqrt{x}}$$ into budget line? How do I determine what to substitute into the budget line?

– dlnB
Mar 25, 2019 at 17:16
• – Amit
Oct 2, 2022 at 10:12

This is an example of quasilinear utility. In general, a quasilinear utility function takes the form $$u(x,y)=f(x)+y.$$ The perfect substitutes utility function, for example, is a special case of the quasilinear utility function. One feature of quasilinear utility is that the MRS is independent of at least one of the two goods: $$\frac{\frac{\partial u(x,y)}{\partial x}}{\frac{\partial u(x,y)}{\partial y}}=f'(x),$$ meaning the slope of indifference curves is independent of the quantity of good $$y$$.
The Marshallian demand functions satisfy the equations: $$f'(x)=\frac{P_x}{P_y}$$ $$I=P_xx+P_yy,$$
which come from the first-order conditions of the constrained maximization problem. We can solve for the Marshallian demand function for $$x$$ directly from the first equation: $$x^*=f'^{-1}(\frac{P_x}{P_y}).$$ Substituting this into your second equation gives $$I=P_xf'^{-1}(\frac{P_x}{P_y})+P_yy$$ $$y^*=\frac{I-P_xf'^{-1}(\frac{P_x}{P_y})}{P_y}.$$
In your example, we get $$x^*=(\frac{P_y}{P_x})^2.$$ $$y^*=\frac{I-P_x(\frac{P_y}{P_x})^2}{P_y}.$$
There is a fundamental problem with your solution. You write a demand function for $$x$$ that depends on the quantity of $$y$$. Demand functions depend either on $$(P_x,P_y,I)$$, if Marshallian, or $$(P_x,P_y,U)$$, if Hicksian.