<p>Some economics problems are deisgned to help us practice the basic tools (e.g., optimisation) of the trade. Others are designed to force us to think about the mechanics of a problem to help us understand the underlying economics better.</p>

<p>This problem falls into the latter category, so I recommend you give up on trying to usual calculus (which is premised on finding some sort of indifference curve tangent) and play around with the problem to figure out why this approach isn't working.</p>

<hr>

<p>A consumer with $u=x_1-x_2$ is indifferent between the bundles $(4,3)$ and $(3,2)$. We can plot these and other indifference budles to draw an indifference curve:</p>

<p><a href="https://i.sstatic.net/7kVlZ.png" rel="noreferrer"><img src="https://i.sstatic.net/7kVlZ.png" alt="enter image description here"></a></p>

<p>Likewise, the consumer is indifferent between $(4,4)$ and $(5,5)$ and we can, in this fashion, get an indifference map:</p>

<p><a href="https://i.sstatic.net/yxLxT.png" rel="noreferrer"><img src="https://i.sstatic.net/yxLxT.png" alt="enter image description here"></a></p>

<p>From inspection of the utility function we know that the consumer is better off with more $x_1$ and less $x_2$, so utility increases in the direction indicated.</p>

<p>Now we can pick an endowment vector (e.g,. $(2,4)$) and a relative price (e.g. $-p_1/p_2=-1$) and plot the price line:</p>

<p><a href="https://i.sstatic.net/4SsjE.png" rel="noreferrer"><img src="https://i.sstatic.net/4SsjE.png" alt="enter image description here"></a></p>

<p>The consumer can trade from their endowment to any point along this line. By inspection, you should be able to figure out what the demand vector $\mathbf{x}=(x_1,x_2)$ will be. </p>

<hr>

<p>Addendum: once you figure out what is going on here, your condition $$\frac{\partial u}{\partial x_1}=1+p_1/p_2$$
should make a bit more sense to you.</p>

CC BY-SA 3.0
2017-03-05T11:09:48.220Z
So the consumer will demand $x^*(\frac{E}{p_1},0),\ E=e_1p_1+e_2p_2$
Jakob Jul Elben
CC BY-SA 3.0
2017-03-05T11:41:09.587Z
@JakobJulElben Yes, that's basically right. If we want to be thorough, there are two special cases to worry about. Firstly, think about what happens in the figure if the price line is almost horizontal and the total social endowment is $(6,5)$. Secondly, it could be that the reason the consumer doesn't like $x_2$ is that it is, for example, "hours of work". But then we might expect $p_2$ (the wage) to be negative. If $p_1>0$ and $p_2<0$ then the price line will slope upwards and then we need to be a bit more careful about the solution.
Ubiquitous
CC BY-SA 3.0
2017-03-06T00:26:36.190Z
That's excellent. I might as well create a socket puppet to give you a second vote (just kidding).
Alecos Papadopoulos
CC BY-SA 3.0
2017-03-05T09:30:12.300Z
2017-03-05T09:36:24.090Z
2017-03-05T09:36:24.090Z
Ubiquitous
<p>If you are studying micro and grasp the notion of Marginal Utilities, you can also notice that for the given utility function <span class="math-container">$MU_{x_2}=\frac{\partial u}{\partial x_2}&lt;0$</span> i.e., every additional unit of good 2 reduces your utility. So, it doesn't make sense to consume positive amount of good 2 in optimum.</p>
<p><span class="math-container">$$\begin{aligned} 
\underset{x_1\geq0, x_2 \geq 0}\max &amp; u=x_1-x_2 &amp; \\
\textrm{s.t.} \quad &amp; p_1x_1+p_2x_2=p_1e_1+p_2e_2
\end{aligned}$$</span></p>
<p>upon substitution
<span class="math-container">$\underset{0 \leq x_1\leq \frac{p_1e_1+p_2e_2}{p_1} }\max u=\frac{x_1(p_1+p_2)}{p_2}-\frac{p_1e_1}{p_2}+e_2$</span></p>
<p>now as you computed, the objective is increasing in <span class="math-container">$x_1$</span> i.e., <span class="math-container">$\frac{\partial u}{\partial x_1}&gt;0$</span></p>
<p>So, we set <span class="math-container">$x_1$</span> to the maximum value it can take to solve the UMP.</p>
<p>we get, <span class="math-container">$\boxed{(x_1^*,x_2^*)=(\frac{p_1e_1+p_2e_2}{p_1},0)}$</span> is your required demand function.</p>

