function f = w1(c,l,mu) global sigma theta if sigma == 1 f = log(c.^theta.*(1-l).^(1-theta))+mu.*theta-mu.*(1-theta).*l./(1-l); else f = (c.^theta.*(1-l).^(1-theta)).^(1-sigma).*(1/(1-sigma)+mu.*theta-mu.*(1-theta).*l./(1-l)); end