`~rai~`
\(\text{Ta có:}y=\dfrac{\sin x+2\cos x+1}{\sin x+\cos x+2}\\\Leftrightarrow y(\sin x+\cos x+2)=\sin x+2\cos x+1\\\Leftrightarrow y\sin x+y\cos x+2y=\sin x+2\cos x+1\\\Leftrightarrow (y\sin x-\sin x)+(y\cos x-2\cos x)=1-2y\\\Leftrightarrow (y-1)\sin x+(y-2)\cos x=1-2y\\\text{Đây là phương trình dạng }a\sin x+b\cos x=c\\\text{và phương trình có nghiệm khi }a^2+b^2\ge c^2\\\text{hay }(y-1)^2+(y-2)^2\ge (1-2y)^2\\\Leftrightarrow y^2-2y+1+y^2-4y+4\ge 1-4y+4y^2\\\Leftrightarrow 2y^2+2y-4\le 0\\\Leftrightarrow (y+2)(y-1)\le 0\\\Leftrightarrow -2\le y\le 1.\\\text{Vậy Min}_y=-2\text{ và Max}_y=1.\)