\chapter{Definite Integrals: Area}

A basic type of problem in calculus is to find the \index{area under a curve} area under a curve.
More precisely, we want to find the area bounded on the top by the graph of
some function $y=f(x)$ with $f(x)\geq 0$, on the bottom by the $x$-axis, on the
left by a vertical line $x=a$, and on the right by another vertical line
$x=b$.  We call this the ``area under $f(x)$ between $a$ and $b$.''  We
also call it the {\bf definite integral} of $f(x)$ from $a$ to $b$. \index{definite integral}

%%%% To update! The whole section is rather loose! Much more theory deserves
%%%% to be included.

\section{Riemann Sums}

To understand the meaning of the definite integral it is instructive to
discuss a method for obtaining an  approximation to the true area
area. This method is called the {\bf Riemann sum approximation}
(more precisely, the {\bf $n$-th left endpoint \index{Riemann sum approximation} Riemann sum approximation},
where $n$ is some integer).  The procedure is: 
\begin{enumerate}
\item 
divide the interval from $a$ to $b$ into a certain number $n$ of equal
\index{subintervals} subintervals, each of length $\Delta x=(b-a)/n$;
\item
draw a vertical line up to the curve at the endpoints of the subintervals;
\item
over each subinterval form a rectangle by going up to the curve at the
left endpoint and drawing a horizontal line to the right from that point on
the curve; 
\item
take the sum of the areas of the $n$ thin rectangles.  
\end{enumerate}

%--- figure RA (Definite integral fig 1)--------------------
%
%
\begin{center}
\begin{psfigure}{5in}{1.75in}{figRA.ps}
\puttext{-90,30}{\Small$y=f(x)$}
\puttext{-130., -35}{\Small$a$}
\puttext{-38., -35}{\Small$b$}
\puttext{38., -35}{\Small$a$}
\puttext{130., -35}{\Small$b$}
\puttext{102., -47}{\Small$\Delta x$}
\puttext{-70., -55}{Area under the curve}
\puttext{70., -55}{5-th left endpoint Riemann sum}
\end{psfigure}\\

\bigskip

\end{center}
%------------------------------

For example, if $n=5$, so that $\Delta x= (b-a)/5$, then the heights of the
5 rectangles are: 
\[
f(a),\quad f(a+\Delta x), \quad f(a+2\Delta x), \quad
f(a+3\Delta x), \text{ and}f(a+4\Delta x)
\]
(see the drawing above).  All of the rectangles
have the same horizontal dimension $\Delta x$.  Hence, the total area,
which is the 5-th left endpoint \index{Riemann sum} Riemann sum, is equal to 
\[
f(a)\,\Delta x + f(a+\Delta x)\,\Delta x + f(a+2\Delta x)\,\Delta x
+f(a+3\Delta x)\,\Delta x+f(a+4\Delta x)\,\Delta x\,.
\]
In general, the $n$-th left endpoint Riemann sum, obtained from the
rectangles formed over $n$ small \index{subintervals} subintervals, is equal to
\[
f(a)\,\Delta x + f(a+\Delta x)\,\Delta x + f(a+2\Delta x)\,\Delta x
+\dots + f(a+(n-1)\Delta x)\,\Delta x\,.
\]
Using the \index{summation symbol} summation symbol $\sum$, we can write this sum more compactly as
follows: 
\[
\text{($n$-th Riemann Sum)} = 
          \sum_{i=0}^{n-1} f\left(a+i\,\Delta x\right)\,\Delta x\,,
\text{ where} \Delta x = \frac{(b-a)}{n} \,.
\]

Here the summation notation tells us to take all integer values of $i$
starting with $i=0$ and ending with $i=n-1$, put each value in place of $i$
in $f(a+i\Delta x)\,\Delta x$, and take the sum.

