\chapter[Area, Distance/Velocity/Acceleration]{Area Between Curves; Distance/Velocity/Acceleration}

%{Area Between Curves; Distance/Velocity/Acceleration;
%Total vs. Net Distance}

\section{Area Between Curves}

Suppose that we are interested in the \index{area enclosed by two curves} area enclosed by two curves
 $y=f_1(x)$ 
and $y=f_2(x)$ between the two vertical lines $x=a$ and $x=b$, then we can
proceed exactly as before. Recall that we first created an area function:

\[
     A(u)=\text{area~caught~between~}y=f_1(x)~\text{and~}y=f_2(x)~\text{between~}x=a\text{~and}~x=u.
\]

As before we can demonstrate the derivative of the function to be 
$|f_1(x)-f_2(x)|$ and as long as this function is continuous, the
\index{Fundamental Theorem of Calculus} Fundamental Theorem of Calculus
 will guarantee that the desired area is
given by
$$A(b) = \int_a^b |f_1(x)-f_2(x)| dx.$$

Note that in our old formulation of area under a curve $y=f(x)$, we did
not have the absolute value sign, but for proper calculations, we had to
make sure that the curve $y=f(x)$ was never below the x-axis or the
curve $y=0$. In other words, we needed $f(x)\geq 0 $ in the desired
interval $[a,b]$. So $f(x)=|f(x)|$ in the interval $[a,b]$ and we did
not need to write the absolute value sign. Similarly, we can omit it
here, if we can ensure that $f_1(x)\geq f_2(x)$ during the interval
$[a,b]$.

On the other hand, we did interpret $\int_a^b f(x) dx$ as an algebraic
area between the curve $y=f(x)$ and the x-axis and it is possible to
make a similar algebraic interpretation of $\int_a^b
\bigl(f_1(x)-f_2(x)\bigr) dx$ as well.


To work out concrete problems, it is better to remember the area formula
in words as follows:

{\bf The area enclosed between $y=f_1(x)$ and $y=f_2(x)$ above the
interval $x=a$ to $x=b$ is computed by integrating from $a$ to $b$ the
expression $l(x)dx$. The expression $l(x)$ is the length of a typical
vertical section of the area at $x$.}
 
Typically, $l(x)=f_1(x)-f_2(x)$ provided you have
$f(1)\geq f_2(x)$ during the interval $[a,b]$.

If only the two functions $f_1(x)$ and $f_2(x)$ are given, then the
values of $a,b$ will be the x-coordinates of common points of the
two curves $y=f_1(x)$ and $y=f_2(x)$.

As before some shapes can best be integrated by considering exchanging the
roles of $x,y$. In other words by letting $x=g_1(y)$ be the curve on the right and $x=g_2(y)$ the curve
on the left, and computing Area$=\int_c^dg_1(y)dy-\int_c^dg_2(y)dy$, where
$c$ and $d$ are the $y$-coordinates of the intersection points.


\begin{center}
%--- figure: AA --------------------
%
\begin{psfigure}{2in}{2in}{figAA.ps}
%\putcrosshair{0,0}
\puttext{-5, 30}{\small$y = f_{1}(x)$}
\puttext{-5, -8}{\small$y = f_{2}(x)$}
\puttext{-23, -27.}{\small$a$}
\puttext{14, -27.}{\small$b$}
\puttext{0, -56.8}{Area$=\int_a^b(f_1(x)-f_2(x))dx$}
\end{psfigure}
%------------------------------
\hspace{1in}
%--- figure: AB --------------------
%
\begin{psfigure}{2in}{2in}{figAB.ps}
%\putcrosshair{0,0}
\puttext{26, -13.6}{\small$x = g_{1}(y)$}
\puttext{-8, 13.6}{\small$x = g_{2}(y)$}
\puttext{-28, -20}{\small$c$}
\puttext{-28, 20}{\small$d$}
\puttext{0, -56.8}{Area$=\int_c^d(g_1(y)-g_2(y))dy$}
\end{psfigure}\\
%------------------------------
\end{center}

\bigskip
\begin{example}
%{\bf Example 1.} 
Find the area in the first quadrant between the unit
circle and the \index{parabola} parabola
 $y=1-x^2$.

\smallskip

By sketching a graph of the two curves, we can see that they intersect at
(0,1) and (1,0).  Alternatively, we can find the points of intersection
algebraically by setting the two functions equal: $1-x^2=
\sqrt{1-x^2}$.  Squaring both sides and moving everything to the right
of the equality gives $0=x^2-x^4=x^2(1-x^2)$, so that $x=0,\pm 1$ (we
ignore $x=-1$, since that is not in the first quadrant).  This gives 
\begin{rightindent}{3.5truein}
\noindent
us the two points.  Which is the top curve?  The simplest way to answer
this is to take an intermediate point, say $x=0.5$: the $y$-coordinate of
the corresponding point on the circle is $0.866$, while the $y$-coordinate
of the point of the parabola is $0.75$; thus, the circle is the top curve.
Finally, the area we want is:
 
