# Two-period two-good optimal consumption problem

I'm trying to solve a two-period two-good consumption problem. Endowment in the two periods is $$w_1$$ and $$w_2$$, the interest rate is $$\rho$$, and total utility is $$U(x_1, y_1) + \beta U(x_2, y_2)\ .$$

So far I have that for each $$t$$, total consumption is given by $$C_t = x_t p_{xt} + y p_{yt}\ , \qquad \qquad (1)$$ and the budget constraint is $$C_2 = w_2 + (1 + \rho)(w_1 - C_1)\ . \qquad \qquad (2)$$ So in the end, I need to solve $$\max_{x_1, y_1, x_2, y_2} U(x_1, y_1) + \beta U(x_2, y_2)$$ subject to (1) and (2).

I'm having trouble getting the optimisation off the ground. If I write down the Lagrangian and take derivatives I don't get anything approximating the Euler equation $$u'(C_1) = \beta(1 + \rho)u'(C_2) \qquad \qquad (3)$$ which I see everywhere for these types of problems.

My intuition tells me that I should be able to solve this problem in two stages. If I define $$u$$ to be the indirect utility function $$u(C) = U(x^*(C, p_{x}, p_{y}), y^*(C, p_{x}, p_{y}))\ ,$$ where $$x^*$$ and $$y^*$$ are the (still unknown) optimal consumption rules, then I should be able to

1. optimally allocate money over the two periods by solving (3) subject to (2);
2. optimally consume in each period by solving $$\frac{\partial_x U}{p_{xt}} = \frac{\partial_y U}{p_{yt}}$$ subject to (1).

Is this correct? If so, how can I formalize this argument? If not, what am I missing? References appreciated!

You can solve it in this way:

$$\max_{\{(a_1,a_2)\in\mathbb{R}^2_+|(1+\rho)a_1+a_2=(1+\rho)w_1+w_2\}} \left[\left[\max_{\{(x_1,y_1)\in\mathbb{R}^2_+|p_{x,1}x_1+p_{y,1}y_1\leq a_1\}} u(x_1,y_1)\right]+\beta\left[\max_{\{(x_2,y_2)\in\mathbb{R}^2_+|p_{x,2}x_2+p_{y,2}y_2\leq a_2\}} u(x_2,y_2)\right]\right]$$

Another way to write the above problem is as follows:

If $$v(p_X, p_Y, M)$$ denote the indirect utility function associated with the utility maximisation problem:

$$\displaystyle\max_{(x,y)\in\mathbb{R}^2_+} u(x,y)$$ subject to $$p_Xx+p_Yy\leq M$$

then the above problem can be re-written as:

$$\max_{\{(a_1,a_2)\in\mathbb{R}^2_+|(1+\rho)a_1+a_2=(1+\rho)w_1+w_2\}} \left(v(p_{x,1},p_{y,1},a_1)+\beta v(p_{x,2},p_{y,2},a_2)\right)$$

which can be written in another way (Bellman-style):

$$\max_{0\leq a_1\leq w_1+ \frac{w_2}{(1+\rho)}} \left(v(p_{x,1},p_{y,1},a_1)+\beta v(p_{x,2},p_{y,2},(1+\rho)w_1+w_2-(1+\rho)a_1)\right)$$

Similar example is discussed in this video: https://youtu.be/JsVd7nZ1tvs?feature=shared

I guess you can use a Bellman approach.

Observe that optimal $$x_2$$ and $$y_2$$ are functions of $$C_2$$ and second-period prices - I suppress dependence on second-period prices for notational simplicity.

You then have

$$\max_{x_1,y_1} U(x_1,y_1) + \beta U(x_2(C_2(C_1(x_1,y_1))),y_2(C_2(C_1(x_1,y_1))))$$

Because $$C_2$$ is function of $$C_1$$ as you write it yourself

$$C_2 = w_2 + (1+\rho)(w_1 -C_1)$$

and offcourse $$C_1$$ is function of $$x_1$$ and $$y_1$$.

Consider the first order condition for $$x_1$$ which is found to be

$$\frac{\partial U}{\partial x_1} + \beta \frac{\partial U}{\partial x_2}\frac{\partial x_2}{\partial C_2}\frac{\partial C_2}{\partial C_1}\frac{\partial C_1}{\partial x_1} + \beta \frac{\partial U}{\partial y_2}\frac{\partial y_2}{\partial C_2}\frac{\partial C_2}{\partial C_1}\frac{\partial C_1}{\partial x_1}=0$$

then you do divide by $$\frac{\partial C_1}{\partial x_1}$$ and use that

$$\frac{\partial U/\partial x_1}{\partial C_1/\partial x_1} = \frac{\partial U}{\partial C_1}$$

in order to get

$$\frac{\partial U}{\partial C_1} + \beta \frac{\partial U}{\partial x_2}\frac{\partial x_2}{\partial C_2}\frac{\partial C_2}{\partial C_1} + \beta \frac{\partial U}{\partial y_2}\frac{\partial y_2}{\partial C_2}\frac{\partial C_2}{\partial C_1}=0$$

then use that $$\partial C_2/\partial C_1 = -(1+\rho)$$ to get

$$\frac{\partial U}{\partial C_1} - \beta (1+\rho) \left[\frac{\partial U}{\partial x_2}\frac{\partial x_2}{\partial C_2} + \frac{\partial U}{\partial y_2}\frac{\partial y_2}{\partial C_2}\right]=0,$$

and by chain rule it follows

$$\frac{\partial U}{\partial C_1} - \beta (1+\rho) \frac{\partial U}{\partial C_2} =0,$$