The consumer maximizes intertemporal utility over the whole stream of consumption (and I suspect income is exogenous here). Also for the result to pass through, the discount rate for utility must be identical with the discount rate for consumption-income (usually they aren't, the first being related to pure time preference, the second to interest rates). But assume they are identical. Then we have
\begin{equation*}
\max_{\{c_{t+j}\}|_{j=0}^{\infty}} \sum_{j=0}^{\infty}E_t[b^ju(c_{t+j})] \quad \textrm{s.t.}\quad \sum_{j=0}^\infty E_t[\beta^jc_{t+j}] = \sum_{j=0}^\infty E_t [\beta^j y_{t+j}]
\end{equation*}
Since the budget constraint is written in present-value form, then we have one lagrange multiplier for all periods, so the Langrangean is
\begin{equation*}
L =\sum_{j=0}^{\infty}E_t[\beta^ju(c_{t+j})] + \lambda\left[ \sum_{j=0}^\infty E_t[\beta^jc_{t+j}] - \sum_{j=0}^\infty E_t [\beta^j y_{t+j}] \right]
\end{equation*}
The consumer solves this problem for $j=0,1,...$. For $j=0$ the expectations operator goes away and the first order condition is
$$j=0\qquad u'(c_t) + \lambda = 0 \Rightarrow a - bc_t = \lambda \Rightarrow c_t = \frac {a+\lambda}{b}$$
For $j=k$ we have
$$j=k\qquad E_t[\beta^ku'(c_{t+k})] + \lambda\beta^k = 0 \Rightarrow \beta^k\left(a - bE_t[c_{t+k}]\right) = \lambda\beta^k \Rightarrow E_t[c_{t+k}] = \frac {a+\lambda}{b}$$
So
$$E_t[c_{t+k}] = c_t$$
Intuitively, this happens because essentially the consumer solves a static problem, although in an intertemporal guise. Decision-making becomes truly dynamic when there exist factors that can be accumulated, creating the trade-off between present and future.
It is a method to maximize/minimize a function with constraints. I demonstrate the method with your exercise.
$\mathcal L=f(x_1,x_2)+\lambda (m-g(x_1,x_2))$
$f(x_1,x_2)$ is the function, which has to be maximized/minimized, in your case maximized.
$m-g(x_1,x_2)$ has to be zero. You have the budget restriction $m=p_1x_1+x_2$.
Now we can put all on the LHS: $m-p_1x_1+x_2=0$. The LHS can be insert into the brackets of the lagrange function, because it is equal to zero.
$\lambda$ ist the lagrange multiplier. For the moment you handle it like a ordinary variable.
$\mathcal L=x_1^{1/3}+x_2^{1/3}+\lambda (m-p_1x_1+x_2) $
Building the partial dervatives and set them equal to zero:
$\frac{\partial \mathcal L}{\partial x_1 }=\frac{1}{3}x_1^{-2/3}-\lambda p_1=0$
$\Rightarrow \frac{1}{3}x_1^{-2/3}=\lambda p_1 \quad (1)$
$\frac{\partial \mathcal L}{\partial x_2}=\frac{1}{3}x_2^{-2/3}-\lambda =0$
$\Rightarrow\frac{1}{3}x_2^{-2/3}=\lambda \quad (2)$
$\frac{\partial \mathcal L}{\partial \lambda}=m-p_1x_1+x_2=0\quad (3)$
Now you can divide (1) by (2):
$\frac{x_2^{2/3}}{x_1^{2/3}}=p_1$ The lambdas are cancelling out.
$x_2=p_1^{3/2}\cdot x_1 \quad (4)$
Now you can insert the expression for $x_2$ in (3)
$m-p_1x_1+p_1^{3/2}\cdot x_1=0$
Factoring out $x_1$
$m-x_1(p_1+p_1^{3/2})=0$
Now solve for $x_1$ and you will get the demand of good 1.
When you have the demand for good 1, you can use (4) to get the demand for good 2.
Best Answer
The OP's confusion comes from the fact that he or she does not apply the chain rule correctly and interprets the Euler condition
$u'(c_1) = \beta (1+r) u'(c_2)$
as
$ u_{C_1}(C_1) = \beta(1+r) u_{\boldsymbol{C_1}}(C_2) $
This is not the correct way to read the Euler condition and one should really read
$ u_{C_1}(C_1) = \beta(1+r) u_{\boldsymbol{C_2}}(C_2) $
Any doubt can be cleared by rederiving the FOC. The maximisation problem is
$\max_{C_1,C_2} u(C_1) + \beta u(C_2) \qquad s.t. \qquad $
\begin{equation*} C_1 + \frac{C_2}{1+r} = Y_1 + \frac{Y_2}{1+r} \implies C_2 = {-C_1}({1+r}) + Y_1(1+r) + {Y_2} \end{equation*}
So substituting the constraint, the problem can be written as
\begin{align}\max_{C_1} u\Big(C_1\Big) + \beta u\Big(\underbrace{{-C_1}({1+r}) + Y_1(1+r) + {Y_2}}_{=C_2}\Big)\end{align}
To find the FOC, one needs to apply the chain rule to the second period's utility function. Applying the chain rule carefully we have
\begin{align} \frac{\partial \beta u(C_2)}{\partial C_1} = \beta \frac{\partial u(C_2)}{\partial C_2} \frac{\partial C_2}{\partial C_1}\end{align}
In our case that is
\begin{align} \frac{\partial \beta u(C_2)}{\partial C_1} = \beta \frac{\partial u(C_2)}{\partial C_2} (-1)(1+r)\end{align}
Or to put it in yet another way
\begin{align}\frac{\partial \beta u(C_2)}{\partial C_1} & = \frac{\partial \big[\beta u\big({-C_1}({1+r}) + Y_1(1+r) + {Y_2}\big)\big]}{\partial C_1}\\ & = \beta \frac{\partial \big[\ u\big({-C_1}({1+r}) + Y_1(1+r) + {Y_2}\big)\big]}{\partial \big({-C_1}({1+r}) + Y_1(1+r) + {Y_2}\big)} \frac{\partial \big({-C_1}({1+r}) + Y_1(1+r) + {Y_2}\big)}{\partial C_1} \\ & = \beta \frac{\partial \big[\ u\big({-C_1}({1+r}) + Y_1(1+r) + {Y_2}\big)\big]}{\partial \big({-C_1}({1+r}) + Y_1(1+r) + {Y_2}\big)} (-1) (1+r) \\ &= \beta \frac{\partial u(C_2)}{\partial C_2} (-1)(1+r) \end{align}
Then, by definition, given a utility function $U(c_1,c_2)$, the MRS of good one with respect to good two is
In your case, as stated in your notes, you get
At an equilibrium, when consumers maximize utility, the Euler condition must be satisfied, that is
So replace this specific value for $u'(c_1)$ in the formula for the MRS and you get
As a good exercise, try to convince yourself that if the MRS takes another value, then the consumer can benefit from reallocating resources between the first and the second period.