\begin{frame}
\frametitle{Area Between Curves}
\begin{alertblock}{}
What if we want the area between the curve and the $x$-axis?
\end{alertblock}\smallskip
\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});
\node[anchor=north] at (.5,0) {$a$};
\node[anchor=north] at (5.5,0) {$b$};
\node[scale=1.8] at (.9,.5) {+};
\node at (.9,.9) {$A_1$};
\node[scale=1.8] at (5.15,.5) {+};
\node at (5.15,.9) {$A_3$};
\node[scale=1.8] at (3,-.6) {+};
\node at (3,-.25) {$A_2$};
\draw[gray] (2,.2) -- node[at end,below,black] {$x_1$} (2,-.2);
\draw[gray] (4,.2) -- node[at end,below,black] {$x_2$} (4,-.2);
\end{scope}
\end{tikzpicture}
}
\end{center}\vspace{-.5ex}
\begin{block}{}
Let $f$ be continuous on $[a,b]$, and let
\begin{itemize}
\item $x_1 < x_2 < \ldots < x_n$ be all $x$-intercepts in $[a,b]$,
\item define $x_0 = a$ \;and $x_{n+1} = b$
\end{itemize}
Then the area between the curve $f$ and the $x$-axis from $a$ to $b$ is
\begin{talign}
A = \int_a^b |f(x)|dx \;=\; \sum_{i=0}^{n}\left|\int_{x_i}^{x_{i+1}} \!\!\!f(x)\,dx\right|
\end{talign}\vspace{-1.5ex}
\end{block}
\vspace{10cm}
\end{frame}