Example 9. Find the range of $y=\frac{4 \sin x+5 \cos x}{\sin x+\cos x+3}$.

Translate the above text into English, please retain the original text's line breaks and format, and output the translation result directly.
Let $X=\cos x, Y=\sin x$. Then we have $y=\frac{4 Y+5 X}{Y+X+3}$, which means $(5-y) X+(4-y) Y-3 y=0$,
the line $l:(5-y) X+(4-y) Y-3 y=0$, and the circle $O: x^{2}+y^{2}=1$. By Theorem 1 (2), (3) we know
$$
\begin{array}{l}
\frac{|-3 y|}{\sqrt{(5-y)^{2}+(4-y)^{2}}} \leqslant 1 \text {. That is, } 7 y^{2}+18 y-41 \leqslant 0 . \\
\therefore \frac{-9-4 \sqrt{23}}{7} \leqslant y \leqslant \frac{-9+4 \sqrt{23}}{7} .
\end{array}
$$

The range of the original function is $\left[\frac{-9-4 \sqrt{23}}{7}, \frac{-9+4 \sqrt{23}}{7}\right]$.