过(0,1)
1=a+b
0<=x<=π/4
π/4<=x+π/4<=π/2
所以√2/2<=sin(x+π/4)<=1
若b>0
则最大=a+√2b=2√2-1
a+b=1
则a=-1,b=2
若b<0
则最大=a+b=2√2-1
和a+b=1矛盾
所以f(x)=-1+2√2sin(x+π/4)
过(0,1)
1=a+b
0<=x<=π/4
π/4<=x+π/4<=π/2
所以√2/2<=sin(x+π/4)<=1
若b>0
则最大=a+√2b=2√2-1
a+b=1
则a=-1,b=2
若b<0
则最大=a+b=2√2-1
和a+b=1矛盾
所以f(x)=-1+2√2sin(x+π/4)