% Example 1
\begin{example}
Find the  \index{5-th left endpoint Riemann sum} 5-th left endpoint Riemann sum for the definite integral of $x^2$
from 0 to 1, i.e., for the area under the parabola $x^2$ between 0 and 1.

\smallskip

We have $a=0$, $b=1$, $\Delta x=0.2$, and the Riemann sum is
\[
\sum_{i=0}^4(0.2i)^2\cdot0.2=\bigl(0^2+0.2^2
+0.4^2+0.6^2+0.8^2\bigr)\,0.2 =0.24\,.
\]
Later we will see that the actual area is a little larger, namely 1/3.
Notice that rather than multiplying each term by $0.2$ and then summing,
it is faster to factor out the term $0.2$, add the remaining terms and
then multiply by $0.2$. 
\end{example}

In general, if $f(x)$ is an increasing function on the interval $(a,b)$,
then the left endpoint Riemann sum will be a little less than the true area;
but if $f(x)$ is a decreasing function on $(a,b)$, then the left endpoint
Riemann sum will be a little greater than the true area.  

The larger $n$ is, the closer the Riemann sum will be to the true
area.  We say that the area is ``the limit of the Riemann sums as $n$
approaches $\infty$'' and we write it in symbols this way:
\[
      \lim_{n\to \infty} \sum_{i=0}^{n-1} f(a + i \Delta x) \, \Delta x 
\]
In old books, the printed form of the letter ``S'' is ``$\int$'' and
``infinitely small'' values of $\Delta x$ are written $dx$. Thus, a good
symbol for the limit is
\[
        \int_{a}^{b} f(x) \, dx \,. 
\]
This number is called the ``{\bf definite integral} of $f(x)$ from $a$ to
$b$.''  The function $f(x)$ is called the {\bf integrand}, $a$ is called
the  {\bf lower \index{limit of integration} limit of integration}   and $b$ is called the {\bf upper limit
of integration}.  The letter $x$ is called the \index{{\bf variable of
integration}} {\bf variable of
integration}.

\smallskip

In a definite integral it makes no difference what the variable of
integration is called.  In other words, the area under the function
$y=f(z)$ between $z=a$ and $z=b$ means exactly the same thing as the area
under the function $y=f(x)$ between $x=a$ and $x=b$.  That is, both
$\int_a^bf(z)dz$ and $\int_a^bf(x)dx$ are equal to the same thing because
in a definite integral the variable of integration only holds a place, and
does not affect the answer.

In the next section, we will discover that there is a relation between the
\underline{definite} integral and the \underline{\bf in}definite integral
which you studied in the last chapter. 

\section{Computing the Area Under a Curve}

We now describe how to find the exact area under $f(x)$ between $a$ and
$b$.  To do this, we introduce an \index{``area function'' $A(u)$} ``area function'' $A(u)$ as follows: for
any $u$ between $a$ and $b$ we set
\[
     A(u)=\text{area~under~}f(x)~\text{between~}a\text{~and}~u.
\]
If we could find a formula for the function $A(u)$, then we would just
substitute $u=b$ 

\begin{center}
%--- figure RB (Definite integral fig 2)--------------------
%
\begin{psfigure}{3.5in}{2.5in}{figRB.ps}
\puttext{16., 36.}{\Small$y = f(x)$}
\puttext{-48., -40.}{\Small$a$}
\puttext{24., -40.}{\Small$b$}
\puttext{-10., -50.}{\Small$u$}
\put(-9,-46){\vector(1,2){4}}
\puttext{12, -50.}{\Small$u+\Delta u$}
\put(10,-47){\vector(-1,1){10}}
\puttext{-22., 20.}{\Small$A(u+\Delta u) - A(u)$}
\puttext{-28., -24.}{\Small$A(u)$}
\puttext{6., -14.}{\Small $f(u)$}
\put(-14,16){\vector(1,-1){12}}
\end{psfigure}\\
%------------------------------
\medskip

\end{center}

