解:因为f(x)=(1+1/tanx)sinx^2-2sin(x+π/4)sin(x-π/4)
=sinx^2+1/(sinx/cosx)*sinx^2+2sin(x+π/4)sin(π/4-x)
=sinx^2+sinxcosx+2sin(x+π/4)sin[π/2-(x+π/4)]
=sinx^2+sinxcosx+2sin(x+π/4)cos(x+π/4)
=sinx^2+sinxcosx+sin2(x+π/4)
=sinx^2+sinxcosx+sin(2x+π/2)
=sinx^2+sinxcosx+cos2x
=sinx^2+sinxcosx+cosx^2-sinx^2
=sinxcosx+cosx^2
=(sinxcosx+cosx^2)/(sinx^2+cox^2)
=(tanx+1)/tanx^2+1)
所以当:tana=2时,f(a)=(tana+1)/(tana^2+1)
=(2+1)/(2^2+1)
=3/5.
因为f(x)=sinxcosx+cosx^2=1/2sin2x+1/2cos2x+1/2
=1/2(sin2x+cos2x)+1/2
=根号2/2sin(2x+π/4)+1/2
当x属于(π/12,π/2〕,2x属于(π/6,π],2x+π/4属于(5π/12,5π/4],
sin(2x+π/4)属于[-根号2/2,1],根号2/2sin(2x+π/4)属于[-1/2,根号2/2]
故f(x)的取值范围是:【0,(根号2+1)/2】。