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

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

how to work it out?
pls help

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