\noindent
in order to obtain the area between $a$ and $b$ that we want.  To find such
a formula, we proceed indirectly.  Instead of asking for $A(u)$ itself, we
ask {\it how much the area function changes} when we go from $u$ to
$u+h$, and then we take the difference quotient $\bigl(A(u+h)-A(u)\bigr)/h$.  By the definition of the area function,
\begin{align*}
A(u+h)-A(u)&=\text{area~under~}f(x)~\text{between~}u
\text{~and}~u+h\cr&\approx\text{area~of~the~rectangle~above~the~interval~}
(u,u+h)~\text{of~height~}f(u)\\
&=h\,f(u).
\end{align*}
This approximate equality between the area under the curve and the area of
the thin rectangle becomes very close to equality when $h$ is small.
Dividing through by $h$, we find that
\[
\frac{A(u+h)-A(u)}{h}\approx f(u),
\]
with the approximate equality becoming an equality in the limit as $h$ goes to $0$.  That is, the limit of the difference quotient --- the
derivative of $A(u)$ --- is equal to $f(u)$:
\[
\frac{dA}{ du}=f(u).
\]
To see what this says, imagine that the area under the curve to the right
of $u$ is covered over by a card.  The \index{derivative of the area function} derivative of the area function
$A(u)$ means the rate at which area is being uncovered as you move the card
to the right.  Clearly this depends on how wide the area is at the edge of
the card --- and this is precisely $f(u)$.

\smallskip

Once we know that $dA/du$ is $f(u)$, this means that $A(u)$ is an
antiderivative of $f(u)$.  So suppose that we find the antiderivative
$\int f(u)du=F(u)+C$, using the methods in the last section.  Our function
$A(u)$ must correspond to a certain value of $C$. Just as before,
we need some initial information to determine this value.
For the area function
$A(u)$ the initial information is: when $u=a$ there is no area, i.e.,
$A(a)=0$.  Thus, $0=A(a)=F(a)+C$, and hence $C=-F(a)$.  We conclude that
$A(u)=F(u)-F(a)$.  This means that the total area under the curve between
$a$ and $b$ is $A(b)=F(b)-F(a)$.  In other words, {\it the area under
$f(x)$ between $a$ and $b$ can be computed by finding an
antiderivative of $f(x)$, substituting $b$ and $a$ in that antiderivative,
and subtracting}.  Using the definite integral notation, we conclude that
\[
   \text{Area~under~}f(x)\text{~between~}a\text{~and~}b
   =\int_a^b f(x)dx =
\left. \phantom{\frac{1}{2}}\kern-3mm F(x) \right|_{a}^{b}
=F(b)-F(a),
\]
where $F(x)$ is an antiderivative of $f(x)$.
Here we used the notation $ \left. \phantom{\frac{1}{2}}\kern-3mm F(x)\right|_{a}^{b}$ to mean ``substitute $b$ and $a$
into $F(x)$ and then subtract.''
\smallskip

{\bf Note:} You can tell whether an integral is a definite integral or an
indefinite integral by whether or not there are limits of integration on
the integral sign.  {\em The answer to a definite integral problem is 
usually a
specific value, not a function with an unknown constant $C$ as in an
indefinite integral problem. However, we will see many definite integrals
with variable limits and these evaluate to functions of the limits, but 
without an arbitrary constant stepping in!}


% Example 2
\begin{example}

Find the area under (a) $y=x^2$ between 0 and 1, and (b) one arch of the
sine curve.

\smallskip

(a) $\int_0^1x^2dx=\frac{1}{ 3}x^3\bigm|_0^1=\frac{1}{ 3}(1^3-0^3)=\frac{1}{ 3}$.

\smallskip

