Find the integral values of $a$ for which $f(x)$ is onto. 
A function $f:\mathbb R\rightarrow\mathbb R$ is defined by $f(x)=\dfrac{ax^2+6x-8}{a+6x-8x^2}$. Find the integral values of $a$ for which $f$ is onto(surjective).

My attempt:
As given in question co-domain of the function is $\mathbb R$ so range of the function should also be $\mathbb R$ for the function to be surjective. So range of $f(x)\in (-\infty,\infty)$ and this is only true if the denominator of $f(x)$ approaches zero for some $a$ and $x$. 
So I used desmos to see at what values of $a$ and $x$,denominator of $f(x)$ gets zero and I found that at $a$ between $(-1.5,0)$, $f(x)$ gets close to zero and hence $f(x)$ tends to $\pm\infty$
But my answer is wrong, the correct answer is $a\in [2,14]$ for $f(x)\in(-\infty,\infty)$
I don't know how to do this, thanks in advance!
 A: Here is a non-elegant way to do it. You want to find all $a$ such that the equation
$$
ax^2 + 6x - 8 = c(a + 6x - 8x^2)
$$
has a solution for all $c$. That is, you want to find all $a$ such that
$$
(a + 8c)x^2 +(6 - 6c)x + (-8 - ac) = 0
$$
has a solution for all $c$.
This equation has a solution exactly when
$$
[6(1 - c)]^2 + 4(a + 8c)(8 + ac) \geq 0.
$$
That is
$$\begin{align}
36(1 - 2c + c^2) + 4(8a + a^2c + 64c + 8ac^2) \geq 0 \quad &\Rightarrow\\
36 - 72c + 36c^2 + 32a + 4a^2c + 256c + 32ac^2 \geq 0 \quad&\Rightarrow \\
(36 + 32a)c^2 + (4a^2-72 + 256)c + (36 + 32a) \geq 0 \quad 
\end{align}
$$
So, you want to find all $a$ such that the above inequality holds for all $c$.
The only way this can hold for all $c$ is if 
$$
36 - 32a \geq 0 \quad\text{and} \\
(4a^2 + 184)^2 - 4(36 + 32a)(36 + 32a) \leq 0
$$
That is
$$
(4a^2 + 184)^2 - 4(36+32a)^2 \leq 0
$$
The solution to this inequality is exactly $[2, 14]$ (Remember that $36 - 32a$ needed also to be non-negative).
A: We require $ax^2+6x-8=k(a+6x-8x^2)$ to have a real solution $x$ for every real $k$.
$(a+8k)x^2+6(1-k)x-(8+ak)=0$ has a real root iff $9(1-k)^2+(a+8k)(8+ak)\ge0$, and hence iff $(9+8a)k^2+(46+a^2)k+9+8a\ge0$ (*).
$a$ must be such that (*) holds for all $k$. So we must have (1) $9+8a>0$ and (2) $(46+a^2)^2\le 4(9+8a)^2$ or $(a+8)^2(a-2)(a-14)\le0$.
It is easy to see that these conditions are met iff $2\le a\le 14$.
