# A question about Lagrangian, KKT theorem, consumer's problem

Suppose we want to maximise a expected utility function: $$E_1(u(C_1,C_2,C_3))$$ subject to following constraints. There are two possible situations each with probability $$\frac{1}{2}$$. $$C_1 + S_1 = Y$$

$$\begin{cases} C_{2,1} + S_{2,1} = Y + S_1 + \varepsilon \\ C_{3,1} = Y + S_{2,1} & \text{with probability } \frac{1}{2} \end{cases}$$
$$\begin{cases} C_{2,2} + S_{2,2} = Y + S_1 - \varepsilon \\ C_{3,2} = Y + S_{2,2} & \text{with probability } \frac{1}{2} \end{cases}$$
$$C_1, C_{2,1}, C_{2,2}, C_{3,1}, C_{3,2} > 0$$.

How can we solve this model using lagrangian, when ignoring the inequality? I have never seen similar models before, so I'm stuck at the beginning of writing a Lagrangian.

Further, if we include liquidity constraint, that $$S_1,S_{2,1},S_{2,2}\geq 0$$? I can convert these inequality constraints into $$Y$$ and $$\varepsilon$$, and use KKT theorem? I really have no idea of it.

Here you can consider $$C_i$$ as consumption in $$i$$ time period, $$C_{i,j}$$ be consumption at $$i$$ period with $$j$$ situation(whether add or subtract $$\varepsilon$$),and $$S$$ similarly defined.

• Assuming that saving is positive is not usually part of the setup because it is assumed that agents can borrow. However, you then need some constraints on the final debt. For finite horizon, it is often assumed that the agent has no debt in the final period. This is already assumed because there is no $S_{3j}$ ... in the last period everything is consumed and it is assumed that $C_{3j}$ is positive so your debt cannot be negative in final period. So in short ... do not add positivity constraints on savings. Commented Jun 2 at 8:51
• Without loss of generality, you can assume that epsilon only takes on positive values. If the shock is positive, the agent is incentivized to borrow for periods 1 and 3 financed by high income in the second period. The other way around if the shock is negative. You can just write out the expectation using the probabilities and then you get some sort of system of Euler equations. To get closed form solution you need to assume something about the utility function itself. Commented Jun 2 at 9:05
• so supposing utility is $\ln(C_1)+\ln(C_2)+\ln(C_3)$the lagrangian would be $L=E_1[n(C_1)+\ln(C_2)+\ln(C_3)+\lambda_1(3Y-C_1-C_{2,1}-C_{3,1}+\epsilon)+\lambda_2(3Y-C_1-C_{2,2}-C_{3,2}-\epsilon)]$. And by writing it out, we have $\ln(C_1)+0.5\ln(C_{2,1})+0.5\ln(C_{2,2})+0.5\ln(C_{3,1})+0.5\ln(C_{3,2})+0.5\lambda_1(3Y-C_1-C_{2,1}-C_{3,1}+\epsilon)+0.5\lambda_2(3Y-C_1-C_{2,2}-C{3,2}-\epsilon)$. Then the FOCs are obtained by differentiate wrt $C_1,C_{2,1},C_{2,2},C_{3,1},C_{3,2}$ respectively? Commented Jun 2 at 10:36
• Further, if we want to consider a situation where there's no way to borrow, so $S$ must all be non-negative, how should we solve this model? There should be a simpler intuitive way without using KKT? Commented Jun 2 at 10:40

$$L(C_1,C_{21},C_{31},C_{22},C_{32},S_1,S_{21},S_{22}) = p_1 \times u(C_1,C_{21},C_{31}) + p_2 \times u(C_1,C_{22},C_{32}) + \alpha(Y-C_1-S_{1}) + \lambda_2(Y+\epsilon +S_1 - C_{21} - S_{21}) + \lambda_3(Y+S_{21} - C_{31}) + + \delta_2(Y-\epsilon +S_1 - C_{22} - S_{22}) + \delta_3(Y+S_{22} - C_{32}),$$
\begin{align} \frac{\partial L}{\partial C_{1}} &= p_1 \frac{\partial U}{\partial C_1} + p_2 \frac{\partial U}{\partial C_1} - \alpha = 0 \\ \frac{\partial L}{\partial C_{21}} &= p_1 \frac{\partial U}{\partial C_{21}} - \lambda_2 =0\\ \frac{\partial L}{\partial C_{31}} &= p_1 \frac{\partial U}{\partial C_{31}} - \lambda_3 =0\\ \frac{\partial L}{\partial C_{21}} &= p_2 \frac{\partial U}{\partial C_{22}} - \delta_2 =0\\ \frac{\partial L}{\partial C_{32}} &= p_2 \frac{\partial U}{\partial C_{32}} - \delta_3 =0\\ \frac{\partial L}{\partial S_1} &= -\alpha + \lambda_2 + \delta_2=0\\ \frac{\partial L}{\partial S_{21}} &= - \lambda_2 + \lambda_3 =0\\ \frac{\partial L}{\partial S_{22}} &= - \delta_2 + \delta_3 =0.\\ \end{align}