forked from APEXCalculus/APEXCalculus_Source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02_Derivative.tex
565 lines (494 loc) · 33.6 KB
/
02_Derivative.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
\section{Instantaneous Rates of Change: The Derivative}\label{sec:derivative}
A common amusement park ride lifts riders to a height then allows them to free fall a certain distance before safely stopping them. Suppose such a ride drops riders from a height of 150 feet. Students of physics may recall that the height (in feet) of the riders, $t$ seconds after free fall (and ignoring air resistance, etc.) can be accurately modeled by $f(t) = -16t^2+150$.
Using this formula, it is easy to verify that, without intervention, the riders will hit the ground at $t=2.5\sqrt{1.5} \approx 3.06$ seconds. Suppose the designers of the ride decide to begin slowing the riders' fall after 2 seconds (corresponding to a height of 86 ft.). How fast will the riders be traveling at that time?\bigskip
We have been given a \emph{position} function, but what we want to compute is a velocity at a specific point in time, i.e., we want an \emph{instantaneous velocity}. We do not currently know how to calculate this.
However, we do know from common experience how to calculate an \emph{average velocity}. (If we travel 60 miles in 2 hours, we know we had an average velocity of 30 mph.) We looked at this concept in \autoref{sec:limit_intro} when we introduced the difference quotient. We have
\[\frac{\text{change in distance}}{\text{change in time}} = \frac{\text{``\ rise\ ''}}{\text{run}} = \text{average velocity}.\]
We can approximate the instantaneous velocity at $t=2$ by considering the average velocity over some time period containing $t=2$. If we make the time interval small, we will get a good approximation. (This fact is commonly used. For instance, high speed cameras are used to track fast moving objects. Distances are measured over a fixed number of frames to generate an accurate approximation of the velocity.)
Consider the interval from $t=2$ to $t=3$ (just before the riders hit the ground). On that interval, the average velocity is
\[\frac{f(3)-f(2)}{3-2} = \frac{f(3)-f(2)}{1} =-80\ \text{ft/s},\]
where the minus sign indicates that the riders are moving \emph{down}. By narrowing the interval we consider, we will likely get a better approximation of the instantaneous velocity. On $[2,2.5]$ we have
\[\frac{f(2.5)-f(2)}{2.5-2} = \frac{f(2.5)-f(2)}{0.5} =-72\ \text{ft/s}.\]
We can do this for smaller and smaller intervals of time. For instance, over a time span of 1/10$^\text{th}$ of a second, i.e., on $[2,2.1]$, we have
\[\frac{f(2.1)-f(2)}{2.1-2} = \frac{f(2.1)-f(2)}{0.1} =-65.6\ \text{ft/s}.\]
Over a time span of 1/100$^\text{th}$ of a second, on $[2,2.01]$, the average velocity is
\[\frac{f(2.01)-f(2)}{2.01-2} = \frac{f(2.01)-f(2)}{0.01} =-64.16\ \text{ft/s}.\]
What we are really computing is the average velocity on the interval $[2,2+h]$ for small values of $h$. That is, we are computing
\[\frac{f(2+h) - f(2)}{h}\]
where $h$ is the change in time after $2$ seconds.
What we really want is for $h=0$, but this, of course, returns the familiar ``$0/0$'' %\zerooverzero\
indeterminate form. So we employ a limit, as we did in \autoref{sec:limit_intro}.
\mtable{Approximating the instantaneous velocity with average velocities over a small time period $h$.}{table:falling}%
{\noindent\begin{tabular}{lc}
$h$ & \parbox[b]{75pt}{\centering Average Velocity\\ft/s}\\ \midrule
$1$ & \makebox[3em][l]{$-80$} \\
$0.5$ & \makebox[3em][l]{$-72$} \\
$0.1$ & \makebox[3em][l]{$-65.6$} \\
$0.01$ & \makebox[3em][l]{$-64.16$} \\
$0.001$ & \makebox[3em][l]{$-64.016$}
\end{tabular}}
We can approximate the value of this limit numerically with small values of $h$ as seen in \autoref{table:falling}. It looks as though the velocity is approaching $-64$ ft/s. Computing the limit directly gives
\begin{align*}\lim_{h\to 0} \frac{f(2+h)-f(2)}{h}
&= \lim_{h\to 0}\frac{-16(2+h)^2+150 - (-16(2)^2+150)}{h} \\
&= \lim_{h\to 0}\frac{-64h-16h^2}{h} \\
&= \lim_{h\to 0}(-64-16h)\\
&=-64.
\end{align*}
Graphically, we can view the average velocities we computed numerically as the slopes of secant lines on the graph of $f$ going through the points $(2,f(2))$ and $(2+h,f(2+h))$, as in \autoref{fig:diff_quotient}.
%
\mtable{Computing the difference quotient.}{fig:diff_quotient}{\begin{tikzpicture}
\begin{axis}[tick label style={font=\scriptsize},minor x tick num=1,
axis y line=middle,axis x line=middle,ymin=-50,ymax=160,xmin=-.5,xmax=3.49,
name=myplot, extra x ticks={2.4}, extra x tick labels={\begin{tabular}{c}$\uparrow$\\$2+h$\end{tabular}},width=\marginparwidth]
\addplot [draw={\colorone},domain=0:3.5,thick] {150-16*x*x};
\addplot [draw={\colortwo},domain=1:3.5,thick] {(90.75-28.16*x)/.4};
\draw[draw={\colorthree}] (axis cs:2,0)--(axis cs:2,86);
\draw[draw={\colorthree}] (axis cs:2.4,0)--(axis cs:2.4,57.84);
\draw[gray] (axis cs:2,25)--(axis cs:2.4,25) node[pos=0.5, below]{\scriptsize $h$};
\node[label={180:{\scriptsize $(2,f(2))$}},circle,fill,inner sep=1pt] at (axis cs:2,86) {};
\node[label={180:{\scriptsize $(2+h,f(2+h))$}},circle,fill,inner sep=1pt] at (axis cs:2.4,57.84) {};
%\node[label={90:{\begin{tabular}{c}\scriptsize $(2+h,f(2+h))$\\$\Big\downarrow$\end{tabular}}},circle,fill,inner sep=1pt] at (axis cs:2.4,57.84) {};
%\node[label={270:{\scriptsize $2+h$}},circle,fill,inner sep=0pt] at (axis cs:2.4,0) {};
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}}
%
In \autoref{fig:derivfalling}, the secant line corresponding to $h=1$ is shown in three contexts. \autoref{fig:derivfalling}(a) shows a ``zoomed out'' version of $f$ with its secant line. In (b), we zoom in around the points of intersection between $f$ and the secant line. Notice how well this secant line approximates $f$ between those two points --- it is a common practice to approximate functions with straight lines.
As $h\to 0$, these secant lines approach the \emph{tangent line}, a line that goes through the point $(2,f(2))$ with the special slope of $-64$. In parts (c) and (d) of \autoref{fig:derivfalling}, we zoom in around the point $(2,86)$. In (c) we see the secant line, which approximates $f$ well, but not as well the tangent line shown in (d).
\begin{figure}[!ht]
\begin{tabular}{cc}
\begin{tikzpicture}
\begin{axis}[width=\marginparwidth,tick label style={font=\scriptsize},
minor x tick num=1,axis y line=middle,axis x line=middle,
ymin=-50,ymax=160,xmin=-.5,xmax=3.49,name=myplot]
\addplot[draw={\colorone},smooth,thick,domain=0:3.5]{150-16*x*x};
\addplot [draw={\colortwo},domain=1:3.5,thick] {-80*(x-2)+86};
\filldraw [black] (axis cs:2,86) circle (1pt);
\filldraw [black] (axis cs:3,6) circle (1pt);
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}
&
\begin{tikzpicture}
\begin{axis}[width=\marginparwidth,tick label style={font=\scriptsize},
minor x tick num=1,axis y line=middle,axis x line=middle,
ymin=-10,ymax=129,xmin=1.8,xmax=3.4,name=myplot]
\addplot [draw={\colorone},smooth,thick,domain=1.8:3.4]{150-16*x*x};
\addplot [draw={\colortwo},domain=1.8:3.2,thick] {-80*(x-2)+86};
\filldraw [black] (axis cs:2,86) circle (1pt);
\filldraw [black] (axis cs:3,6) circle (1pt);
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}
\\(a) & (b) \\\addlinespace
\begin{tikzpicture}
\begin{axis}[width=\marginparwidth,tick label style={font=\scriptsize},
minor x tick num=1,axis y line=middle,axis x line=middle,
ymin=-10,ymax=129,xmin=1.4,xmax=2.6,name=myplot]
\addplot [draw={\colorone},smooth,thick,domain=1.4:2.6]{150-16*x*x};
\addplot [draw={\colortwo},domain=1.42:2.6,thick] {-80*(x-2)+86};
\filldraw [black] (axis cs:2,86) circle (1pt);
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}
&
\begin{tikzpicture}
\begin{axis}[width=\marginparwidth,tick label style={font=\scriptsize},
minor x tick num=1,axis y line=middle,axis x line=middle,
ymin=-10,ymax=129,xmin=1.4,xmax=2.6,name=myplot]
\addplot [draw={\colorone},smooth,thick,domain=1.4:2.6]{150-16*x*x};
\addplot [draw={\colortwo},domain=1.42:2.6,thick] {-64*(x-2)+86};
\filldraw [black] (axis cs:2,86) circle (1pt);
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}
\\(c) & (d)\\
\end{tabular}
\caption{Parts (a), (b) and (c) show the secant line to $f(x)$ with $h=1$, zoomed in different amounts. Part (d) shows the tangent line to $f$ at $x=2$.}\label{fig:derivfalling}
\end{figure}
We have just introduced a number of important concepts that we will flesh out more within this section. First, we formally define two of them.
\begin{definition}[Derivative at a Point]\label{def:derivative_at_a_point}
Let $f$ be a continuous function on an open interval $I$ and let $c$ be in $I$.\index{derivative!at a point} The \textbf{derivative of $f$ at $c$}, denoted $\fp(c)$, is \[\lim_{h\to 0}\frac{f(c+h)-f(c)}{h},\] provided the limit exists.
\end{definition}
If the limit exists, we say that $f$ is \textbf{differentiable at $c$}; if the limit does not exist, then $f$ is \textbf{not differentiable at $c$}. If $f$ is differentiable at every point in $I$, then $f$ is \textbf{differentiable on $I$}.\index{differentiable}
\begin{definition}[Tangent Line]\label{def:tangent_line}
Let $f$ be continuous on an open interval $I$ and differentiable at $c$, for some $c$ in $I$. The line with equation $\ell(x) = \fp(c)(x-c)+f(c)$ is the \textbf{tangent line} to the graph of $f$ at $c$; that is, it is the line through $(c,f(c))$ whose slope is the derivative of $f$ at $c$.\index{tangent line}\index{derivative!tangent line}
\end{definition}
\youtubeVideo{1O5NEI8UuHM}{The Difference Quotient --- Example 1}
Some examples will help us understand these definitions.
\begin{example}[Finding derivatives and tangent lines]\label{ex_derv_point1}
Let $f(x) = 3x^2+5x-7$. Find:
\begin{multicols}{2}
\begin{enumerate}\lxAddClass{columns2}
\item $\fp(1)$
\item The equation of the tangent line to the graph of $f$ at $x=1$.
\item $\fp(3)$
\item The equation of the tangent line to the graph $f$ at $x=3$.
\end{enumerate}
\end{multicols}
\solution
\begin{enumerate}
\item We compute this directly using \autoref{def:derivative_at_a_point}.
\begin{align*}
\fp(1) &= \lim_{h\to 0} \frac{f(1+h)-f(1)}{h} \\
&= \lim_{h\to 0} \frac{3(1+h)^2+5(1+h)-7 - (3(1)^2+5(1)-7)}{h}\\
&= \lim_{h\to 0} \frac{3h^2+11h}{h}\\
&= \lim_{h\to 0}(3h+11)=11.%\\
%&= 11.
\end{align*}
\item The tangent line at $x=1$ has slope $\fp(1)$ and goes through the point $(1,f(1)) = (1,1)$. Thus the tangent line has equation, in point-slope form, $y = 11(x-1) + 1$. In slope-intercept form we have $y = 11x-10$.
\item Again, using the definition,
\begin{align*}
\fp(3) &= \lim_{h\to 0} \frac{f(3+h)-f(3)}{h} \\
&= \lim_{h\to 0} \frac{3(3+h)^2+5(3+h)-7 - (3(3)^2+5(3)-7)}{h} \\
&= \lim_{h\to 0} \frac{3h^2+23h}{h}\\
&= \lim_{h\to 0}(3h+23)\\
&= 23.
\end{align*}
\item The tangent line at $x=3$ has slope $23$ and goes through the point $(3,f(3))$, which is $(3,35)$. Thus the tangent line has equation $y=23(x-3)+35 = 23x-34$.
\end{enumerate}
\mtable{A graph of $f(x) = 3x^2+5x-7$ and its tangent lines at $x=1$ and $x=3$.}{fig:tangent1}{\begin{tikzpicture}
\begin{axis}[width=\marginparwidth,tick label style={font=\scriptsize},
minor x tick num=1,axis y line=middle,axis x line=middle,
ymin=-11,ymax=66,xmin=-.1,xmax=4.1,name=myplot]
\addplot [draw={\colorone},smooth,thick,domain=0:4] {3*x*x+5*x-7};
\addplot [draw={\colortwo},domain=.1:2.2,thick] {11*(x-1)+1};
\addplot [draw={\colortwo},domain=1.8:3.8,thick] {23*(x-3)+35};
\filldraw [black] (axis cs:1,1) circle (1pt);
\filldraw [black] (axis cs:3,35) circle (1pt);
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}}
A graph of $f$ is given in \autoref{fig:tangent1} along with the tangent lines at $x=1$ and $x=3$.
\end{example}
%Another important line that can be created using information from the derivative is the \textbf{normal line.} It is perpendicular to the tangent line, hence its slope is the opposite-reciprocal of the tangent line's slope.
%
%\begin{definition}[Normal Line]\label{def:normal_line}
%Let $f$ be continuous on an open interval $I$ and differentiable at $c$, for some $c$ in $I$. The \textbf{normal line} to the graph of $f$ at $c$ is the line with equation
%\[n(x) =\frac{-1}{\fp(c)}(x-c)+f(c),\] where $\fp(c)\neq 0$. When $\fp(c)=0$, the normal line is the vertical line through $\bigl(c,f(c)\bigr)$; that is, $x=c$.\index{derivative!normal line}\index{normal line}
%\end{definition}
%
%\begin{example}[Finding equations of normal lines]\label{ex_normal1}
%Let $f(x) = 3x^2+5x-7$, as in \autoref{ex_derv_point1}. Find the equations of the normal lines to the graph of $f$ at $x=1$ and $x=3$.
%
%\solution
%In \autoref{ex_derv_point1}, we found that $\fp(1)=11$. Hence at $x=1$, the normal line will have slope $-1/11$. An equation for the normal line is \[n(x) = \frac{-1}{11}(x-1)+1.\]
%The normal line is plotted with $y=f(x)$ in \autoref{fig:normal1}. Note how the line looks perpendicular to $f$. (A key word here is ``looks.'' Mathematically, we say that the normal line \emph{is} perpendicular to $f$ at $x=1$ as the slope of the normal line is the opposite-reciprocal of the slope of the tangent line. However, normal lines may not always \emph{look} perpendicular. The aspect ratio of the picture of the graph plays a big role in this.)
%\mtable{A graph of $f(x)=3x^2+5x-7$, along with its normal line at $x=1$.}{fig:normal1}{\begin{tikzpicture}
%\begin{axis}[width=1.16\marginparwidth,x=1cm,y=1cm,tick label style={font=\scriptsize},
%minor x tick num=1,axis y line=middle,axis x line=middle,
%ymin=-.1,ymax=3.5,xmin=-0.1,xmax=4.3,name=myplot]
%\addplot [draw={\colorone},smooth,thick,domain=0:4] {3*x*x+5*x-7};
%\addplot [draw={\colortwo},domain=.2:2.5,thick] {(-1/11)*(x-1)+1};
%\filldraw [black] (axis cs:1,1) circle (1pt);
%\filldraw [black] (axis cs:3,35) circle (1pt);
%\end{axis}
%\node [right] at (myplot.right of origin) {\scriptsize $x$};
%\node [above] at (myplot.above origin) {\scriptsize $y$};
%\end{tikzpicture}}
%
%We also found that $\fp(3) = 23$, so the normal line to the graph of $f$ at $x=3$ will have slope $-1/23$. An equation for the normal line is \[n(x) = \frac{-1}{23}(x-3)+35.\]
%\end{example}
Linear functions are easy to work with; many functions that arise in the course of solving real problems are not easy to work with. A common practice in mathematical problem solving is to approximate difficult functions with not-so-difficult functions. Lines are a common choice. It turns out that at any given point on the graph of a differentiable function $f$, the best linear approximation to $f$ is its tangent line. That is one reason we'll spend considerable time finding tangent lines to functions.
One type of function that does not benefit from a tangent-line approximation is a line; it is rather simple to recognize that the tangent line to a line is the line itself. We look at this in the following example.
\begin{example}[Finding the Derivative of a Line]\label{ex_der_line}
Consider $f(x) = 3x+5$. Find the equation of the tangent line to $f$ at $x=1$ and $x=7$.
\solution
We find the slope of the tangent line with \autoref{def:derivative_at_a_point}.
\begin{align*}
\fp(1) &= \lim_{h\to 0}\frac{f(1+h)-f(1)}{h} \\
&= \lim_{h\to 0} \frac{3(1+h)+5 - (3+5)}{h}\\
&= \lim_{h\to 0} \frac{3h}{h}\\
&= \lim_{h\to 0} 3\\
&= 3.
\end{align*}
We just found that $\fp(1) = 3$. That is, we found the \emph{instantaneous rate of change} of $f(x) = 3x+5$ is $3$. This is not surprising; lines are characterized by being the \emph{only} functions with a \emph{constant rate of change.} That rate of change is called the \emph{slope} of the line. Since their rates of change are constant, their \emph{instantaneous} rates of change are always the same; they are all the slope.
So given a line $f(x) = ax+b$, the derivative at any point $x$ will be $a$; that is, $\fp(x) = a$.
It is now easy to see that the tangent line to the graph of $f$ at $x=1$ is just $f$, with the same being true for $x=7$.
\end{example}
We often desire to find the tangent line to the graph of a function without knowing the actual derivative of the function. In these cases, the best we may be able to do is approximate the tangent line. We demonstrate this in the next example.
\begin{example}[Numerical Approximation of the Tangent Line]\label{ex_der_num_approx}
Approximate the equation of the tangent line to the graph of $f(x)=\sin x$ at $x=0$.
\solution
In order to find the equation of the tangent line, we need a slope and a point. The point is given to us: $(0,\sin 0) = (0,0)$. To compute the slope, we need the derivative. This is where we will make an approximation. Recall that
\[\fp(0) \approx \frac{\sin(0+h)- \sin 0}{h}\]
for a small value of $h$. We choose (somewhat arbitrarily) to let $h=0.1$. Thus
%
\mtable{$f(x) = \sin x$ graphed with an approximation to its tangent line at $x=0$.}{fig:tangentsinx}{\begin{tikzpicture}
\begin{axis}[width=1.16\marginparwidth,axis equal image,tick label style={font=\scriptsize},
minor x tick num=1,xtick={-3.14,-1.57,1.57,3.14},
xticklabels={$-\pi$,$-\frac{\pi}2$,$\frac{\pi}2$,$\pi$},axis y line=middle,
axis x line=middle,ymin=-1.9,ymax=1.9,xmin=-3.5,xmax=3.5,name=myplot]
\addplot [draw={\colorone},smooth,thick,domain=-3.5:3.5] {sin(deg(x))};
\addplot [draw={\colortwo},domain=-1:1,thick] {.9983*x};
\filldraw [black] (axis cs:0,0) circle (1pt);
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}}
%
\[\fp(0) \approx \frac{\sin(0.1)-\sin 0}{0.1} \approx 0.9983.\]
Thus our approximation of the equation of the tangent line is $y = 0.9983(x-0) +0 = 0.9983x$; it is graphed in \autoref{fig:tangentsinx}. The graph seems to imply the approximation is rather good.
\end{example}
Recall from \autoref{sec:limit_analytically} that $\ds \lim_{x\to 0}\frac{\sin x}x =1$, meaning for values of $x$ near 0, $\sin x \approx x$. Since the slope of the line $y=x$ is 1 at $x=0$, it should seem reasonable that ``the slope of $f(x)=\sin x$'' is near 1 at $x=0$. In fact, since we \emph{approximated} the value of the slope to be $0.9983$, we might guess the \emph{actual value} is 1. We'll come back to this later.\bigskip
Consider again \autoref{ex_derv_point1}. To find the derivative of $f$ at $x=1$, we needed to evaluate a limit. To find the derivative of $f$ at $x=3$, we needed to again evaluate a limit. We have this process:
\[
\begin{tabular}{c}input specific\\number $c$\end{tabular}
\longrightarrow
\fbox{\begin{tabular}{c}do something\\to $f$ and $c$\end{tabular}}
\longrightarrow
\begin{tabular}{c}return\\number $\fp(c)$\end{tabular}
\]
This process describes a \emph{function}; given one input (the value of $c$), we return exactly one output (the value of $\fp(c)$). The ``do something'' box is where the tedious work (taking limits) of this function occurs.
Instead of applying this function repeatedly for different values of $c$, let us apply it just once to the variable $x$. We then take a limit just once. The process now looks like:
\[
\text{input variable x}
\longrightarrow
\fbox{\begin{tabular}{c}do something\\to $f$ and $x$\end{tabular}}
\longrightarrow
\begin{tabular}{c}return\\function $\fp(x)$\end{tabular}
\]
The output is the ``derivative function,'' $\fp(x)$. The $\fp(x)$ function will take a number $c$ as input and return the derivative of $f$ at $c$. This calls for a definition.
\begin{definition}[Derivative Function]\label{def:the_derivative}
Let $f$ be a differentiable function on an open interval $I$. The function
\[\fp(x) = \lim_{h\to 0} \frac{f(x+h)-f(x)}{h}\]
is the \textbf{derivative} of $f$.\index{derivative!as a function}\index{derivative!notation}\bigbreak
\textbf{Notation:}
Let $y = f(x)$. The following notations all represent the derivative:
\[\fp(x)\ =\ y\primeskip'\ =\ \frac{\dd y}{\dd x}\ =\ \frac{\dd f}{\dd x}\ =\ \frac{\dd}{\dd x}(f)\ =\ \frac{\dd}{\dd x}(y).\]
\end{definition}
\noindent
\textbf{Important:} The notation $\ds \frac{\dd y}{\dd x}$ is one symbol; it is \textbf{not} the fraction ``$\dd y/\dd x$''. The notation, while somewhat confusing at first, was chosen with care. A fraction-looking symbol was chosen because the derivative has many fraction-like properties. Among other places, we see these properties at work when we talk about the units of the derivative, when we discuss the Chain Rule, and when we learn about integration (topics that appear in later sections and chapters).\bigskip
Examples will help us understand this definition.
\begin{example}[Finding the derivative of a function]\label{ex_deriv1}
Let $f(x) = 3x^2+5x-7$ as in \autoref{ex_derv_point1}. Find $\fp(x)$.
\solution
We apply \autoref{def:the_derivative}.
\begin{align*}
\fp(x)
&= \lim_{h\to 0} \frac{f(x+h)-f(x)}{h} \\
&= \lim_{h\to 0} \frac{3(x+h)^2+5(x+h)-7-(3x^2+5x-7)}{h}\\
&= \lim_{h\to 0} \frac{3h^2 +6xh+5h}{h}\\
&= \lim_{h\to 0}(3h+6x+5)\\
&= 6x+5
\end{align*}
So $\fp(x) = 6x+5$. Recall earlier we found that $\fp(1) = 11$ and $\fp(3) = 23$. Note our new computation of $\fp(x)$ affirm these facts.
\end{example}
\begin{example}[Finding the derivative of a function]\label{ex_deriv2}
Let $\ds f(x) = \frac{1}{x+1}$. Find $\fp(x)$.
\solution
We apply \autoref{def:the_derivative}.
\begin{align*}
\fp(x)
&= \lim_{h\to 0} \frac{f(x+h)-f(x)}{h}\\
&= \lim_{h\to 0} \frac{\frac{1}{x+h+1}-\frac{1}{x+1}}{h}
\intertext{Now find a common denominator and subtract; factor $1/h$ out front to facilitate reading.}
\fp(x)
&= \lim_{h\to 0} \frac{1}{h}\cdot\left(\frac{x+1}{(x+1)(x+h+1)} - \frac{x+h+1}{(x+1)(x+h+1)}\right)\\
&= \lim_{h\to 0} \frac 1h\cdot\left(\frac{x+1-(x+h+1)}{(x+1)(x+h+1)}\right)\\
&= \lim_{h\to 0} \frac1h\cdot\left(\frac{-h}{(x+1)(x+h+1)}\right)\\
&= \lim_{h\to 0} \frac{-1}{(x+1)(x+h+1)} \\
&= \frac{-1}{(x+1)(x+1)}\\
&= \frac{-1}{(x+1)^2}
\end{align*}
So $\ds\fp(x) = \frac{-1}{(x+1)^2}$. To practice using our notation, we could also state
\[\frac{\dd}{\dd x}\left(\frac{1}{x+1}\right) = \frac{-1}{(x+1)^2}.\]
\end{example}
\begin{example}[Finding the derivative of a function]\label{ex_deriv_sinx}
Find the derivative of $f(x) = \sin x$.
\solution
Before applying \autoref{def:the_derivative}, note that once the derivative is found, we can find the actual tangent line to $f(x) = \sin x$ at $x=0$, whereas we settled for an approximation in \autoref{ex_der_num_approx}.
\small
\begin{align*}
&\fp(x)\\
&= \lim_{h\to 0} \frac{\sin(x+h)-\sin x}{h} & & \left(\text{\scriptsize \parbox{110pt}{\centering Use trig identity $\sin(x+h) = \sin x\cos h+\cos x\sin h$}}\right) \\
&= \lim_{h\to 0} \frac{\sin x\cos h+\cos x\sin h-\sin x}{h} & & \text{\scriptsize (regroup)}\\
&= \lim_{h\to 0} \frac{\sin x(\cos h-1) + \cos x\sin h}{h} & & \text{\scriptsize (split into two fractions)}\\
&= \lim_{h\to 0} \left(\frac{\sin x(\cos h-1)}{h} + \frac{\cos x\sin h}{h}\right) & & \left(\text{\scriptsize use $\ds \lim_{h\to 0} \frac{\cos h-1}{h} = 0$ and $\ds \lim_{h\to 0} \frac{\sin h}{h} = 1$}\right)\\
&= \sin x\cdot 0 + \cos x \cdot 1 \\
&= \cos x\ .
\end{align*}
\end{example} % also ends \small
We have found that when $f(x) = \sin x$, $\fp(x) = \cos x$ (see \autoref{fig:sin_and_dsin}).
\begin{\ifbool{latexml}{center}{centering}}
\captionsetup{type=figure}%
\begin{tikzpicture}
\begin{axis}[tick label style={font=\scriptsize}, axis y line=middle,axis x line=middle, ymin=-1.5, ymax=1.9,xmin=-7,xmax=7,name=myplot,axis equal image,
xtick={-6.28318, -4.7123889, -3.14159, -1.5708, 1.5708, 3.14159, 4.7123889, 6.28318}, xticklabels={-$2\pi$, $-\frac{3\pi}{2}$,$-\pi$, $-\frac{\pi}{2}$, $\frac{\pi}{2}$,$\pi$, $\frac{3\pi}{2}$, $2\pi$},width=\textwidth ] % xscale=1.4,
% w/h = 14/2.3 => h = 2.3*w/14 = .164 w
\addplot [draw={\colorone}, smooth, domain=-6.28318:6.28318,thick] {sin(deg(x))}
node [pos=.7, above right] {\scriptsize $f(x)=\sin{x}$};
\addplot [draw={\colortwo},smooth, domain=-6.28318:6.28318,thick] {cos(deg(x))}
node [pos=.45, above left] {\scriptsize $\fp(x)=\cos{x}$};
\draw[draw=\colortwo] (axis cs:-5.1,1.005)--(axis cs:-4.4,1.005);
\draw[draw=\colortwo] (axis cs:-2,-1.005)--(axis cs:-1.1,-1.005);
\draw[draw=\colortwo] (axis cs:5.1,-1.005)--(axis cs:4.4,-1.005);
\draw[draw=\colortwo] (axis cs:2,1.005)--(axis cs:1.1,1.005);
\draw[gray] (axis cs:-4.7123889,0)--(axis cs:-4.7123889,1);
\draw[gray] (axis cs:-1.5708,0)--(axis cs:-1.5708,-1);
\draw[gray] (axis cs:1.5708,0)--(axis cs:1.5708,1);
\draw[gray] (axis cs:4.7123889,0)--(axis cs:4.7123889,-1);
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}
\caption{The function $f(x)=\sin x$ and its derivative $\fp(x)=\cos x$.}
\label{fig:sin_and_dsin}
\end{\ifbool{latexml}{center}{centering}}
Initially, this might be somewhat surprising; the result of a tedious limit process and the sine function is a nice function. Then again, perhaps this is not entirely surprising. The sine function is periodic --- it repeats itself on regular intervals. Therefore its rate of change also repeats itself on the same regular intervals. In fact, if we think about $\fp(x)$ as the slope of the tangent to the sine curve we notice the following
\begin{itemize}
\item when the slope of tangent lines is 0 then $\fp(x)=\cos x$ crosses the $x-$axis;
\item when the slopes of the tangent lines are positive then $\fp$ lies above the $x-$axis; and
\item when the slopes of the tangent lines are negative then $\fp$ lies below the $x-$axis.
\end{itemize}
We should have known the derivative would be periodic; we now know exactly which periodic function it is.
Thinking back to \autoref{ex_der_num_approx}, we can find the slope of the tangent line to $f(x)=\sin x$ at $x=0$ using our derivative. We approximated the slope as $0.9983$; we now know the slope is \emph{exactly} $\cos 0 =1$.
\begin{example}[Finding the derivative of a piecewise defined function]\label{ex_not_diff}
Find the derivative of the absolute value function,
\[f(x) = \abs{x} = \begin{cases}-x & x<0 \\ x & x\geq 0.\end{cases}\]\vspace{-.5\baselineskip}
See \autoref{fig:absolutevalue}.
\solution
We need to evaluate $\ds \lim_{h\to0}\frac{f(x+h)-f(x)}{h}.$ As $f$ is piecewise-defined, we need to consider separately the limits when $x<0$ and when $x>0$.
\mtable{The absolute value function, $f(x) = \abs{x}$. Notice how the slope of the lines (and hence the tangent lines) abruptly changes at $x=0$.}{fig:absolutevalue}{\begin{tikzpicture}
\begin{axis}[width=1.16\marginparwidth,tick label style={font=\scriptsize},
minor tick num=1,axis y line=middle,axis x line=middle,axis equal,
ymin=-.2,ymax=1.1,xmin=-1.1,xmax=1.1,name=myplot]
\addplot [draw={\colorone},thick] coordinates {(-1,1) (0,0) (1,1)};
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}}
When $x<0$:
\begin{align*}
\frac{\dd}{\dd x}\bigl(-x\bigr)
&= \lim_{h\to 0}\frac{-(x+h) - (-x)}{h} \\
&= \lim_{h\to 0}\frac{-h}{h}\\
&= \lim_{h\to 0}-1 \\
&= -1.
\end{align*}
When $x>0$, a similar computation shows that $\ds \frac{\dd}{\dd x}\bigl(x\bigr) = 1$.
We need to also find the derivative at $x=0$. By the definition of the derivative at a point, we have
\[\fp(0) = \lim_{h\to0}\frac{f(0+h)-f(0)}{h}.\]
Since $x=0$ is the point where our function's definition switches from one piece to the other, we need to consider left and right-hand limits. Consider the following, where we compute the left and right hand limits side by side.\\
\begin{minipage}[b]{.49\linewidth}
\lxAddClass{noLineBreak}
\begin{align*}
\lim_{h\to0^-}\frac{f(0+h)-f(0)}{h} &= \\
\lim_{h\to0^-}\frac{-h-0}{h} &= \\
\lim_{h\to0^-}-1 & =-1
\end{align*}
\end{minipage}\rule{.5pt}{70pt}%
\begin{minipage}[b]{.49\linewidth}
\begin{align*}
\lim_{h\to0^+}\frac{f(0+h)-f(0)}{h} &= \\
\lim_{h\to0^+}\frac{h-0}{h} &= \\
\lim_{h\to0^+}1 & =1
\end{align*}
\end{minipage}\\
%
\mtable{A graph of the derivative of $f(x) = \abs{x}$.}{fig:absolutevalueprime}{\begin{tikzpicture}
\begin{axis}[width=1.16\marginparwidth,tick label style={font=\scriptsize},
minor x tick num=1,axis y line=middle,axis x line=middle,
ymin=-1.4,ymax=1.4,xmin=-1.1,xmax=1.1,name=myplot]
\addplot [draw={\colorone},thick] coordinates {(-1,-1) (0,-1)};
\addplot [draw={\colorone},thick] coordinates {(0,1) (1,1)};
\filldraw [fill=white, thick] (axis cs:0,-1) circle (2pt);
\filldraw [fill=white, thick] (axis cs:0,1) circle (2pt);
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}}
%
\noindent
The last lines of each column tell the story: the left and right hand limits are not equal. Therefore the limit does not exist at 0, and $f$ is not differentiable at 0; see \autoref{fig:absolutevalueprime}.\vspace{-.3\baselineskip}
So we have
\[\fp(x) = \begin{cases} -1 & x<0 \\ 1 & x>0\end{cases}.\]
At $x=0$, $\fp(x)$ does not exist; there is a jump discontinuity at 0. So $f(x) = \abs{x}$ is differentiable everywhere except at 0.
\end{example}
The point of non-differentiability came where the piecewise defined function switched from one piece to the other. Our next example shows that this does not always cause trouble.\bigskip
\begin{example}[Finding the derivative of a piecewise defined function]\label{ex_diff_piecewise}
Find the derivative of $f(x)$, where $\ds f(x) = \begin{cases}\sin x & x\leq \pi/2 \\ 1 & x>\pi/2 \end{cases}.$ See \autoref{fig:piecewisesinx1}.
\solution
Using \autoref{ex_deriv_sinx}, we know that when $x<\pi/2$, $\fp(x) = \cos x$. It is easy to verify that when $x>\pi/2$, $\fp(x) = 0$; consider:
\mtable{A graph of $f(x)$ as defined in \autoref{ex_diff_piecewise}.}{fig:piecewisesinx1}{\begin{tikzpicture}
\begin{axis}[width=1.16\marginparwidth,tick label style={font=\scriptsize},
minor x tick num=1,xtick={1.57},xticklabels={$\frac{\pi}2$},axis y line=middle,
axis x line=middle,ymin=-.4,ymax=1.4,xmin=-.1,xmax=2.1,name=myplot]
\addplot [draw={\colorone},smooth,thick,domain=-.1:1.57] {sin(deg(x))};
\addplot [draw={\colorone},smooth,thick] coordinates {(1.57,1) (2.,1)};
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}}
\[
\lim_{h\to0}\frac{f(x+h) - f(x)}{h}
= \lim_{h\to0}\frac{1-1}{h} = \lim_{h\to0}0 =0.
\]
So far we have
\[\fp(x) = \begin{cases}\cos x & x<\pi/2\\ 0 & x>\pi/2\end{cases}.\]
We still need to find $\fp(\pi/2)$. Notice at $x=\pi/2$ that both pieces of $\fp$ are 0, meaning we can state that $\fp(\pi/2)=0$.
Being more rigorous, we can again evaluate the difference quotient limit at $x=\pi/2$, utilizing again left and right-hand limits:\\
{\small\lxAddClass{noLineBreak}
\noindent\begin{minipage}{.59\linewidth}
\begin{align*}
\lim_{h\to0^-}\frac{f(\pi/2+h)-f(\pi/2)}{h} =\\
\lim_{h\to0^-}\frac{\sin(\pi/2+h)-\sin(\pi/2)}{h}=\\
\lim_{h\to0^-}{ \frac{\sin(\frac{\pi}{2})\cos(h)+\sin(h)\cos(\frac{\pi}{2})-\sin(\frac{\pi}{2})}{h}}=\\
\lim_{h\to0^-}\frac{1\cdot\cos(h)+\sin(h)\cdot 0-1}{h} =\\
0\hphantom{{}=}
\end{align*}
\end{minipage}%
\begin{minipage}{1pt}
\rule{.5pt}{100pt}%
\end{minipage}%
\begin{minipage}{.39\linewidth}
\begin{align*}
\lim_{h\to0^+}\frac{f(\pi/2+h)-f(\pi/2)}{h} =\\
\lim_{h\to0^+}\frac{1-1}{h}=\\
\lim_{h\to0^+}\frac{0}{h}=\\
0\hphantom{{}=}\\
\phantom{0}\\
\phantom{0}
\end{align*}
\end{minipage}
}
\mtable{A graph of $\fp(x)$ in \autoref{ex_diff_piecewise}.}{fig:piecewisecosx1}{\begin{tikzpicture}
\begin{axis}[width=1.16\marginparwidth,tick label style={font=\scriptsize},
minor x tick num=1,xtick={1.57},xticklabels={$\frac{\pi}2$},axis y line=middle,
axis x line=middle,ymin=-.4,ymax=1.4,xmin=-.1,xmax=2.1,name=myplot]
\addplot [draw={\colorone},smooth,thick,domain=-.1:1.57] {cos(deg(x))};
\addplot [draw={\colorone},thick] coordinates {(1.57,0) (2.,0)};
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}}
Since both the left and right hand limits are 0 at $x=\pi/2$, the limit exists and $\fp(\pi/2)$ exists (and is 0). Therefore we can fully write $\fp$ as
\[\fp(x) = \begin{cases}\cos x & x\leq\pi/2\\ 0 & x>\pi/2\end{cases}.\]
See \autoref{fig:piecewisecosx1} for a graph of this function.
\end{example}
Recall we pseudo-defined a continuous function as one in which we could sketch its graph without lifting our pencil. We can give a pseudo-definition for differentiability as well: it is a continuous function that does not have any ``sharp corners.'' One such sharp corner is shown in \autoref{fig:absolutevalue}. Even though the function $f$ in \autoref{ex_diff_piecewise} is piecewise-defined, the transition is ``smooth'' hence it is differentiable. Note how in the graph of $f$ in \autoref{fig:piecewisesinx1} it is difficult to tell when $f$ switches from one piece to the other; there is no ``corner.''
\ifbool{latexml}{%
To better understand the definition of a derivative, experiment with the Geogebra app at \url{http://mathinsight.org/applet/secant_line_slope}.%
% todo Tim : iframe ?
}{%
\exvideo{%
\begin{minipage}[t]{.18\linewidth}%
\vspace{-.5\baselineskip}\qrcode{http://mathinsight.org/applet/secant_line_slope}%
\end{minipage}
\quad
\begin{minipage}[t]{.64\linewidth}%
\raggedright
To better understand the definition of a derivative, experiment with the Geogebra app at \\
\url{http://mathinsight.org/applet/secant_line_slope}.%
\end{minipage}%
}%
}
This section defined the derivative; in some sense, it answers the question of ``What \emph{is} the derivative?'' The next section addresses the question ``What does the derivative \emph{mean}?''
\printexercises{exercises/02-01-exercises}
% todo Find an interactive where you specify the function and base point and see the secant and tangent lines