y=cosx-1/2cos2x+1=cosx-1/2(2cos^2x-1)+1=-cos^2x+cosx+3/2=-(cosx-1/2)^2+7/4
∵cosx∈[-1,1] ∴ymax=7/4 ymin=-1/2