y=√2sin(x+π/4)-1/tanx+cotx=√2sin(x+π/4)-1/(sinx/cosx+cosx/sinx)
=sinx+cosx-sinxcosx=sinx+cosx-[(1+2sinxcosx)-1]/2
=sinx+cosx-[(sinx+cosx)^2-1]/2
=-1/2*[(sinx+cosx)^2-2(sinx+cosx)-1]
=-1/2*(sinx+cosx-1)^2+1
=-1/2*[√2sin(x+π/4)-1]^2+1
所以,函数的最大值是1
最小值是-1/2*(-√2-1)^2+1=-1/2*(3+2√2)+1=-(3+2√2-2)/2=-(1+2√2)/2