(b) An arch of the sine curve is the region under $y=\sin x$ between $x=0$
and $x=\pi$, so its area is $\int_0^\pi\sin x\,dx=-\cos x\bigm|_0^{\pi}=
-\cos\pi-(-\cos 0)=-(-1)-(-1)=2$.

 
%--- figure RC (Definite integral Example 2)--------------------
%DIA 3 side-by-side diagrams on p. 93.'=
%
\begin{center}
%
\begin{psfigure}{4in}{2.5in}{figRC.ps}
\puttext{-40., 20.}{\Small$y = x^2$}
\puttext{75., 20.}{\Small$y = \sin x$}
\end{psfigure}\\
\end{center}
%------------------------------

\end{example}

% Example 3
\begin{example}
Find the area contained between the curve $y=\sqrt{x}$ and the line $y=x$.

\smallskip
The way to think of the \index{area between two curves} area between two curves is: the area under the top
curve between $a$ and $b$ minus the area under the bottom curve between $a$
and $b$.  Here $a$ and $b$ are the $x$-coordinates of the intersection
points.  In this case the square-root function and the line $y=x$ intersect
at the origin and at the point (1,1).  Between 0 and 1 the top curve is
$\sqrt{x}$.  So the area between them is

\noindent
\[
\int_0^1\sqrt{x}\>dx-\int_0^1x\,dx
= \left. \frac{2}{ 3}x^{3/2}\right|_0^1-\left.\frac{1}{2}x^2 \, \right|_0^1
=\frac{2}{ 3}-\frac{1}{ 2}=\frac{1}{ 6} \,.
\]
\end{example}

\begin{centering}
%--- figure RD (Definite integral Example 3)--------------------
%
\begin{psfigure}{1.95in}{1.9in}{figRD.ps}
\puttext{25., 35.}{\Small$y=x$}
\puttext{37.5, 17.5}{\Small$y = \sqrt{x}$}
\end{psfigure} \\
%------------------------------

\end{centering}


\section{Substitution} 

In integrals evaluated using a $u$-substitution, as before you must change
\index{{\bf EVERYTHING}} {\bf EVERYTHING} from the old variable $x$ (or $t$) to the new variable
$u$.  In the case of a definite integral, ``everything'' includes the
limits of integration.  You get the new limits of integration (the
$u$-limits of integration) by asking the question: ``as $x$ goes from $a$
to $b$ the variable $u$ goes from (what?) to (what?).''  To answer this
question, substitute $a$ in place of $x$ in the formula that gives $u$ in
terms of $x$; this gives the lower $u$-limit of integration.  Then
substitute $b$ in place of $x$ in the same formula to get the upper
$u$-limit of integration.  Here are some examples:

% Example 4
\begin{example}

Find the area under (a) $y=\root 3 \of{7x-6}$ between 1 and 2, and (b)
$y=\sin\left(\frac{\pi x}{ 2}\right)\sqrt{1+\cos\left(\frac{\pi x}{
2}\right)}$ between 0 and 1.

\smallskip

(a) In $\int_1^2\root 3 \of{7x-6}\>dx$ we make the substitution $u=7x-6$,
so that $du=7\,dx$ and $dx=\frac{1}{ 7}du$.  This transforms the integral to
\[
  \int\root 3 \of u\frac{1}{ 7}\,du=\frac{1}{ 7}\int u^{1/3}\,du\,.
\]
What about the
limits of integration?  When $x$ is equal to the lower limit of integration
1, we have $u=7\cdot 1-6=1$; whereas when $x$ is equal to the upper limit
of integration 2, we have $u=7\cdot 2-6=8$.  Thus, our new limits of
integration are 1 and 8.  So the area is 
\[
\frac{1}{
7}\int_1^8u^{1/3}du=  \left.\frac{1}{ 7}\cdot\frac{3}{ 4}u^{4/3}\,\right|_1^8=\frac{3}{
28}\left(8^{4/3}-1^{4/3}\right)=\frac{3}{ 28}(16-1)=\frac{45}{ 28}\,.
\]

\smallskip