\end{rightindent}
\hfill
%-figure AC -----------------------------
\begin{psfigure}{2in}{1.25in}{figAC.ps}
%\putcrosshair{-1,-1}
\end{psfigure}
%------------------------------

\begin{align*}
\text{area~under~circle~}&-\text{~area~under~parabola}\\
=\pi/4 &-\int_0^1(1-x^2)\,dx \\
=(\pi/4)&-(2/3)=0.11873.
\end{align*}

Another way to make sure that you have the right formula is as follows. 
We have determined the limits of integration to be $0,1$ already. For any
typical $x$-value in between, the circle has the point $(x,\sqrt{1-x^2})$ and 
the parabola has the point $(x,x^2)$. The desired length function is
the $|\sqrt{1-x^2}-x^2|$. How do we know that the expression inside the $|\,|$ is already nonnegative? As above, we can check it at some value like
$x=0.5$ and see that it is positive. To finish the argument, we need to know that it stays nonnegative in $[0,1]$. But if it did become negative somewhere 
during this interval, then it will become $0$ during the interval also.
{\it What Theorem are we using?} But such a value of $x$ must be the 
x-coordinate of a common point of the circle and the parabola {\it Why?}. Hence
we are done! 

{\bf What is the purpose of such abstract and complicated arguments, when 
we can just ``see'' which curve is above and which is below? The idea is 
to double check the sketching for messy curves and to possibly
bypass the sketching altogether when it might be too complicated.}

Note that we did not use the full formula:
$$\int_0^1 |\sqrt{1-x^2}-x^2| dx = \int_0^1  \bigl (\sqrt{1-x^2}-x^2 \bigr ) dx = \int_0^1 \sqrt{1-x^2}dx - \int_0^1 x^2 dx$$
in our calculations. We short-circuited the first difficult integral by 
interpreting it as the area of a quarter circle! You should use such
\index{shortcuts} shortcuts
 whenever possible!


\end{example}

\begin{example}
%{\bf Example 2.} 
Find the area in the first quadrant bounded by $2x+y=2$
and $y=\sin(\pi x)$.

\smallskip

\begin{rightindent}{3.5truein}
 
Here one cannot find the intersection points algebraically by solving the
equation $2-2x=\sin(\pi x)$.  However, if we graph both $y=2-2x$ and
$y=\sin(\pi x)$ carefully, we see that they both cross the $x$-axis at
(1,0) and they have another point of intersection at (0.5,1).  Since the
sine curve is above the line joining these two points, it follows that the
area we want is 
\begin{align*}
\int_{0.5}^1\sin(\pi x)dx&-\int_{0.5}^1(2-2x)\,dx=\\
&-(1/\pi)\cos(\pi x)|_{0.5}^1-(2x-x^2)|_{0.5}^1\\
&=(1/\pi)-0.25=0.0683.
\end{align*}
\end{rightindent}
\hfill
%-figure AD -----------------------------
\begin{psfigure}{2in}{2.0in}{figAD.ps}
%\putcrosshair{-1,-1}
\end{psfigure}
%------------------------------

As above, let us give indirect arguments to verify our work. We have somehow
guessed the limits to be $0.5,1$ as above and we need to show that
$l(x)=\sin(\pi x)-( 2 - 2x )\geq 0 $ on the interval $[0.5,1]$. Note that
$h(0.5) = h(1)=0$. We claim that $h(x)$ does not have another root
in $[0.5,1]$. This will give us what we want. ({\bf Why?}).

Suppose, if possible, $h(c)=0$ for some $0.5<c<1$.
Then $h'(x)$ must have at least two roots in $[0.5,1]$; at least one in
$(0.5,c)$ and at least one in $(c,1)$ ({\bf Why?}). We show that this is not
possible! This will finish our claim.

The derivative $h'(x) = \pi \cos(\pi x) +2$ and its derivative $h''(x) = -\pi^2 \sin(\pi x)$. Clearly $h''(x) <0$ on the  
interval $[0.5,1]$ ({\it Why?}) and so $h'(x)$ steadily decreases from $h'(0.5)=2$ to $h'(1)=2-\pi <0$. Hence, $h'(x)$ can have exactly one
root in $[0.5,1]$.

Notice how knowledge of higher derivatives of a function yields useful
information about the function itself. This technique is often used.
  
\end{example}


\section{Distance/Velocity/Acceleration}

We next recall a general principle that will later be applied to
distance-velocity-acceleration problems, among other things.  If $F(u)$ is
an anti-derivative of $f(u)$, then $\int_a^bf(u)\,du=F(b)-F(a)$.  Suppose
that we want to let the upper limit of integration vary, i.e., we replace
$b$ by some variable $x$.  We think of $a$ as a fixed starting value $x_0$.
In this new notation the last equation (after adding $F(a)$ to both sides)
becomes: 
\[
F(x)=F(x_0)+\int_{x_0}^xf(u)\,du.
\] 
(Here $u$ is the variable of
integration, called a ``dummy variable,'' since it is not the variable in
the function $F(x)$.  In general, it is not a good idea to use the same
letter as a variable of integration and as a limit of integration.  That
is, $\int_{x_0}^xf(x)dx$ is \index{bad notation} bad notation
, and can lead to errors and
confusion.)

