Range of values of $k$ for which $\frac{x-2}{x^2-5x+k}$ is unrestricted Given that $$ f(x) = \frac{x-2}{x^2-5x+k}$$ and that $x$ is real, find: the range of values of $k$ such that the range of $f(x)$ is $\mathbb{R}$.
I attempted this question, by aiming to produce a sketch. Sketching the graph in it's current form doesn't seem very feasible. Therefore, I flipped the function. Examining $\frac{1}{f(x)}$. The reason for that is producing a sketch of a function is usually simple if you can sketch the reciprocal.
$$ \frac{1}{f(x)} = \frac{x^2-5x+k}{x-2} = (x-3)+\frac{k-6}{x-2} $$
From here, I noted that when $k = 6$, $\frac{1}{f(x)} = x-3$. Hence $f(x) = \frac{1}{x-3}$. Clearly in this case $f(x)$ is unrestricted.
However, I had trouble examining the cases of when $k > 6$ and when $k < 6$. I don't know how to produce sketches for those cases or an alternative way to go about solving for those cases. Would appreciate some guidance.
 A: First, let's handle a special case, when $k=6$, the denominator vanishes at $x=2$, $f$ can't take value $0$. We clearly have the condition that  $k \ne 6$.
For $r$ to be attainable, we need $x$ such that
$$\frac{x-2}{x^2-5x+k} = r$$
$$x-2=rx^2-5rx+kr$$
$$rx^2-(5r+1)x+kr+2=0$$
Hence using discriminant, we would want $$(5r+1)^2-4r(kr+2) \ge 0$$
That is we would want to pick $k$ such that the inequality holds for all $r$.
$$(25-4k)r^2+2r+1 \ge 0$$
For this to hold for all $r$, we need $25-4k > 0$ (for convexity) and $4-4(25-4k) \le 0$ (discriminant).
That is $k < \frac{25}4$ and $1 \le 25-4k$. Along with $k \ne 6$, we conclude that $k < 6$.
A: If you know how to analyse the behaviour of the graph of a rational function near roots and vertical asymptotes, you can use this to your advantage. First, note that $2$ is a single root of the function whenever $x - 2$ is not a factor of the denominator (i.e. whenever $k \neq 6$). Further, whenever the denominator has two distinct real roots, there are two vertical asymptotes. If $(2, 0)$ is between them, since $2$ is a single root, the function is positive on one side of $x = 2$ and negative on the other, and since there are vertical asymptotes on each side, you get a range of $\mathbb R$. There are still more cases left, but see if that can't get you started.
