y=7-2sin2x+2(1+cos2x)-(1+cos2x)^2
=7-2sin2x+2+2cos2x-1-2cos2x-cos^2 2x
=7-2sin2x+sin^2 2x
=6+(1-sin2x)^2
y=6,sin2x=1时取最小
所以值域为[6,10]
y=7-2sin2x+2(1+cos2x)-(1+cos2x)^2
=7-2sin2x+2+2cos2x-1-2cos2x-cos^2 2x
=7-2sin2x+sin^2 2x
=6+(1-sin2x)^2
y=6,sin2x=1时取最小
所以值域为[6,10]