f(x)=[sinx(1+sinx)+cosx(1+cosx)]/[(1+cosx)(1+sinx)]
=[sinx+cosx+1]/[1+sinx+cosx+sinxcosx]
令t=sinx+cosx,则有t^2=1+2sinxcosx,得sinxcosx=(t^2-1)/2
f(x)=(t+1)/[t+1+(t^2-1)/2]
=2(t+1)/(t+1)^2
=2/(t+1)
因为t=√2sin(x+π/4),即在[0,π/2],t的最大值为√2,最小值为1
而在此区间,f(x)关于t单调减,
t=√2时,f(x)=2/(√2+1)=2√2-2
t=1时,f(x)=1
故值域为[2√2-2,1]