Finding range of a function I have the question: 

Find the range of $f$ where $f(x)=7+x-x^2$


The answer I got was $\frac {31}4$ by first rearranging the equation to get $-x^2 + x + 7$ and then using $-\frac b{2a}$ to get the value of $x$.
However, the solutions say that the answer should be $f(x)\leq\frac {29}4$. Where did I go wrong ? 
 A: Let $$f(x)=-x^2+x+7.$$
then
$$f'(x)=-2x+1$$
and
$$f(x)=0 \iff x=\frac{1}{2}$$ with
$$f(\frac{1}{2})=\frac{29}{4}.$$
so
$f $ is increasing in $(-\infty,\frac{1}{2}]$ and decreasing in$[\frac{1}{2},+\infty)$.
on the other hand,
$$\lim_{x \to\pm \infty}f(x)=-\infty$$
hence
$$f(\mathbb R)=(-\infty,\frac{29}{4}].$$
A: $$-x^2+x+7=-\left ( x-\frac{1}{2} \right )^2+\frac{29}{4},\  \mathrm{so \ the \ range \ is}\ (-\infty, \frac{29}{4}] $$
A: 
Concept: There are two main methods for finding the range of a quadratic: Vertex form, or substituting $x=-\frac b{2a}$.


With that in mind, let's tackle $f(x)=-x^2+x+7$.
Vertex Form: The goal of vertex form is to manipulate the quadratic $ax^2+bx+c=0$ into $$a(x-h)^2+k=0$$ with $(h,k)$ being the vertex. So for your problem, we have $$f(x)=-(x^2-x)+7\\=-(x^2-x+\frac 14-\frac 14)+7\\=-\left(x-\frac 12\right)^2+\frac {29}4$$
Since the $a$ value is negative, the parabola opens downward and has a maximum. Thus, the range is $\left(-\infty,\frac {29}4\right]$

Substituting: The $x$ value of the vertex is given by $-\frac b{2a}$ in $ax^2+bx+c=0$. Thus, in your case, we have $-\frac b{2a}=-\frac 1{-2}=\frac 12$. Substituting, we get$$f \left(\frac 12\right)=-\frac 14+\frac 12+7=\frac {29}4$$
And since the parabola opens downward, we get the same answer as $\left(-\infty,\frac {29}4\right]$

In general, substituting $x$ with $-\frac b{2a}$ is easier if you are trying to find the vertex. Vertex form is useful for both graphing and finding the vertex.
A: As a simple thinking $$y=-x^2+x+7\\x^2-x-7+y=0\\ax^2+bx+c=0\\a=1,b=-1,c=-7+y\\ \to \Delta \geq0 \\b^2-4ac \geq0\\1-4(-7+y) \geq 0\\1+28-4y \geq0\\-4y \geq -29\\y \leq\frac{29}{4}$$