(b) If we make the substitution $u=1+\cos\left(\frac{\pi x}{ 2}\right)$, so
that $du=-\frac{\pi}{ 2}\sin\left(\frac{\pi x}{ 2}\right)\,dx$, we see that as
$x$ goes from 0 to 1 the variable $u$ goes from 2 to 1.  We obtain:
\begin{align*}
\int_0^1\sin\left(\frac{\pi x}{ 2}\right)\sqrt{1+
\cos\left(\frac{\pi x}{ 2}\right)}dx
&=\int_2^1\sqrt{u}\left(-\frac{2}{\pi}\right) \,du\\
&= \left. -\frac{2}{\pi}\cdot\frac{2}{ 3}u^{3/2}\,\right|_2^1 \\
&=-\frac{4}{ 3\pi}\left(1-2^{3/2}
\right)=\frac{4}{ 3\pi}(2\sqrt{2}-1)=0.776 \,.
\end{align*}

\end{example}

\bigskip


\section{Some Properties of Definite Integrals}  \

\begin{enumerate}
\item
Like indefinite integrals, they are linear.  This means, for example, that
any constant inside the integral can be pulled outside (as we did in
Example 17.4(a) with the constant 1/7).  Also, if you have the definite
integral from $a$ to $b$ of $f(x)+g(x)$, it makes no difference whether you
work with the sum all at once, or find the definite integral of $f(x)$ and
$g(x)$ separately and then add the results.  (The same observation applies
to $f(x)-g(x)$.)
\item
If $c$ is a number between $a$ and $b$, then the area between $a$ and
$b$ is equal to the sum of the area between $a$ and $c$ and the area
between $c$ and $b$: 
\[
   \int_a^bf(x)\,dx=\int_a^cf(x)\,dx+\int_c^bf(x)\,dx \,.
\]

Actually, when you use the information from the next item below, we can
get that the above formula is valid even when $c$ is not between $a,b$.

\item
If the lower limit of integration is greater than the upper limit, i.e., if
$b$ is on the bottom and $a$ is on the top (so you are traversing the area
under the curve from right to left rather than from left to right), then
the effect is to put in a negative sign.  This is because
$\int_b^af(x)dx=F(a)-F(b)=-(F(b)-F(a))$.  In Example 17.4(b), after making the
$u$-substitution we obtained an integral of the form $\int_2^1$, which was
negative.  (We also had a negative constant in front of the integral, so
that our final answer was positive.)
\item
If the function $f(x)$ is negative, then $\int_a^bf(x)dx$ is negative
(assuming that $b>a$), i.e., area below the $x$-axis is counted as negative
area.  For example, if we compute $\int_0^{2\pi}\sin x\,dx$ (see Example
17.2(b)), we obtain $-\cos x\bigm|_0^{2\pi}=0$ as our answer.  This makes
sense, because $\int_\pi^{2\pi}\sin x\,dx$ is an arch of the sine curve
under the $x$-axis, and so has area $-2$.  By property (2) above, we have
$\int_0^{2\pi}\sin x\,dx=\int_0^\pi\sin x\, dx+\int_\pi^{2\pi}\sin
x\,dx=2+(-2)=0$, i.e., the two equal arches, one above and one below the
$x$-axis, cancel.
\end{enumerate}

\section{Application to Degree-Days}  
\label{sec:17.5}

The concept of ``degree-days'' arises when one wants to estimate heating
costs.  Suppose that in the winter you keep a building heated to a constant
temperature of $65^\circ$F.  Let $f(t)$ be the outside temperature.  Then
{\it the cost of heating the building between time $t=a$ and time $t=b$ is
roughly proportional to the area between the line $y=65$ and the
temperature curve $y=f(t)$ from $t=a$ to $t=b$.} For example, if the
temperature outside has the constant value $f(t)=D$, then the area between
the two lines $y=65$ and $y=D$ is simply $(65-D)(b-a)$ (the units are units
of temperature times time, i.e., degree-days).  In that case all we're
saying is that the heating cost is proportional to the temperature
difference times the time interval.  But when $f(t)$ is not constant we
need to use definite integration to find this area.

