f(x)=4msinx-cos2x
=4msinx-1+2sin^2x
=2(sin^2x+2msinx)-1
=2[(sinx+m)^2]-1-2m^2
∵x∈R
∴-1≤sinx≤1
∴当m≤-1或1/2<m≤1时,
f(x)max=g(1)=2[(1+m)^2]-1-2m^2=3
4m-1+2=3
∴m=1/2
∵m≤-1或1/2<m≤1
∴m≠1/2
当m≥1或-1≤m<1/2时,
f(x)max=g(-1)=2[(-1+m)^2]-1-2m=3
-4m-1+2=3
-4m=2
∴m=-1/2
当m=1/2时,
f(x)max=g(1)=g(-1)=3
∴m=0,1/2,-1/2
∵m=1/2,
∴m不能同时取0,1/2,-1/2
综合:m=-1/2