I got answer with Wolfram Alpha. But I do not know how the answer was obtained?

what's method should I use?
I got answer with Wolfram Alpha. But I do not know how the answer was obtained?

what's method should I use?
Hint: suppose $\;a\in\Bbb R\;$ is sucht that
$$\frac{x^2+x+1}{x-4}=a\iff x^2+(1-a)x+(4a+1)=0$$
Thus, $\;a\;$ is in in te range of the function iff the above quadratic has at least one solution, ie.e iff its discriminat is non-negative:
$$\Delta=(1-a)^2-4(4a+1)\ge0\iff a^2-18a-3\ge0$$
In order to factor the last quadraitc in $\;a\;$ we use the roots formula:
$$a_{1,2}=\frac{18\pm\sqrt{336}}2=9\pm 2\sqrt{21}$$
and we get
$$a^2-18a-3=\left(a-(9-2\sqrt{21}\right)\left(a-(9+2\sqrt{21})\right)\ge0\iff$$
$$\iff\begin{cases}a\le9-2\sqrt{21}\\{}\\a\ge9+2\sqrt 21\end{cases}$$
Note that $$y=\frac{x^2+x+1}{x-4}=\frac{(x-4)^2+9(x-4)+21}{x-4}=(x-4)+\frac{21}{x-4}+9$$