CC BY-SA 4.0
2023-03-18T07:28:14.433Z
2023-03-18T07:28:14.433Z
mynameparv
<p>I'm trying to find the uncompensated demand function. How would you do that, when I have the following utility function $u(x_1,x_2)=x_1-x_2$, and the budget constraint $p_1\cdot x_1+p_2\cdot x_2=p_1\cdot e_1+p_2\cdot e_2$. </p>

<p>I've found the following.</p>

<p>$\max\ u(x_1,x_2)=x_1-x_2 \ s.t. \ p_1(x_1-e_1)+p_2(x_2-e_2)=0$</p>

<p>With use of substitutions I must maximize the following expression</p>

<p>$\max\ u(x_1,x_2)=x_1-\frac{p_1(e_1-x_1)+p_2e_2}{p_2}$</p>

<p>I find the f.o.c.</p>

<p>$\frac{\partial u}{\partial x_1}=1+\frac{p_1}{p_2}=0$</p>

CC BY-SA 3.0
2017-03-04T22:49:33.807Z
Please do show what you have tried. Just a hint : Either you can solve the maximization by plugging the constraint in your utility function or juste use a Lagrangian.
optimal control
CC BY-SA 3.0
2017-03-06T00:32:06.003Z
While Ubiquitus answer is excellent, if you want to explore the mathematical treatment of your problem, note that with the presence of a "bad" ($x_2$), one should expect that the non-negativity constraint on it will become binding at the solution (in a "usual" problem it is not so we conveniently ignore this constraint). So your maximization problem includes additional constraints ad multipliers that are usually zero, but here they are not. And you have to consider the full Karush-Kuhn-Tucker conditions for a maximum.
Alecos Papadopoulos
<utility>
How to derive the demand function of $U(x_1,x_2)=x_1-x_2$
Jakob Jul Elben
# How to derive the demand function of $U(x_1,x_2)=x_1-x_2$

(Asked by: username_0 on 2017-03-04)

I'm trying to find the uncompensated demand function. How would you do that, when I have the following utility function $u(x\_1,x\_2)=x\_1-x\_2$, and the budget constraint $p\_1\cdot x\_1+p\_2\cdot x\_2=p\_1\cdot e\_1+p\_2\cdot e\_2$.

I've found the following.

$\max\ u(x\_1,x\_2)=x\_1-x\_2 \ s.t. \ p\_1(x\_1-e\_1)+p\_2(x\_2-e\_2)=0$

With use of substitutions I must maximize the following expression

$\max\ u(x\_1,x\_2)=x\_1-\frac{p\_1(e\_1-x\_1)+p\_2e\_2}{p\_2}$

I find the f.o.c.

$\frac{\partial u}{\partial x\_1}=1+\frac{p\_1}{p\_2}=0$

**Tags:** utility

> **Comments:**
> **username_1**: Please do show what you have tried. Just a hint : Either you can solve the maximization by plugging the constraint in your utility function or juste use a Lagrangian.  
> **username_2**: While Ubiquitus answer is excellent, if you want to explore the mathematical treatment of your problem, note that with the presence of a "bad" ($x_2$), one should expect that the non-negativity constraint on it will become binding at the solution (in a "usual" problem it is not so we conveniently ignore this constraint). So your maximization problem includes additional constraints ad multipliers that are usually zero, but here they are not. And you have to consider the full Karush-Kuhn-Tucker conditions for a maximum.  

