Intermediate value theorem, $f(x)=-4x^2+12x.$ I have a problem with the Intermediate value theorem. For example if I have the function $(x)=-4x^2+12x$, I can get for example all the values from $x=0$ to $x=2$, so $f(0)=0$ and $f(2)=8$, with the Intermediate value theorem, I know that the function takes all the values from $0$ to $8$. But it also takes the value $9$ when $x$ goes from $0$ to $2$, so with the Intermediate value theorem I can´t know all the value that the function takes.
Can anyone explain me why this happens in this example, and obviously in other example.
 A: The IVT claims that if $f:[a,b] \to \mathbb{R}$ is continuous then $f$ has to take on all value between $f(a)$ and $f(b)$ for at least one $x \in [a,b]$.
In your example, the function achieves a extremum inside the interval, such a situation is not covered by IVT. The IVT has a limited set of assumptions, and knowing values on the boundary with guaranteed continuity is not enough to characterize all values inside that the function will take.
A: According to Wikipedia:

If $f$ is a continuous function whose domain contains the interval
$[a, b]$, then it takes on any given value between $f(a)$ and $f(b)$ at some
point within the interval.

The intermediate value theorem only guarantees, in this case, that all y-values from $0$ to $8$ will have at least $1$ x-value between $0$ and $2$ (given the function is continuous, which is the case). It doesn't guarantee or forbid anything outside the range $[0, 8]$.
A: To explain this, you have to examine
$[E_1]: ~f'(x) = -8x + 12$ and
$[E_2]: ~f''(x) = -8.$
Using $[E_1]$ and $[E_2],$ it is immediate that as
$x$ goes from 0 through 1.5, $f(x)$ is increasing, and
as $x$ goes from 1.5 through 2, $f(x)$ is decreasing.
You have $f(0) = 0, f(1.5) = 9, f(2) = 8.$
Since $x=1.5$ is a critical point, re $f'(1.5) = 0$,
and since $f''(1.5) < 0,$
$f(x)$ has achieves a maximum value at $x=1.5.$
