设t=sina-cosa
t=sina-cosa
=√2(√2/2)sina-√2(√2/2)cosa
=√2sinacos(π/4)-√2cosasin(π/4)
=√2sin(a+π/4)∈[-√2,√2]
∴t∈[-√2,√2]
∵t²=sin²a+cos²a-2sinacosa=1-2sinacosa
∴2sinacosa=1-t²
∴y=1-t²+t
=-(t²-t+1/4)++5/4
=-(t-1/2)²+5/4
∵t∈[-√2,√2]
t-1/2∈[-√2-1/2,√2-1/2]
(t-1/2)²∈[0,9/4+√2]
-(t-1/2)²∈[-9/4-√2,0]
-(t-1/2)²+5/4∈[-1-√2,5/4]
最大值5/4,最小值-1-√2