\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 9}
\maketitle


\section{ Areas between curves}

We can use  Riemann sum analysis to quickly
evaluate areas between two curves.  
Once we break down the area using rectangles (what is
the width and height?),
we are led to the following.  

\begin{theorem}
To find the area between the graph of $f(x)$
and that of $g(x)$ between $x = a$ and $x = b$ 
   we evaluate $\int_a^b | f(x) - g(x) | dx$. \\  
 \end{theorem}
 

\begin{example} 
Find the area of the region between the functions $f(x) = x$ and
$g(x) = x^2$ and the vertical lines at $x = -3$ and $x = -1$.
\end{example}


Sometimes there are no vertical lines supplied; one
must figure out where the curves intersect.  

\begin{example}
Find the total area of the region
between the graphs of $f(x) = x^2 - 2$  and $g(x) = 2 - x^2$.  
\end{example}

In order to account for the absolute value sign, we must
determine where $f(x)$ is larger   (that's where the absolute 
value is set to $f(x) - g(x)$)    and where $g(x)$ is larger
(that's where the absolute value is set to $g(x) - f(x)$).  

\begin{example}
Find the area between the curves $f(x) = \frac{2}{x}$ and $g(x) = x-1$
between $x = 1$ and $x = 3$.  
\end{example}



\section{ Average value of a function}  

We all know how to take the average of a finite collection
of numbers.    To take grade point average, for example, we
add the values for all of our classes taken together and
then divide by the total number of classes we take.   

But what do we do to take the average value of a 
continuously-valued function such as temperature?   
We can of course approximating it by say measuring the temperature
every second and then averaging those values;   and then
every tenth of a second and measuring those values;   and then...  
This seems like a job for calculus,  and given the fact that addition
of values is involved   (and that we're doing integration)   you
might guess that an integral is involved.   
You'd be right.   

We give and illustrate the answer first and then justify it in a few ways.  

\begin{theorem}
The average value of the function $f(x)$ over the interval
from $a$ to $b$ is $$\frac{1}{b-a} \int_a^b f(x) dx.$$  
\end{theorem}

\begin{example}
Find the average value of the function $f(x) = x \sqrt{x^2 + 1}$ between
$0$ and $1$.   Does your answer make intuitive sense?  
\end{example}

Before further examples, we justify the average value theorem.   
We can use the techniques from last lecture.  

We can approximate the average value by taking a large, finite set of values and
averaging them:
$$\frac{f(x_0) + f(x_1) + \cdots + f(x_{N-1})}{N}.$$ 
This looks promising to be a Riemann sum, but it doesn't involve
$\Delta x$.    But remember $\Delta x = \frac{b-a}{N}$, so
$\frac{1}{N} = \frac{\Delta x}{(b-a)}$.  Plugging this in gives us a 
Riemann sum which leads to the theorem.  

We can also argue graphically.    The key observation is that the
average value $A$ is the $y$-value of the horizontal line where
there exactly the same area between $f(x)$ and the line which
lies over the line as that which lies under.    This means that
$\int_a^b [f(x) - A] dx = 0$,   so by the rules for integrals
$\int_a^b f(x) dx - \int_a^b A dx = 0$   or
$\int_a^b f(x) dx = \int_a^b A dx$.  But an anti-derivative for
the constant function $A$ is $F(x) = Ax$,  
for which $F(b) - F(a)    = Ab - Aa   = A(b-a)$.  
So we see $\int_a^b f(x) dx = A(b-a)$,   or dividing
by $b-a$ we get the theorem. 

\begin{example}
Suppose it costs $200 + \frac{x}{2} - \frac{1}{30} x^2$ dollars
to produce $x$ units of some good.   What is the average
cost of producing the first $50$ units?    Of the
second $50$ units?  
\end{example}



\end{document}
 