Let sin2x=t, because the range of sin2x is [- 1, 1], so the range of t is [- 1, 1].
So y=7-2t+t? ,t in [- 1, 1]
y=7-2t+t? =(t- 1)? +6
So when t=- 1, the maximum value of the function is 10.
When t= 1, the minimum value of the function is 6.