f(x)=√3cos^2(x+π/2)+(1/2)(sinx-cosx)^2
=(√3/2)[1+cos(2x+π)]+cos^2(x+π/4)
=(√3/2)(1-cos2x)+(1/2)[1+cos(2x+π/2)]
=(√3+1)/2-cos2x-sin2x
=(√3+1)/2-√2sin(π/4+2x)
fmax(x)=(√3+1)/2+√2
f(x)=√3cos^2(x+π/2)+(1/2)(sinx-cosx)^2
=(√3/2)[1+cos(2x+π)]+cos^2(x+π/4)
=(√3/2)(1-cos2x)+(1/2)[1+cos(2x+π/2)]
=(√3+1)/2-cos2x-sin2x
=(√3+1)/2-√2sin(π/4+2x)
fmax(x)=(√3+1)/2+√2