I need to find the range of a function:
$$f(x) = \frac{e^{2x} - e^x + 1}{e^{2x} + 3e^x - 7} $$
Substituting $e^x = t $ and equating $f(x)$ to $y$, I get
$$(y-1)t^2 + (3y+1)t - (7y+1) = 0$$
Since $t$ must be real and positive, I get the range of y to be $(-\infty, -\frac{1}{3})\bigcup(1, \infty) $.
Is this correct?
Here is an alternative answer.
Set $f(t) = \frac{t^2-t+1}{t^2+3t-7}$. We want the range of $f$ on $(0,\infty)$. This function has a singularity (vertical asymptote) at $t_0 = \frac{\sqrt{37} - 3}{2}$. Now $$ f'(t) = \frac{4 \left(t^2-4 t+1\right)}{\left(t^2+3 t-7\right)^2}. $$ Then $f'(t) = 0$ for $t_{1,2} = 2 \mp \sqrt{3}$. and therefore $f' > 0$ on $(0,t_1)$, $f' < 0$ on $(t_1,t_0) \cup (t_0,t_2)$ and $f' > 0$ on $(t_2,\infty)$.
It follows that $f((0,\infty)) = (-\infty, f(t_1)] \cup [f(t_2,\infty)$ which is the range given in the previous answer.