Example 8 Find the range of the function $f(x)=2 x+\sqrt{1+x-x^{2}}$.

Translate the above text into English, please retain the original text's line breaks and format, and output the translation result directly.
Solution: Since $f(x)=2 x+\sqrt{1+x-x^{2}}=2 x+\sqrt{\frac{5}{4}-\left(x-\frac{1}{2}\right)^{2}}$, we can let $x-\frac{1}{2}=\frac{\sqrt{5}}{2} \sin \theta, \theta \in\left[-\frac{\pi}{2}, \frac{\pi}{2}\right]$, then $x=\frac{1}{2}+\frac{\sqrt{5}}{2} \sin \theta$. Thus, $f(x)=g(\theta)=1+\sqrt{5} \sin \theta+\frac{\sqrt{5}}{2} \cos \theta=1+\frac{5}{2} \sin (\theta+\varphi)$, where $\varphi=\arcsin \frac{1}{\sqrt{5}}$. Since $-\frac{\pi}{2} \leqslant \theta \leqslant \frac{\pi}{2}$, we know $\arcsin \frac{1}{\sqrt{5}}-\frac{\pi}{2} \leqslant \theta+\varphi \leqslant \frac{\pi}{2}+\arcsin \frac{1}{\sqrt{5}}$, thus $-\frac{2}{\sqrt{5}} \leqslant \sin (\theta+\varphi) \leqslant 1$, which means $1-\sqrt{5} \leqslant g(\theta) \leqslant \frac{7}{2}$. Therefore, the range of $f(x)=2 x+\sqrt{1+x}-x^{2}$ is $\left[1-\sqrt{5}, \frac{7}{2}\right]$.
Note: For the conic irrational function $f(x)=m x+n+\sqrt{a x^{2}+b x+c} \quad\left(a^{2}+b^{2} \neq 0\right)$, the range can be found using substitution or trigonometric substitution.
(I) When $a=0$ (parabolic type), $f(x)=m x+n+\sqrt{b x+c}$, let $\sqrt{b x+c}=t$, then $f(x)=g(t)=\frac{m}{b} t^{2}+t+\left(n-\frac{m c}{b}\right)$. Then use the knowledge of linear functions $(m=0$  when $)$ or quadratic functions $(m \neq 0$  when $)$ to find the result.
(II) When $a<0$, let $x=-\frac{b}{2 a}-\frac{\sqrt{b^{2}-4 a c}}{2 b} \sin \theta, \theta \in\left[-\frac{\pi}{2}, \frac{\pi}{2}\right]$, then $f(x)=g(\theta)=-\frac{m \sqrt{b^{2}-4 a c}}{2 a} \sin \theta-\frac{\sqrt{-a} \cdot \sqrt{b^{2}-4 a c}}{2 a} \cos \theta+\left(n-\frac{m b}{2 a}\right)$, then use $a \sin \theta+b \cos \theta=\sqrt{a^{2}+b^{2}} \cdot \sin (\theta+\varphi)$ to find the result.
(III) When $a>0$ (hyperbolic type, as in Example 7),
(i) When $b^{2}-4 a c<0$, then let $x=-\frac{b}{2 a}+\frac{\sqrt{b^{2}-4 a c}}{2 a} \sec \theta, \theta \in\left(-\frac{\pi}{2}, \frac{\pi}{2}\right)$, we have $f(x)=g(\theta)=\frac{m \sqrt{b^{2}-4 a c}}{2 a} \sec \theta+\frac{\sqrt{a} \cdot \sqrt{b^{2}-4 a c}}{2 a} \tan \theta+\left(n-\frac{b m}{2 a}\right)$, and then use trigonometric knowledge to solve.