f(x)=2asinx^2-(2√3)asinxcosx+b
=-a(1-2sinx^2)-2√3asinxcosx+b+a
=-acos2x-a√3sin2x+a+b
=-2a(0.5cos2x+0.5√3sin2x)+a+b
=-2asin(2x+π/6)+a+b
定义域为[0,π/2],
2x+π/6范围为[π/6,7π/6]
所以最小值为-2a+a+b=b-a=-5
最大值为-2asin(π+π/6)+a+b=2a+b=4
a=3,b=-2
f(x)=2asinx^2-(2√3)asinxcosx+b
=-a(1-2sinx^2)-2√3asinxcosx+b+a
=-acos2x-a√3sin2x+a+b
=-2a(0.5cos2x+0.5√3sin2x)+a+b
=-2asin(2x+π/6)+a+b
定义域为[0,π/2],
2x+π/6范围为[π/6,7π/6]
所以最小值为-2a+a+b=b-a=-5
最大值为-2asin(π+π/6)+a+b=2a+b=4
a=3,b=-2