Solve $f(x)=\log_3(5+4x-x^2)$
Finding the domain:
$$5+4x-x^2>0$$ $$x^2-4x-5<0$$ $$x^2-5x+x-5<0$$ $$(x-5)(x+1)<0$$ $$x\in (-1,5)$$
For finding the range, I used two methods but both are giving different results.
I$^{st}$ method: Just placing the range in the function
$$f(x)=\log_3(5-(x^2+4-4x-4))$$ $$f(x)=\log_3(5-(x-2)^2+4)$$ $$f(x)=\log_3(9-(x-2)^2)$$ $$f(x)=\log_3(9-((-1,5)-2)^2)$$ $$f(x)=\log_3(9-(-3,3)^2)$$ $$f(x)=\log_3(9-(0,9))$$ $$f(x)=\log_3(0,9)$$ $$f(x)=(-\infty,2)$$
II$^{nd}$ method: Using the formula of range of downward parabola $\left(-\infty,\dfrac{-D}{4a}\right]$
$$f(x)=\log_3((-\infty,9])$$ $$f(x)=\log_3((0,9])$$ $$f(x)=(-\infty,2]$$
Why is it so? Why I am getting different results for different methods. Please help me in this.
You are getting the same result.
For the first function, you should have a closed bracket on the right, since $f(2)$ is indeed $2$.