---

## 2 answers

### Answer by username_3 on 2017-03-05. Score: 6

Some economics problems are deisgned to help us practice the basic tools (e.g., optimisation) of the trade. Others are designed to force us to think about the mechanics of a problem to help us understand the underlying economics better.

This problem falls into the latter category, so I recommend you give up on trying to usual calculus (which is premised on finding some sort of indifference curve tangent) and play around with the problem to figure out why this approach isn't working.

---

A consumer with $u=x\_1-x\_2$ is indifferent between the bundles $(4,3)$ and $(3,2)$. We can plot these and other indifference budles to draw an indifference curve:

[![enter image description here](https://i.sstatic.net/7kVlZ.png)](https://i.sstatic.net/7kVlZ.png)

Likewise, the consumer is indifferent between $(4,4)$ and $(5,5)$ and we can, in this fashion, get an indifference map:

[![enter image description here](https://i.sstatic.net/yxLxT.png)](https://i.sstatic.net/yxLxT.png)

From inspection of the utility function we know that the consumer is better off with more $x\_1$ and less $x\_2$, so utility increases in the direction indicated.

Now we can pick an endowment vector (e.g,. $(2,4)$) and a relative price (e.g. $-p\_1/p\_2=-1$) and plot the price line:

[![enter image description here](https://i.sstatic.net/4SsjE.png)](https://i.sstatic.net/4SsjE.png)

The consumer can trade from their endowment to any point along this line. By inspection, you should be able to figure out what the demand vector $\mathbf{x}=(x\_1,x\_2)$ will be.

---

Addendum: once you figure out what is going on here, your condition $$\frac{\partial u}{\partial x\_1}=1+p\_1/p\_2$$
should make a bit more sense to you.

> **Comments:**
> **username_0**: So the consumer will demand $x^*(\frac{E}{p_1},0),\ E=e_1p_1+e_2p_2$  
> **username_3**: @username_0 Yes, that's basically right. If we want to be thorough, there are two special cases to worry about. Firstly, think about what happens in the figure if the price line is almost horizontal and the total social endowment is $(6,5)$. Secondly, it could be that the reason the consumer doesn't like $x_2$ is that it is, for example, "hours of work". But then we might expect $p_2$ (the wage) to be negative. If $p_1>0$ and $p_2<0$ then the price line will slope upwards and then we need to be a bit more careful about the solution.  
> **username_2**: That's excellent. I might as well create a socket puppet to give you a second vote (just kidding).  

---

### Answer by username_4 on 2023-03-18. Score: 1

If you are studying micro and grasp the notion of Marginal Utilities, you can also notice that for the given utility function $MU\_{x\_2}=\frac{\partial u}{\partial x\_2}<0$ i.e., every additional unit of good 2 reduces your utility. So, it doesn't make sense to consume positive amount of good 2 in optimum.

$$\begin{aligned}
\underset{x\_1\geq0, x\_2 \geq 0}\max & u=x\_1-x\_2 & \\
\textrm{s.t.} \quad & p\_1x\_1+p\_2x\_2=p\_1e\_1+p\_2e\_2
\end{aligned}$$

upon substitution
$\underset{0 \leq x\_1\leq \frac{p\_1e\_1+p\_2e\_2}{p\_1} }\max u=\frac{x\_1(p\_1+p\_2)}{p\_2}-\frac{p\_1e\_1}{p\_2}+e\_2$

now as you computed, the objective is increasing in $x\_1$ i.e., $\frac{\partial u}{\partial x\_1}>0$

So, we set $x\_1$ to the maximum value it can take to solve the UMP.

we get, $\boxed{(x\_1^\*,x\_2^\*)=(\frac{p\_1e\_1+p\_2e\_2}{p\_1},0)}$ is your required demand function.


---

