# Exchange economy with two agents, what's the competitive equilibrium?

I'm currently doing this assignment but I'm keep getting stuck by this question. I put the Lagrange function for both agents and get the MRS / Price ratio but what should I do from there? I’m going to change the notation to one I’m more comfortable with:

Let the goods be $$x,y$$, the consumers $$A,B$$; and the respective endowments $$(w_{x_A},w_{y_A}), (w_{x_B},w_{y_B})$$.

Let’s set as numeraire $$p_y = 1$$.

Since both utilities are the same, we solve this problem once:

$$\max - e^{-x_i} - e^{-y_i}$$

s.t. $$p_x x_i + y_i = p_x w_{x_i} + w_{y_i}$$

The optimality condition is

$$MRS_i = p_x$$

$$\frac{\frac{\partial U_i}{\partial x_i}}{\frac{\partial U_i}{\partial y_i}} = p_x$$

$$\frac{e^{-x_i}}{e^{-y_i}} = p_x$$

$$e^{y_i - x_i} = p_x$$

$$y_i - x_i = \ln(p_x)$$

$$y_i = x_i + \ln(p_x)$$

Plugging into the budget constraint,

$$p_x x_i + x_i + \ln(p_x) = p_x w_{x_i} + w_{y_i}$$

$$(p_x + 1) x_i = p_x w_{x_i} - \ln(p_x) + w_{y_i}$$

Solving for $$x_i$$

$${x_i}^\star = \frac{p_x w_{x_i} - \ln(p_x) + w_{y_i}}{p_x + 1}$$

Plugging into the expression for $$y_i$$

$${y_i}^\star = \frac{p_x w_{x_i} + p_x \ln(p_x) + w_{y_i}}{p_x + 1}$$

Plugging the endowments

$${x_A}^\star = \frac{p_x - \ln(p_x) + 5}{p_x + 1}$$

$${x_B}^\star = \frac{3 p_x - \ln(p_x) + 3}{p_x + 1}$$

$${y_A}^\star = \frac{p_x + p_x \ln(p_x) + 5}{p_x + 1}$$

$${y_B}^\star = \frac{3 p_x + p_x \ln(p_x) + 3}{p_x + 1}$$

The market for good $$x$$ clears when

$${x_A}^\star + {x_B}^\star = w_{x_A} + w_{x_B}$$

$$\frac{4 p_x - 2 \ln(p_x) + 8}{p_x + 1} = 4$$

$$4 p_x - 2 \ln(p_x) + 8 = 4 p_x + 4$$

$$4 = 2 \ln(p_x)$$

$$2 = \ln(p_x)$$

$${p_x}^\star = e^2$$

By Walras’s Law, the market for good $$y$$ also clears.

Plugging the equilibrium price into the demand functions

$${x_A}^\star = \frac{e^2 + 3}{e^2 + 1}$$

$${x_B}^\star = \frac{3 e^2 + 1}{e^2 + 1}$$

$${y_A}^\star = \frac{3 e^2 + 5}{e^2 + 1}$$

$${y_B}^\star = \frac{5 e^2 + 3}{e^2 + 1}$$

An allocation $$((c^*_{a,1},c^*_{a,2}),(c^*_{b,1},c^*_{b,2}))$$ is a competitive equilibrium allocation for the given economy supported by the price ratio $$\frac{p_1^*}{p_2^*}$$ if it satisfies the following:
$$1.$$ Solution to UMP of $$a$$ and $$b$$ :
Given $$(p_1^*,p_2^*)$$, $$(c^*_{a,1},c^*_{a,2})$$ is a solution to: \begin{align} \max_{c_{a,1},c_{a,2}\geq0} \quad & U_a=-e^{-c_{a,1}}-e^{-c_{a,2}}\\ \textrm{s.t.} \quad & p_1^*c_{a,1}+p_2^*c_{a,2}\leq p_1^*+5p_2^*\end{align} Given $$(p_1^*,p_2^*)$$, $$(c^*_{b,1},c^*_{b,2})$$ is a solution to: \begin{align} \max_{c_{b,1},c_{b,2}\geq0} \quad & U_b=-e^{-c_{b,1}}-e^{-c_{b,2}}\\ \textrm{s.t.} \quad & p_1^*c_{b,1}+p_2^*c_{b,2}\leq 3p_1^*+3p_2^*\end{align}
$$2.$$ Market Clearing: The optimal demand obtained in $$1.$$ must be market-clearing i.e.,$$c^*_{a,1}+c^*_{b,1}=4\\ c^*_{a,2}+c^*_{b,2}=8$$

To solve for competitive equilibrium we first need the demand functions of $$a$$ and $$b$$.
Since we are interested in relative prices let us normalize price of good 2 to 1. Formally, $$p_2\overset{set}{=}1$$. This will enable us to find the demand functions in terms of $$p_1$$ alone.

UMP of agent a: \begin{align}\max_{c_{a,1},c_{a,2}\geq0} \quad & -e^{-c_{a,1}}-e^{-c_{a,2}}\\ \textrm{s.t.} \quad & p_1c_{a,1}+c_{a,2}\leq p_1+5\end{align}

solving above gives: $$(c_{a,1},c_{a,2})^d(p_1)=\left(\frac{5+p_1-\ln p_1}{p_1+1},\frac{p_1(1+\ln p_1)+5}{p_1+1}\right)$$

UMP of agent b: \begin{align}\max_{c_{b,1},c_{b,2}\geq0} \quad & -e^{-c_{b,1}}-e^{-c_{b,2}}\\ \textrm{s.t.} \quad & p_1c_{b,1}+c_{b,2}\leq 3p_1+3\end{align}

solving above gives: $$(c_{b,1},c_{b,2})^d(p_1)=\left(\frac{3+3p_1-\ln p_1}{p_1+1},\frac{p_1(3+\ln p_1)+3}{p_1+1}\right)$$

Both UMPs are standard ones with concave utility functions so you can use the lagrangian method to solve the above.

Now we can solve for the equilibrium price by using $$2.$$ and the demand functions.

Market for good 1 clears when: $$c_{a,1}(p_1)+c_{b,1}(p_1)=4$$ $$\begin{eqnarray} & \frac{5+p_1-\ln p_1}{p_1+1}+\frac{3+3p_1-\ln p_1}{p_1+1}=4 \\ & p_1=e^2\end{eqnarray}$$

Therefore, $$((c^*_{a,1},c^*_{a,2}),(c^*_{b,1},c_{b,2}))=\left(\left(\frac{3+e^2}{e^2+1},\frac{3e^2+5}{e^2+1}\right),\left(\frac{1+3e^2}{e^2+1},\frac{5e^2+3}{e^2+1}\right)\right)$$ is the competitive equilibrium allocation supported by the equilibrium price ratio $$\frac{p_1^*}{p_2^*}=e^2$$