f(x)=2cosx(sinx-cosx)+1
=2sinxcos-2cosx^2+1
=sin2x-cos2x
=根号2*sin(2x-π/4)
T=2π/2=π
x∈[π/8,3π/4],2x-π/4∈[0,5π/4],
sin(2x-π/4)∈[-根号2/2,1】,
最小值为-1,最大值为根号2.
2. -1≤siny=1/3-sinx≤1,且-1≤sinx≤1
解得:-2/3≤sinx≤1
a=siny-(cosx)^2=1/3-sinx+(sinx)^2-1
=(sinx)^2-sinx-2/3
=(sinx-1/2)^2-11/12
当sinx=1/2时,最小值是-11/12
当sinx=-2/3时,最大值是4/9