function c= cake1(w)

c = (R*w(1:n)-w(2:n+1)).^(-sigma) - R*beta*(w(2:n+1)-w(3:n+2)).^(-sigma);


