\chapter[Rate of change]{Instantaneous Rate Of Change: The Derivative}

Suppose that $y$ is a function of $x$, say $y = f(x)$.
It is often necessary to know how sensitive the value of $y$
is to small changes in $x$ about a fixed value. We can measure this
change as $\frac{\Delta y}{\Delta x}$, where as usual $\Delta x$ denotes
a change in $x$ and $\Delta y$ the corresponding change in $y$.
This ratio is called a {\bf \index{ Difference Quotient} Difference Quotient } for the obvious reason
that it is a quotient of differences.

If we think of a linear function like $y=mx+b$, then it is easy to see 
that the ratio is really independent of our choice of the value of $x$ as well
as the change $\Delta x$; it is simply the slope $m$ of the line. For other 
functions, life is not so easy!

% Example 1
\begin{example}
Take, for example, $y=f(x)=\sqrt{625-x^2}$ (the upper semicircle of radius
25 centered at the origin).  When $x=7$, we find that $y=\sqrt{625-49}=24$.
Suppose we want to know how much $y$ changes when $x$ increases a little,
say to $7.1$ or $7.01$.

\smallskip

Let us look at the ratio $\frac{\Delta y}{\Delta x}$ for our function
$y=f(x)=\sqrt{625-x^2}$ when $x$ changes from 7 to 7.1.  Here $\Delta
x=7.1-7=0.1$ is the change in $x$, and
\begin{align*}
\Delta y &=f(x+\Delta x)-f(x)=f(7.1)-f(7)\\
         &=\sqrt{625-7.1^2}-\sqrt{625-7^2}= 23.9706-24=-0.0294.
\end{align*}
Thus, $\Delta y/\Delta x=-0.0294/0.1=-0.294$.  Geometrically, this means
that the {\bf \index{ chord} chord } of the circle drawn from the point $(7,24)$ to the
point $(7.1,23.9706)$ has {\bf slope} equal to $-0.294$.

\smallskip

In general, if we draw the chord from the point $(7,f(7))$ to a nearby
point on the semicircle $(7+\Delta x,\,f(7+\Delta x))$, the slope of this
chord is the {\bf difference quotient}
\[
\text{\index{ slope~of~chord} slope~of~chord }=\frac{f(7+\Delta x)-f(7)}{\Delta x}=
\frac{\sqrt{625-(7+\Delta x)^2}-24}{\Delta x}.
\]
For example, if $x$ changes only from 7 to 7.01, then the difference
quotient (slope of the chord) is equal to $(23.997081-24)/0.01=-0.2919$.

Note that unlike the line, the difference quotient depends on $x$ as well as
$\Delta x$.

\smallskip

As our second $x$ value $7+\Delta x$ moves in towards 7, the chord
joining $(7,f(7))$ to $(7+\Delta x,f(7+\Delta x))$ shifts slightly. As
can be seen in the picture below, as $\Delta x$ gets smaller and
smaller, the chord joining $(7,24)$ to $(7+\Delta x,f(7+\Delta x))$x
gets closer and closer to the {\bf \index{ tangent line} tangent line } to the circle at the
point $(7,24)$. Recall that the tangent line is the line that just
grazes the circle at that point. In case of the circle, it doesn't meet
the circle at any other point, but this is not likely to happen at more
complicated functions. 

Thus, as $\Delta x$ gets smaller and smaller, the slope $\Delta y/\Delta
x$ of the chord gets closer and closer to the slope of the tangent line.

\vfill

\newpage
%\medskip

%-------------------------------------------

\begin{centering}
\begin{psfigure}{5.5in}{1.9in}{figCA.ps}
\puttext{-100,-50}{$\Delta x = 8$}
\puttext{0,-50}{$\Delta x = 1$}
\puttext{100,-50}{$\Delta x = 0.5$}
\end{psfigure}\\
\end{centering}

%-----------------------------------------
\medskip

The slope of the tangent line to the circle at $(7,24)$ is called the
{\bf \index{ derivative} derivative } of our function $f(x)=\sqrt{625-x^2}$ at 7.  It is
denoted as $f'(7)$ (we say ``$f$ prime of 7,'' or equivalently, ``the derivative of
$f$ at 7'').  The slope of the chord joining $(7,f(7))$ to $(7+\Delta x,
f(7+\Delta x))$, namely, $\Delta y/\Delta x=(f(7+\Delta x)-f(7))/\Delta x$,
gets closer and closer to this value $f'(7)$.  We write
\[
f'(7)=\lim_{\Delta x\longrightarrow 0}\frac{f(7+\Delta x)-f(7)}{\Delta x}
\]
and we say that $f'(7)$ is the {\bf \index{ limiting value} limiting value } or simply the {\bf
\index{ limit} limit } as $\Delta x$ approaches zero of the difference quotient
$(f(7+\Delta x)-f(7))/
\Delta x$.