% Example 5
\begin{example}

Using the temperature function in Example 8.2 in the section on trig
functions, find the number of degree-days in January in an average year in
Seattle.

%%%% To update! Use other examples?
\smallskip

Our temperature function is $14\sin\left(\frac{2\pi}{ 360}(t-120)\right)+51$.
Subtracting this from 65 and simplifying, we obtain
$65-(14\sin(\cdots)+51)=14\Bigl(1-\sin(\cdots)\Bigr)$.  Our time interval
is 0 to 30 (recall that we supposed that every month has 30 days).  So the
number of degree-days is
\begin{align*}
\int_0^{30}14\left\{1-\sin\left(\frac{2\pi}{ 360}(t-120)\right)\right\}dt
&=
14\left\{t-\left(\frac{360}{ 2\pi}\right)\left(-\cos\left(\frac{2\pi}{ 360}(t-120)
\right)\right)\right\}\Bigm|_0^{30}\\
&=
14\left\{30+\frac{180}{\pi}\left(\cos\left(-\frac{1}{ 2}\pi\right)-
\cos\left(-\frac{2}{ 3}\pi\right)\right)\right\}\\
&=14\left\{30+\frac{180}{\pi}(0-(-0.5))\right\}=821.
\end{align*}

\smallskip

Thus, based on this information, every January we can get a rough idea of
whether to expect high or low heating bills by comparing the total number
of degree-days measured in the particular month with the norm for January,
which is 821.

\end{example}

\section{Velocity and Distance Traveled As Area}

In Chapter 16 we saw that the velocity is the antiderivative of the
acceleration.  Another way to say this is that {\it velocity is the area
under the acceleration graph}.  More precisely, the area under $a(t)$
between $t=t_1$ and $t=t_2$ is equal to the amount the velocity increases
during this time interval.  In mathematical notation:
$$v(t_2)-v(t_1)=\int_{t_1}^{t_2}a(t)dt.$$ The graph at the left
illustrates this in the special case when $a(t)=k$ is a constant function.

\smallskip

In Chapter 16 we also saw that the distance is the antiderivative of
the velocity.  In other words, {\it distance traveled is the area under
the velocity graph}.  More precisely, the area under $v(t)$ between
$t=t_1$ and $t=t_2$ is equal to the distance traveled during this time
interval: $$s(t_2)-s(t_1)=\int_{t_1}^{t_2}v(t)dt.$$ The graph at the right
illustrates this in the special case when $v(t)=kt$.

\begin{centering}
\begin{psfigure}{2.2in}{2in}{figREa.ps}
%\putcrosshair{0,0}
\puttext{-19,-32}{\small$t_1$}
\puttext{35,-32}{\small$t_2$}
\puttext{-55,-8}{\small$k$}
\puttext{5,2}{\small$a(t)=k$}
\puttext{0,-55}{\begin{minipage}{2.2in}
Shaded area is change in velocity during time interval.
\end{minipage}}
\end{psfigure}
\hspace{0.2cm}
\begin{psfigure}{2.2in}{2in}{figREb.ps}
%\putcrosshair{0,0}
\puttext{-23,-35}{\small$t_1$}
\puttext{24,-35}{\small$t_2$}
\puttext{0,5}{\small$v(t)=kt$}
\puttext{0,-55}{\begin{minipage}{2.2in}
Shaded area is distance traveled during time interval.
\end{minipage}}
\end{psfigure}\\

\end{centering}

\vspace{1.5cm}

{\bf Note:} By \index{``distance traveled''} ``distance traveled'' we mean the {\it net} distance.
In other words, the backward distance we travel when the velocity is negative
(represented by area that is {\it beneath} the $t$-axis) counts with
a negative sign, i.e., it cancels some of the positive distance we 
traveled earlier.


