\documentclass{amsart}[11pt]
\usepackage{graphicx}

\addtolength{\textwidth}{1.4in}                          
\oddsidemargin=0in                          
\evensidemargin=0in       

\newtheorem{example}{Example} 
\newtheorem{question}[example]{Question}
\newtheorem{definition}[example]{Definition}
\newtheorem{theorem}[example]{Theorem}
\newtheorem{notation}[example]{Notation}
\newtheorem{fact}[example]{Fact}

\begin{document}

\title{Math 242, Lecture 6}
\maketitle

Today we go back and more carefully develop the {\em definite integral}
as a total (or aggregate) amount.  We pay particular attention to how one would
program a computer or calculator to approximate it.  
We do so, even though it may be calculated in some cases by the Fundamental Theorem,
because  
\begin{itemize}
\item The Fundamental Theorem cannot always be applied.    Some functions
such as $e^{x^2}$ do not have anti-derivatives which are easy to describe.  
\item To better understand why the Fundamental Theorem is true, it is important
to understand what the definite integral is on its own - separate from
anti-derivatives.  
\item In most real-world applications, definite integrals are computed using sums
(with the help of computers).  
\end{itemize}

\section{ Riemann sums} 

If we are given an amount by which something changes, we may use
Riemann sums to approximate the total quantity over that period of time.  
We will look again at the formalism around these sums after looking at
a couple of examples.  

\begin{example}
Suppose a ball thrown up in the air has velocity $v(t) = -32t + 100$ feet per second.  
What is its velocity at $3$, $3.1$ and $3.2$ seconds?    Using its velocity at $3.1$
seconds, estimate  how far it travels between $3.1$ and $3.2$ seconds.    Using
approximations at tenths, hundredths and thousandths of a second, estimate how
far it travels between three and four seconds.  
\end{example}

\begin{example}
Suppose the marginal cost for producing CD's at a factory is $\frac{10}{\sqrt{x}}$ cents for the $x$th CD.   Write down sums with four, ten and twenty terms which approximates how much costs
to make 900 CD's.  
 \end{example}
 
In these examples we see how closely related anti-derivates are to these
Riemann sums.  

\begin{definition}
If $f$ is a function over some interval $[a,b]$ then the Riemann sum of $f$
with $n$ terms is defined as
$$ RS_n f|_a^b = \Delta x[ f(x_0) + f(x_1) + \cdots + f(x_n)],$$
where
 $\Delta x = \frac{b-a}{n}$ and $x_i = a + i \Delta x$.  
 If $f$ represents the change in some quantity, the Riemann sum approximates the
 total amount of that quantity.  
\end{definition} 

\begin{example}
Identify the parameters $f$, $a$, $b$, $n$, $\Delta x$ and $x_3$ in each
of the previous examples.  
\end{example}

\begin{example}
Compute the Riemann sum for the function $f(x) = x^2 - 5$ over the interval from
$0$ to $4$ with $n = 8$.
\end{example}

Riemann sums are easy to do with the help of a computer.  

\begin{example}
Use Excel to compute the Riemann sum with everything as in the previous example
but with $n=20$.  
\end{example}


\section{ Areas and Riemann sums}  
 
 We have seen that Riemann sums arise natural when one is trying to compute
 a total displacement from velocity data, total cost from marginal cost data, etc.  
 They first arose arose historically in computing areas under curves,  
 a first step to computing areas of arbitrary shapes.  
 
 \begin{example}
 Use rectangles to approximate the area of the trapezoid which is 
 under the graph of $y = 100-32x$, above the $x$-axis and between the
 lines $x = 3$ and $x = 4$.   Compare this question with the first example
 above.    Use geometry to get an exact answer.  
 \end{example}
 
 As we see in this example, the areas of individual rectangles used to 
 approximate area are exactly the terms which occur in a Riemann sum.   
 This relationship is so natural, we won't muddy the waters by trying to formalize
 it.  We'll just give one more example.  
 
 \begin{example}
 Write down and evaluate a Riemann sum with twenty terms 
 which approximates the area under
 the curve $y = \frac{x}{x^2 + 2}$ between $x = 1$ and $x = 3$.  
 \end{example}
 
 \end{document}

 