f(x)=(1+1/tanx)*(sinx)^2-2sin(x+π/2)sin(x-π/4)
=(1+cosx/sinx)*(sinx)^2+2sin(x+π/4)cos[(x-π/4)+π/2]
=(sinx)^2+sinxcosx+2sin(x+π/4)cos(x+π/4)
=(sinx)^2+sinxcosx+sin(2x+π/2)
=1/2*(1-cos2x)+1/2*sin2x+cos2x
=1/2*sin2x+1/2*cos2x+1/2
=√2/2*sin(2x+π/4)+1/2
1,因为tanx=2
所以sin2x=2tanx/[1+(tanx)^2]=4/(1+4)=4/5
cos2x=[1-(tanx)^2]/[1+(tanx)^2]=(1-4)/(1+4)=-3/5
所以f(x)=1/2*sin2x+1/2*cos2x+1/2
=1/2*(4/5)+1/2*(-3/5)+1/2
=4/10-3/10+1/2
=3/5
2,f(x)=√2/2*sin(2x+π/4)+1/2
∵π/12≤x≤π/2
∴π/6≤2x≤π
∴5π/12≤2x+π/4≤5π/4
所以-√2/2≤sin(2x+π/4)≤1
∴0≤√2/2*sin(2x+π/4)+1/2≤(√2+1)/2
即f(x)的取值范围为[0,(√2+1)/2]