Lời giải:
$y=\frac{\sin x+\cos x-1}{\cos x+3}$
$\Rightarrow y(\cos x+3)-\sin x-\cos x+1=0$
$\Leftrightarrow -\sin x+(y-1)\cos x=-3y-1$
Áp dụng BĐT Bunhiacopxky:
$(-3y-1)^2=[-\sin x+(y-1)\cos x]^2\leq (\sin ^2x+\cos ^2x)[1+(y-1)^2]$
$\Leftrightarrow (-3y-1)^2\leq 1+(y-1)^2$
$\Leftrightarrow 8y^2+8y-1\leq 0$
$\Leftrightarrow \frac{-2-\sqrt{6}}{4}\leq y\leq \frac{-2+\sqrt{6}}{4}$
Vậy $y_{\max}=\frac{-2+\sqrt{6}}{4}$
$y_{\min}=\frac{-2-\sqrt{6}}{4}$