\smallskip

An important application of this principle occurs when we are interested in
the distance an object travels (say, along the $x$-axis) between time $t_0$
and time $t$.  Let $s(t)$ denote the position of the object at time $t$ (its
distance from a reference point, such as the origin on the $x$-axis).  Then
the displacement of the object during the interval is $s(t)-s(t_0)$. 
If the object moves in a single direction along a line, then
the displacement is equal to the distance traveled.

 

Since $s(t)$ is an anti-derivative
of the velocity function $v(t)$, we can write 
\[
s(t)-s(t_0)=\int_{t_0}^tv(u)du.
\]
Similarly, since the velocity is an anti-derivative of the acceleration
function $a(t)$, we have 
\[
v(t)=v(t_0)+\int_{t_0}^ta(u)du.
\]

As an example, let us take the case when an object is acted upon by a constant
force $F$.  By Newton's laws of motion, the acceleration is the constant
$F/m$, where $m$ is the mass.  Then we first have
\[
v(t)=v(t_0)+\int_{t_0}^tF/m\,du=v_0+(F/m)u|_{t_0}^t=v_0+\frac{F}{m}(t-t_0);
\]
and then we have
\begin{align*}
s(t)&=s(t_0)+\int_{t_0}^t\left(v_0+\frac{F}{m}(u-t_0)\right)du=s_0+
(v_0u+\frac{F}{2m}(u-t_0)^2)|_{t_0}^t\\
    &=s_0+v_0(t-t_0)+\frac{F}{2m}(t-t_0)^2.
\end{align*}
For instance, when $F/m=-g$ is the constant of gravitational acceleration,
then this is the falling body formula (where we neglect air resistance).

\section{Total vs.~Net Distance}

The integral of the velocity function gives the displacement or
the {\bf net} distance
traveled.  This is because the integral of negative velocity (area
underneath the $t$-axis) counts negatively.  If you want to know the {\bf
total} distance traveled, you must integrate the $|v(t)|$ or the speed
function. To do this, the best method is to find out where the velocity 
function crosses the $t$-axis, integrate separately over the time 
intervals when
$v(t)$ is positive and when $v(t)$ is negative, and add up the absolute
values of the different integrals.  For example, if an object is thrown
straight upward at $19.6$ m/sec, its velocity function is $v(t)=-9.8t+19.6$.
This is a straight line which is positive for $t<2$ and negative for $t>2$.
The net distance traveled in the first 4 seconds is
$\int_0^4(-9.8t+19.6)dt=0$, while the total distance traveled in the first
4 seconds is
$\int_0^2(-9.8t+19.6)dt+\Bigl|\int_2^4(-9.8t+19.6)dt\Bigr|=39.2$ meters
(i.e., $19.6$ meters up and $19.6$ meters down).


\begin{example}
%{\bf Example 3.} 
The acceleration of an object is given by 
$a(t)=\cos(\pi t)$, and its velocity at time $t=0$ is $1/2\pi$.  Find the displacement (net distance) as well as the total distance traveled in the 
first $1.5$ sec.

\smallskip
We compute 
\[
  v(t)=v(0)+\int_0^t\cos(\pi u)du=\frac{1}{2\pi}+\frac{1}{\pi}\sin(
\pi u)|_0^t=\frac{1}{\pi}\bigl(0.5+\sin(\pi t)\bigr).
\]
The \index{{\it net} distance traveled} {\it net} distance traveled
 is then
\begin{align*}
s(1.5)-s(0)=&\int_0^{1.5}\left(\frac{1}{\pi}(0.5+\sin(\pi t)\right)\,dt\\
=&
\frac{1}{\pi}\left(0.5t-\frac{1}{\pi}\cos(\pi t)\right)\Bigm|_0^{1.5}=
\frac{0.75}{\pi}+\frac{1}{\pi^2}=0.340.
\end{align*}
To find the \index{{\it total} distance traveled} {\it total} distance traveled
, we ask when $(0.5+\sin(\pi t))$
is zero, and when it is positive and negative.  This function is $0$ when
$\sin(\pi t)$ is $-0.5$, i.e., when $\pi t=7\pi/6$, $11\pi/6$, etc.  The
value $\pi t=7\pi/6$, i.e., $t=7/6$, is the only value in the range $0\le
t\le 1.5$.  We see that $v(t)>0$ for $t<7/6$ and $v(t)<0$ for $t>7/6$.
Hence, the total distance traveled is
\begin{align*} 
\int_0^{7/6}&\left(\frac{1}{\pi}(0.5+\sin(\pi t)\right)dt+
\Bigl|\int_{7/6}^{1.5} 
\left(\frac{1}{\pi}(0.5+\sin(\pi t)\right)dt\Bigr|\\
=&\frac{1}{\pi}\left( \frac{3.5}{6}-\frac{1}{\pi}\cos(7\pi/6)+\frac{1}{\pi}+\Bigl|0.75-\frac{3.5}{6}
+\frac{1}{\pi}\cos(7\pi/6)\Bigr|
\right)=0.409.
\end{align*}

\end{example}

\bigskip
%
