I meet a hard bone. there are 2 equations,but the same meanning.

$\displaystyle max \int_0^T e^{-\rho t}lnc_tdt+\beta\int_T^\infty e^{-\rho t}lnc_tdt\\$
$\displaystyle s.t.\int_0^\infty e^{-rt}c_tdt=w$
or
$\displaystyle max lnc_t+\beta\sum_{s\ge 1}\rho^slnc_{t+s}$
$\displaystyle s.t.c_t+\sum_{s\ge 1}r^sc_{t+s}=w$

how to work it out?
pls help

thanks.
ps:
$\displaystyle \beta,\rho,w,r$ are constant