# Max Utility Function and Finding associated demand curve

I have a max utility function, therefore; U(x,y)= max(2x,y) and I am trying to find the demand function x = x(𝑝x , 𝑝y , 𝑀), note this function cannot be differentiated. I am familiar that the utility function states that it is best to have x=0 and all of the good y, or vice versa. So I've been trying to solve with the budget line making one x=0 and then again y=0 but I am unsure what to do from this point?

Working so far: p1x+p2y=M when y=0 x=m/p1 U= 2m/p1

& when x=0 y=m/p2 U= m/p2

So now I have two equations in terms of U

• Yeah, I actually do know what it is :) excuse my non-formal language, I'm asking what the demand function for x is for that given utility function... thanks – L W Apr 1 '20 at 10:59
• I get that, but you wrote "it is best to have x=0 and all of the good y, or vice versa." Surely it is very easy to check which one is better for any given M,p1,p2? – Giskard Apr 1 '20 at 11:05
• Hint: Does x=m/p1 or x=0 lead to higher utility? – Herr K. Apr 1 '20 at 11:17
• I can get the utility of when y=0 and x=0 I'm just getting stuck on showing which has greater utility – L W Apr 1 '20 at 11:33
• yep, done that, rather so I have two equations in terms of U – L W Apr 1 '20 at 11:41

From your formula for $$x$$ when $$y=0$$, you should be able to find $$U$$ in terms of $$M$$ and $$p_x$$ when $$y=0$$. Similarly, $$U$$ in terms of $$M$$ and $$p_y$$ when $$x=0$$. The key then is to find the critical price ratio at which, to maximise $$U$$, the switch needs to occur from $$y=0$$ to $$x=0$$.
• If you equate those two formulae for $U$ you obtain a condition under which utility is the same when $y=0$ or when $x=0$. You can then cancel $M$ and rearrange to obtain what I call the critical price ratio. One side of this ratio, utility is maximised with $y=0$; the other side, with $x=0$. – Adam Bailey Apr 1 '20 at 11:46
• The demand function for $x$ will need to be in two parts: if $p_x/p_y\geq 2$ then ... and if $p_x/p_y\leq2$ then ... – Adam Bailey Apr 1 '20 at 12:04