The function y = sin ^ 2 x-cosx + 3, X belongs to (2 π / 3, π / 6] and the range is

The function y = sin ^ 2 x-cosx + 3, X belongs to (2 π / 3, π / 6] and the range is

y=1-cos^2(x)-cosx+3
=-cos^2(x)-cosx+4
Let t = cosx, take the range of X and find the range of T
The main reason is that there is something wrong with the scope of X in your question,
If x belongs to [π / 6,2 π / 3], then t belongs to (- 1 / 2, √ 3 / 2)
y=-t^2-t+4
=-(t+1/2)^2+17/4
So the range of Y is ((4 + 2 √ 3) / 4, 17 / 4)