\smallskip

In the particular case of a circle, there's a simple way to find the
derivative.  Namely, the tangent to a circle at a point is perpendicular to
the radius drawn to the point of contact, and so its slope is the negative
reciprocal of the slope of the radius.  The radius joining $(0,0)$ to
$(7,24)$ has slope 24/7.  Hence, the \index{ tangent line} tangent line has slope
$-7/24=-0.29166\cdots$.  We write: $f'(7)=-0.29166\cdots$.  Notice that
when $\Delta x$ is small, such as 0.01, the slope of the chord joining
$(7,f(7))$ to $(7+\Delta x,f(7+\Delta x))$ is a good approximation to the
value $f'(7)$.  For example, when $\Delta x=0.01$, we saw that this
difference quotient is $-0.2919$, which is close to $f'(7)$.

\smallskip

Now suppose that we choose a different $x$, say $x=15$, and we want to know
how fast $y$ is changing as $x$ increases a little from $15$.  As an
approximation we could take the chord joining $(15,f(15))$ to $(15+\Delta
x,f(15+\Delta x))$ when $\Delta x=0.01$:
\[
\frac{\Delta y}{\Delta x}=\frac{f(15.01)-f(15)}{ 0.01}=\frac{19.992476-20}{ 0.01}=
-0.7504.
\]
The limiting value of this difference quotient as $\Delta x$ becomes
smaller and smaller is what we mean by $f'(15)$.  The value $f'(15)$ is the
slope of the tangent to the circle at the point $(15,20)$.  As before, we
can find this slope exactly, since the tangent to a circle is perpendicular
to the radius.  The answer is $f'(15)=-15/20=-0.75$.  Again we see that, if
$\Delta x$ is small (like 0.01), then the slope of the chord joining
$(x,f(x))$ to $(x+\Delta x,f(x+\Delta x))$ is very close to this value
$f'(x)$ (here $x=15$).

\vfill

\newpage

%-------------------------------------------
\begin{centering}
\begin{psfigure}{\textwidth}{1.5in}{figCB.ps}
\end{psfigure}\\
\end{centering}
%-----------------------------------------

\end{example}


For different $x$ we generally get different values of the derivative
$f'(x)$.  In our example of the circle, we had $f'(7)=-7/24$ and
$f'(15)=-3/4$. 

{\bf Warning:} A geometrical method used in this example for finding
the slope of the tangent line is usually not available for general
functions. In fact, historically, clever methods were developed
for the conic sections; but the concept of defining the tangent line
with an abstract limiting slope took hundreds of years to develop!

The only time $f(x)$ has the same derivative for all
different $x$ is when we have a straight line $y=f(x)=mx+b$.  Then the
difference quotient $\Delta y/\Delta x$ will always be $m$, and the
derivative at any point on the line will also be $m$.  The {\bf tangent line}
to the line $y=mx+b$ is simply the line $y=mx+b$ itself, and this has slope
$m$.  But except for straight lines, a function $y=f(x)$ has different
``slopes'' (of the tangent line) for different $x$.

We wish to calculate the slopes of tangents for several examples. For ease
of notation and calculation, let us replace the change $\Delta x$ by a single
letter $h$. For a function $y=f(x)$, we take two points $(x,y)$ and $(x+h,f(x+h))$
and our difference quotient and the slope of the tangent take the form:
$$ \mbox{Difference~quotient~is~} \frac{f(x+h)-f(x)}{h} ~,~ 
\mbox{~and~the~tangent~has~slope~}
lim_{h\longrightarrow 0} \frac{f(x+h)-f(x)}{h}.$$

Of course, the name of the independent variable $x$ can also change by context, as in the
next example.

% Example 2.
\begin{example}

Suppose we are on an airless planet where the gravitational constant is
$2$ m/sec${}^2$ (the moon has gravitational constant close to this).  Then
it turns out that an object dropped from rest falls through a distance of
exactly $t^2$ meters after $t$ seconds have elapsed.  (Falling body
problems will be taken up more systematically later.)  That is, if $y$
denotes the distance fallen in meters, we have $y=f(t)=t^2$.  Suppose that
we are interested in the moment $t=1$ sec, and we want to know how much the
object falls as $t$ increases from $1$ to $1+h$ seconds.  The distance
fallen in that short time interval is $\Delta y=(1+h)^2-1^2$, which
simplifies to $2h+h^2$.  For example, in the time from 1
sec to 1.01 sec the object falls a distance $\Delta y=0.0201$ m.  The
difference quotient for this $0.01$-sec time interval is $\Delta y/\Delta
t= 0.0201/0.01=2.01$ m/sec.  
It is customary to calle this difference quotient the {\it \index{ average
velocity} average
velocity during the time interval $[1,1.01]$}. In other words, it is the
distance traveled divided by time in this interval.  
More generally, the {\bf average velocity} between $1$ and $1+h$ sec. is
\[ 
\frac{(1+h)^2-1^2}{h}=\frac{1+2h+h^2-1}{h}=
\frac{2h+h^2}{h}=2+h. 
\]

