# Constrained Optimisation: Why is it that when I merge constraints, I get different results?

The problem that I am given is the following:

$$\max \ln c_0 + \beta \mathbb{E} [\ln c_1 ] \\ \text{ s.t. } c_0 + x_g q_g + x_b q_b = y_0\\ c_g = y_g + x_g\\ c_b = y_b + x_b$$

Where $$y_0$$, $$y_b$$ and $$y_g$$ is exogenously given and are the income endowed in period 0, the bad state and the good state respectively.

$$x_g$$ and $$x_b$$ is the quantity of state contingent claims, while $$q_g$$ and $$q_b$$ is the price of these state contingent claims.

So, if I setup the Lagrangian as this:

$$\mathbb{L} = \ln c_0 + \beta ( \pi c_g + ( 1 - \pi) c_b) + \lambda ( y_0 - (c_0 + ( y_g - c_g) q_g + (y_b - c_b) q_b))$$

The FOCs are

$$[c_0]: \frac{1}{c_0} = \lambda$$

$$[c_g]: \beta \pi = \lambda q_g$$

$$[ c_b]: \beta ( 1 - \pi) = \lambda q_b$$

If I substitute the above, I get that

$$\frac{1} {c_0} = \frac{ \beta \pi} {q_g} = \frac {\beta ( 1 - \pi)} { q_b}$$

However, if I setup the Lagrangian as the following,

$$\mathbb{L} = \ln c_0 + \beta ( \pi c_g + ( 1 - \pi) c_b) + \lambda_g ( y_g + \frac{y_0 - c_0 - x_b q_b}{q_g} - c_g ) + \lambda_b ( y_b + \frac{y_0 -c_0 - x_g q_g}{q_b} - c_b )$$

The FOCs are:

$$[ c_0] \frac{1}{c_0} = \frac {\lambda_g} {q_g} + \frac {\lambda_b} {q_b}$$

$$[c_b]: \beta ( 1 - \pi) = \lambda_b$$

$$[c_g]: \beta \pi = \lambda_g$$

If I substitute in this case, I receive

$$\frac{1}{c_0} = \frac{ \beta \pi} {q_g} + \frac{ \beta ( 1- \pi)} { q_b}$$

However, both methods give different results, and I don't know the reason why. I know that one can combine constraints, but why is it that in this case they give different results.