93/209
\begin{frame}
  \frametitle{Maximum and Minimum Values}

  \begin{block}{Fermat's Theorem}
    If $f$ has a local maximum or minimum at $c$ and $f'(c)$ exists, \\
    then $f'(c) = 0$.
  \end{block}
  \pause\medskip

  \begin{center}
  \scalebox{.8}{
  \begin{tikzpicture}[default,baseline=1cm]
    \diagram{-2}{5}{-2}{3}{1}
    \diagramannotatey{-1,1,2}
    \diagramannotatex{-1,1,2,3,4}
    \diagramannotatez
    \begin{scope}[cgreen,ultra thick]
      \draw plot[smooth,domain=-1:4,samples=200] function{(3*x**4 - 16*x**3 + 18*x**2)/15};
    \end{scope}
    \begin{scope}[very thick]
    \node[cgreen,include] (a) at (0,0) {};
    \draw[cred] ($(a)+(-1cm,0)$) -- ($(a)+(1cm,0)$);
    \node[cgreen,include] (a) at (1,5/15) {};
    \draw[cred] ($(a)+(-1cm,0)$) -- ($(a)+(1cm,0)$);
    \node[cgreen,include] (a) at (3,-27/15) {};
    \draw[cred] ($(a)+(-1cm,0)$) -- ($(a)+(1cm,0)$);
    \end{scope}
  \end{tikzpicture}
  }
  \end{center}
  \pause\medskip
  
  At every \emph{local} maximum or minimum, the tangent is horizontal.\\
  (if the derivative exists)
  \vspace{10cm}
\end{frame}