33/111
\begin{frame}
  \frametitle{The Definite Integral}

  \begin{center}
  \scalebox{.7}{
  \begin{tikzpicture}[default]
    \def\mfun{(-.9 + (\x-3+\mfunshift)^2 - .1*(\x-3+\mfunshift)^4)}

    \diagram[1]{-.5}{6}{-1}{1.7}{1}
    \diagramannotatez
    \def\mfunshift{0}
    \begin{scope}[ultra thick]
      \draw[fill=cgreen,draw=none,opacity=.5] plot[smooth,domain=.5:2,samples=100] (\x,{\mfun}) -- (.5,0) -- cycle;
      \draw[fill=cred,draw=none,opacity=.5] plot[smooth,domain=2:4,samples=100] (\x,{\mfun}) -- cycle;
      \draw[fill=cgreen,draw=none,opacity=.5] plot[smooth,domain=4:5.5,samples=100] (\x,{\mfun}) -- (5.5,0) -- cycle;
      \draw[cred] plot[smooth,domain=.5:5.5,samples=100] (\x,{\mfun});
      \node[anchor=north] at (.5,0) {$a$};
      \node[anchor=north] at (5.5,0) {$b$};
      \node[scale=1.8] at (.9,.5) {+};
      \node[scale=1.8] at (5.15,.5) {+};
      \node[scale=3] at (3,-.5) {-};
    \end{scope}
  \end{tikzpicture}
  }
  \end{center}

  \begin{exampleblock}{}
    \begin{minipage}{.6\textwidth}
    Evaluate the integral 
    \begin{talign}
      \int_0^3 (x-1)dx 
    \end{talign}
    by interpreting it in terms of the area.
    \end{minipage}
    \pause
    \begin{minipage}{.39\textwidth}
    \begin{center}
      \scalebox{.9}{
      \begin{tikzpicture}[default]
      \def\diaborderx{.25cm}
      \def\diabordery{.25cm}
      \diagram[1]{-.5}{3.5}{-1}{2}{1}
      \diagramannotatez
      \diagramannotatex{1}
      \diagramannotatey{1}
      
      \begin{scope}[cgreen,ultra thick]
        \draw[cred,ultra thick] plot[smooth,domain=0:3,samples=50] function{(x-1)};
        \mpause[1]{
        \draw[fill=cred,draw=none,opacity=.5] plot[smooth,domain=0:1,samples=50] function{(x-1)} -- (0,0) -- cycle;
        \draw[fill=cgreen,draw=none,opacity=.5] plot[smooth,domain=1:3,samples=50] function{(x-1)} -- (3,0) -- cycle;
        }
      \end{scope}
      \end{tikzpicture}
      }
    \end{center}
    \end{minipage}
    \pause\pause
    
    Thus the integral is:
    \begin{talign}
      \int_0^3 (x-1)dx  = {\color{cgreen}\frac{1}{2}(2\cdot 2)} - {\color{cred}\frac{1}{2}(1\cdot 1)} = 1.5
    \end{talign}
  \end{exampleblock}
\end{frame}