I am trying to find the range of the function $$ y=\frac{2x^2+2x-4}{x^2+x} $$ analytically using the discriminant trick (there's a somewhat helpful post here about that). Here's what I have so far: \begin{align} y=\frac{2x^2+2x-4}{x^2+x} &\iff yx^2+yx=2x^2+2x-4\\[1em] &\iff x^2(y-2)+x(y-2)+4=0\\[1em] &\iff (y-2)^2-4(y-2)(4)\geq0\tag{$*$}\\[1em] &\iff (y-2)(y-18)\geq0. \end{align} My temptation is to write that the range of the function is $(\infty,2]\cup[18,\infty)$, but the range is actually $(-\infty,2)\cup[18,\infty)$. How can I determine that from my work above?
My thought was I do not have a strict inequality for $(*)$ above because my function can equal $0$. But I am confused as to how I am supposed to know that $2$ is not included in the range. The link posted above mentions how the discriminant will be zero at any max or min $y_0$, but I imagine the discriminant is not $0$ otherwise then? I realize $y=2$ is a horizontal asymptote for my function, but I also know one can easily cross a horizontal asymptote before "settling on it" as $x\to\pm\infty$. Can someone explain how to use my work above to determine the proper range as well as explain what is going on concerning max and min as they relate to the discriminant here? In retrospect, my reasoning for not using a strict inequality in $(*)$ seems flawed--it seems like it has more to do with the presence or absence of a max or min perhaps?