5/46
\begin{frame}
\frametitle{Area Between Curves}

The definite integral can be interpreted as the \emph{net area}, that is:
\begin{minipage}{.6\textwidth}
\begin{center}
\scalebox{.9}{
\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}
\end{minipage}
\begin{minipage}{.39\textwidth}
\begin{talign}
\int_a^b f(x)dx\\
\end{talign}
\end{minipage}
\pause

What if we want the area between the curve and the $x$-axis?
\begin{minipage}{.6\textwidth}
\begin{center}
\scalebox{.9}{
\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=cgreen,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});
\mpause[2]{
\draw[cred,dashed] plot[smooth,domain=2:4,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=1.8] at (3,-.5) {+};
\end{scope}
\end{tikzpicture}
}
\end{center}
\end{minipage}
\begin{minipage}{.39\textwidth}
\pause
\begin{talign}
\int_a^b |f(x)|dx\\
\end{talign}
\end{minipage}

\vspace{10cm}
\end{frame}