\smallskip

Now the derivative of $y=f(t)=t^2$ at the point $t=1$ is the limiting value
of this difference quotient as $h$ approaches zero:
\[ 
f'(1)=\lim_{h\longrightarrow 0} 2+h=2, 
\] 
because as $h$ gets closer and closer to $0$, the number $2+h$
gets closer and closer to $2$.  In the case of a distance function like our
$f(t)$ (distance fallen), the derivative $f'(1)$ has the practical meaning
of the {\em instantaneous velocity} at time $t=1$.  The {\bf \index{ instantaneous
velocity} instantaneous
velocity } at time $t$ is the limiting value of the average velocity
during a shorter and shorter time interval from $t$ to $t+h$. 

Note that our calculation was independent of the sign of $\Delta t = h$, even
though our wording seems to suggest that $h$ is positive. In reality, we need
to get the same answer regardless of the sign of $h$. Leter, we will discuss what 
happens when it does depend on the sign of $h$.

\smallskip

To understand the distinction between average and instantaneous velocity,
think of a car: the average velocity during a time interval means the
distance traveled divided by time, while the instantaneous velocity at a
particular instant means the speed indicated on the speedometer at that
moment.


The graph below shows distance fallen as a function of time in this
example: $y=t^2$.  The diagram next to it is an enlargement near the point
$t=1$ sec, where $y=1$ meter (i.e., the point (1,1) on the curve).  The
slope of the line joining $(1,1)$ to $(1.1,1.21)$ on the curve $y=t^2$ is
the average velocity of the falling object during the time interval from 1
to 1.1 sec.  The slope of the line which just grazes the \index{ parabola} parabola at the
point $(1,1)$ is the instantaneous velocity of the object at time 1 sec.
Thus, we have two interpretations of the derivative: as the slope of the
tangent line in the graph, or as the instantaneous velocity.

\smallskip
The curve is a parabola and it also has a geometric construction for the tangent.
Let $O$ be the vertex and $l$ the tangent at $O$. At any point $P$ of the
parabola drop a perpendicular from $P$ to $L$ and let $Q$ be the foot of
the perpendicular. Then the tangent at $P$ is the line $PM$ where $M$ is the
midpoint of $OQ$. (See picture). Of course, this is far more complicated than 
the circle. You should try to prove it by using our calculations above.

%%%% To update!
%-------------------------------------------
\begin{center}
\begin{psfigure}{\textwidth}{2.5in}{figCC.ps}
\end{psfigure}\\
\end{center}
%-----------------------------------------

\end{example}


% Example 3
\begin{example}
As a final example, we look at the reciprocal function $y=f(x)=1/x$.
Suppose we want to find the derivative $f'(x)$ when $x=2$.

\smallskip

One way is to approximate.  We can join the point $(2,0.5)$ to the point
$(2+h,1/(2+h))$ for small values of $h$, say 0.1,
0.01, 0.0001, or 0.0000001, and then compute the slope of the chord.  We
get the following table:

\begin{center}
\begin{tabular}{ccccc}
  $x$ & 2 & 2 & 2 & 2\\
 $x+h$ & 2.1&2.01&2.0001&2.0000001\\
 Difference quotient & -0.238095&-0.248756&-0.249988&-0.24999999875
\end{tabular}\\
\end{center}

\noindent
At this point we might guess that the slope of these chords is approaching
$-0.25$, so that the derivative is $-1/4$.  But to be more precise, we
need an algebraic procedure to determine for sure what the limit is.

\smallskip

That is, as in the example $y=t^2$, we write out the difference quotient,
which represents the slope of the chord joining the points
$(2,f(2))$ and $(2+h,f(2+h))$, and then we try to
simplify:
\begin{align}
\frac{f(2+h)-f(2)}{h}&=\frac{1/(2+h)-1/2}{h}=
\frac{2(2+h)}{ 2(2+h)}\cdot\frac{1/(2+h)-1/2}{h}
\notag\\
&=\frac{2-(2+h)}{ 2(2+h)h}
 =\frac{-h}{ 2(2+h)h}=-\frac{1}{ 2(2+h)}.
\notag
\end{align}
As $h$ approaches zero, the denominator $2(2+h)$ approaches
$2\cdot 2=4$, and so we get
\[ 
f'(2)=\lim_{h\longrightarrow 0}\frac{f(2+h)-f(2)}{h}=
\lim_{h\longrightarrow 0}-\frac{1}{ 2(2+h)}=-\frac{1}{ 4}. 
\]
\end{example}


