I wonder how to optimize an infinite series using Classical (Lagrangian) method. For example:$\sum_{t=1}^{\infty}\beta^{t-1}\ln c_t$ subject to the constraint $c_t+b_t\leq y_t+(1-r)b_{t-1}$ where $c_t$ is a consumption of a good at date $t$, $y_t$ is endowment at date $t$, $r$ is interest interest rate and $b_t$ is savings at date $t$.
Attempt: I know how optimize it if $t$ was $t=1,2$. Then, the problem would look like $\underset{c_1,c_2}{\max}[\ln c_1+\beta \ln c_2]$ subject to $c_1+b_1=y_1+(1-r)b_0\\c_2=y_2+(1+r)b_1$
The second constraint does not have $b_2$. There is no need to save for the third period because there are only two periods. So using the Classical method first we need to form the Lagrangian:$L(c_1,c_2,\lambda_1,\lambda_2)=\ln(c_1)+\beta \ln(c_2)+\lambda_1[y_1+(1-r)b_0-b_1-c_1]+\lambda_2[y_2+(1+r)b_1-c_2]$
Then I take the derivatives with respect to $(c_1,c_2,\lambda_1,\lambda_2)$ and solve for $c_1$ and $c_2$. Now, how do I approach this problem when $t\rightarrow\infty$. My professor told me solving this kind of optimization problems is called dynamic programming.