Deriving FOC in OLG model with Cobb Douglas utility

I'm trying to derive the first order condition in a partial equilibrium overlapping generations model. The setup contains both consumption and housing goods.

$$\underset{c_{t+i},h_{t+i}}{max}U_{t}^{N}=\sum_{i=0}^{N}\beta^{i}\frac{1}{1-\gamma}\left(h_{t+i}^{\alpha}c_{t+i}^{1-\alpha}\right)^{1-\gamma}$$ S.t. $$a_{t+i}=y_{t+i}+\left(1+r_{t+i-1}\right)a_{t+i-1}+q_{t+i}(1-d)h_{t+i-1}-p_{t+i}c_{t+i}-q_{t+i}h_{t+i}$$ $$a_{t+N}\geq 0$$ $$a_{t}=0$$

The paper which I'm trying to reproduce finds the following FOCs $$\frac{h_{t+i}}{c_{t+i}}=\frac{\alpha}{1-\alpha}\frac{p_{t+i}}{R_{t+i}}$$ and $$\frac{c_{t+i+1}}{c_{t+i}}=\left(\frac{p_{t+i}/R_{t+i}}{p_{t+i+1}/R_{t+i+1}}\right)^{\frac{\alpha(1-\gamma)}{\gamma}}\left(\beta\left(1+\rho_{t+i}\right)\right)^{1/\gamma}$$ where $$R_{t+i}=\frac{q_{t+i}}{\left(1+\rho_{t+i}^{q}\right)}\left(\rho_{t+i}^{q}+d\right)$$ and $$1+\rho_{t+i}^{q}=\left(1+r_{t+i}\right)\frac{q_{t+i}}{q_{t+i+1}}$$

In particular I am struggling to setup the lagrangian and dealing with the fact that utility has to be maximized across periods. Thank you!

-----------edit---------- I've come pretty far in solving the problem. But I would still be grateful for input.

The lagrangian: $$\mathcal{L}=\sum_{i=0}^{N}\left(\frac{1}{1-\gamma}\beta^{i}\left(h_{t+i}^{\alpha}c_{t+i}^{1-\alpha}\right)^{1-\gamma}+\lambda_{t+i}\left(y_{t+i}+\left(1+r_{t+i-1}\right)a_{t+i-1}+q_{t+i}(1-d)h_{t+i-1}-p_{t+i}c_{t+i}-q_{t+i}h_{t+i}-a_{t+i}\right)\right)$$

FOC $$\frac{\partial\mathcal{L}}{\partial c_{t+i}}=0$$ $$\beta^{i}\left(h_{t+i}^{\alpha}c_{t+i}^{1-\alpha}\right)^{-\gamma}h_{t+i}^{\alpha}\left(1-\alpha\right)c_{t+i}^{-\alpha} =\lambda_{t+i}p_{t+i}$$ $$\frac{\partial\mathcal{L}}{\partial h_{t+i}}=0$$ $$\Leftrightarrow\beta^{i}\left(h_{t+i}^{\alpha}c_{t+i}^{1-\alpha}\right)^{-\gamma}c_{t+i}^{1-\alpha}\alpha h_{t+i}^{\alpha-1} =\lambda_{t+i}q_{t+i}-\lambda_{t+i+1}q_{t+i+1}(1-d)$$ $$\frac{\partial\mathcal{L}}{\partial a_{t+i}}=0$$ $$\lambda_{t+i+1}\left(1+r_{t+i}\right)-\lambda_{t+i} =0$$ $$\Leftrightarrow\lambda_{t+i+1} =\frac{1}{\left(1+r_{t+i}\right)}\lambda_{t+i}$$ $$\beta^{i}\left(h_{t+i}^{\alpha}c_{t+i}^{1-\alpha}\right)^{-\gamma}c_{t+i}^{1-\alpha}\alpha h_{t+i}^{\alpha-1}-\lambda_{t+i}q_{t+i}+\frac{1}{\left(1+r_{t+i}\right)}\lambda_{t+i}q_{t+i+1}(1-d)$$ $$\beta^{i}\left(h_{t+i}^{\alpha}c_{t+i}^{1-\alpha}\right)^{-\gamma}c_{t+i}^{1-\alpha}\alpha h_{t+i}^{\alpha-1}=\lambda_{t+i}\left(q_{t+i}-\frac{1}{\left(1+r_{t+i}\right)}q_{t+i+1}(1-d)\right)$$ $$\beta^{i}\left(h_{t+i}^{\alpha}c_{t+i}^{1-\alpha}\right)^{-\gamma}h_{t+i}^{\alpha}\left(1-\alpha\right)c_{t+i}^{-\alpha}=\lambda_{t+i}p_{t+i}$$ $$\frac{h_{t+i}}{c_{t+i}}\frac{1-\alpha}{\alpha}=\frac{p_{t+i}}{q_{t+i}-\frac{q_{t+i+1}(1-d)}{\left(1+r_{t+i}\right)}}$$ $$\frac{h_{t+i}}{c_{t+i}}=\frac{\alpha}{1-\alpha}\frac{p_{t+i}}{q_{t+i}\left[1-\frac{q_{t+i+1}(1-d)}{q_{t+i}\left(1+r_{t+i}\right)}\right]}$$ substituting definitions $$R_{t+i}=\frac{q_{t+i}}{\left(1+r_{t+i}\right)\frac{q_{t+i}}{q_{t+i+1}}}\left(\left(1+r_{t+i}\right)\frac{q_{t+i}}{q_{t+i+1}}-1+d\right)$$ $$\frac{h_{t+i}}{c_{t+i}}=\frac{\alpha}{1-\alpha}\frac{p_{t+i}}{R_{t+i}}$$

Is this approach correct? Is a global maximum guaranteed when maximizing across two periods?

Also I am still having problems with the second FOC $$\frac{c_{t+i+1}}{c_{t+i}}=\left(\frac{p_{t+i}/R_{t+i}}{p_{t+i+1}/R_{t+i+1}}\right)^{\frac{\alpha(1-\gamma)}{\gamma}}\left(\beta\left(1+\rho_{t+i}\right)\right)^{1/\gamma}$$

• Can you give a reference to the paper in question? Feb 20 '20 at 22:27
• what are $h_t$, $q_t$. $R_t$, $a_t$? If $d$ is dividends, why is it constant? Also what is $q$? Feb 25 '20 at 6:08
• @GradaGukovic h is housing stock, q is the price of housing, R is the nominal user cost of housing, a is net assets. Feb 26 '20 at 10:43
• @HerrK. The paper in question: papers.ssrn.com/sol3/papers.cfm?abstract_id=597444 Feb 26 '20 at 10:45