Continuity and derivability of a piece wise f unction Let $f(x)=x^3-9x^2+15x+6$ and 
$$g(x)=
\begin{cases} 
      \min f(t) &\mbox{if } 0\leq t \leq x, 0 \leq x \leq6 \\
      x-18 &\mbox{if }x\geq 6. \\ 
\end{cases}
$$
Then discuss the continuity and derivability of $g(x)$. 
Could someone explain be how to deal with $\min f(t)$ where  $0\leq t \leq x, 0 \leq x \leq6$.
 A: To look for the minima of $f(x)$, differentiate it:
$$f'(x)=3x^2-18x+15=3(x-1)(x-5)$$
We see that $f'$ is negative at $(1,5)$, so the only local minimum is at $x=5$ and $f(5)=-19$.
We see also that $f(0)=6$ and this value is reached again at
$$x=\frac{9\pm\sqrt{21}}2$$
Then:


*

*$g(x)=6$ for $x\in[0,\frac{9-\sqrt{21}}2]$

*$g(x)=f(x)$ for $x\in[\frac{9-\sqrt{21}}2,5]$

*$g(x)=-19$ for $x\in[5,6]$

A: To figure out $\min f(t)$ for $0 \leq t \leq x$, it would help to know when $f(t)$ is decreasing and when it is increasing, so we need to know the derivative. We have:
$$f'(t)=3x^2-18x+15=3(x-5)(x-1)$$
This means $f(t)$ is increasing for $0 < x < 1$, decreasing from $1 < x < 5$ and increasing from $5 < x < 6$.
This means $f(t)$ goes from $f(0)=6$ to $f(1)=13$, so for $x \in [0, 1]$, we have $g(x)=\min f(t)=6$.
Then, we go from $f(1)=13$ to $f(5)=-19$. Somewhere in here, we hit $f(t)=6$ and then keep going down from there. By solving the equation $f(t)=6$ (subtract both sides by $6$, factor $t$ out, use quadratic formula, ignore solutions outside $[1, 5]$), we get $t=\frac{9-\sqrt{21}}{2}$. Thus, for $1 \leq x \leq \frac{9-\sqrt{21}}{2}$, we have that $g(x)=\min f(t)=6$.
Then once we hit $t=\frac{9-\sqrt{21}}{2}$, $f(x)$ goes below $6$ and keeps decreasing, so for $\frac{9-\sqrt{21}}{2} \leq x \leq 5$, we have $\min f(t)=f(x)$. At $x=\frac{9-\sqrt{21}}{2}$, $g(x)$ abruptly changes from $g(x)=6$ to $g(x)=f(x)$, so it is not differentiable at this point, even though it is continuous since $f(\frac{9-\sqrt{21}}{2})=6$.
After that, we go from $f(5)=-19$ to $f(6)=-12$. Here, we are all increasing, so the minimum is still $f(5)=-19$, so for $5 \leq x \leq 6$, we have $g(x)=\min f(t)=-19$. At $f(x)=5$, $g(x)$ again abruptly changes, this time from $g(x)=f(x)$ to $g(x)=-19$, so it is not differentiable at this point, even though it is continuous since $f(5)=-19$.
Then, for $x > 6$, we jump from $g(x)=-19$ to $g(x)=x-18=-12$, so the function has a discontinuity at $x=6$, but is continuous everywhere else.
A: Hint. One has
$$
f(x)=x^3-9x^2+15x+6 \implies f'(x)=3x^2-18x+15=3(x-5)(x-1).
$$ Evaluate $f(1)$ and $f(5)$. Can you take it from here?
A: To deal with the minimum, I think you should study the variations (by using the derivation sounds fine) of f in [0, 6]. As you probably noticed, f is a polynomial and the minimum in the definition of is written with large inequalities, which means that the minimum will be reached (a polynomial being continuous, and a continuous function being uniforlmy continuous on a closed interval).
Like so, you will be able to write g with either a constant value or f itself on [0, 6] (and probably both if the minimum in not reached in 0 or 6).
P.S : there shouldn't be "=0" at the end of the definition of f, right ?
