I'm self-studying and have attempted the following question. I don't have access to a worked solution.
Find $a,b$ for real $x$:
$$f(x) = \frac{x^2-x+a}{x^2-4x+b}\quad when\quad f(x)\le-\frac{7}{2}\space or\space f(x) \ge \frac{1}{2}$$
I however keep getting stuck and find myself always facing division by $0$.
I have a feeling I'm missing some intuition here. I don't think there are operation or arithmetic errors. I am not confident that I have setup the equations correctly either. My questions are:
1) What is the correct approach here / key idea I'm missing?
2) What is the solution?
A sample of my working is as follows:
$$\frac{x^2-x+a}{x^2-4x+b} = -\frac{7}{2}\Rightarrow 9x^2-30x = b - 2a\qquad [1]$$ $$\frac{x^2-x+a}{x^2-4x+b} = \frac{1}{2}\Rightarrow x^2+2x = b-2a \qquad [2]$$ $$[2]-[1]:\qquad 8x^2 - 32x = 0 \Rightarrow x(x-4) = 0\Rightarrow x=0,x=4$$
$x = 0$ leads to $b=0$ which leads to division by $0$ so I discarded it.
Subbing $x=4$ gives:
$$\frac{12 + a}{b} = -\frac{7}{2} \Rightarrow 24 + 2a = -7b \qquad [3]$$ $$\frac{12+1}{b} = \frac{1}{2} \Rightarrow 24 + 2a = b \qquad [4]$$
$[3] + 7[4]$ gives:
$$192 + 16a = 0 \Rightarrow a = -\frac{192}{16} \Rightarrow a = -12$$
Subbing $a=-12$ into $[4] \Rightarrow b = 0$
So for $x=4,a=-12,b=0$ the denominator becomes $0$.
Well, at first, let $$p(x)=x^2-x+a$$ $$q(x)=x^2-4x+b$$ Then, we have: $$f(x)=\frac{p(x)}{q(x)}$$ Also - crucial note here - we see that: $$\lim_{x\to+\infty}f(x)=\lim_{x\to-\infty}f(x)=1$$.
Let us now consider the following cases:
In the first case, $b>4$, we note that, if there exists a $\xi\in\mathbb{R}$ such that $$f(\xi)\leq-\frac{7}{2}$$ then, by Intermediate Values Theorem, since $\lim\limits_{x\to\pm\infty}f(x)=1>0$, there should exist (at least two, but one is enough in our case) $x_0\in\mathbb{R}$ such that $$f(x_0)=0$$ which contradicts with our hypothesis. So, only $f(x)\geq\frac{1}{2}$ can hold in that case.
In the same way, the same result applies to case 2. For the third case we can ensure that such a result holds for every $x\in(-\infty,c)\cup(d,+\infty)$. So, in this case only, $f$ may be lesser that $-\frac{7}{2}$ for every $x\in(c,d)$.
Consider now the inequality $$f(x)=\frac{p(x)}{q(x)}\geq\frac{1}{2}$$ in any case in which it necessarily holds - so, everything from the aforematnioned, apart from $x\in(c,d)$ in case 3. In all these, $q(x)>0$, so the above is equivalent to: $$s(x):=2p(x)-q(x)\geq0\Leftrightarrow x^2+2x+2a-b\geq0\tag{$\star$}$$ Now, back to our cases:
Important note! What is to be highlighted from this question is that the hypothesis in the form: $$f(x)\leq A\mbox{ OR }f(x)\geq B$$ does not mean that, if $A<B$, is a contradiction. It means, instead, that for some $x$ the first inequality is satisfied and for the rest, the second one is satisfied.