forked from APEXCalculus/APEXCalculus_Source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01_Continuity.tex
443 lines (381 loc) · 28.9 KB
/
01_Continuity.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
\section{Continuity}\label{sec:continuity}
As we have studied limits, we have gained the intuition that limits measure ``where a function is heading.'' That is, if $\ds \lim_{x\to 1} f(x) = 3$, then as $x$ is close to 1, $f(x)$ is close to 3. We have seen, though, that this is not necessarily a good indicator of what $f(1)$ actually is. This can be problematic; functions can tend to one value but attain another. This section focuses on functions that \emph{do not} exhibit such behavior.
\begin{definition}[Continuous Function]\label{def:continuous}
Let $f$ be a function defined on an open interval $I$ containing $c$. \index{continuous function}
\begin{enumerate}
\item $f$ is \textbf{continuous at $c$} if $\ds \lim_{x\to c}f(x) = f(c) $.
\item $f$ is \textbf{continuous on $I$} if $f$ is continuous at $c$ for all values of $c$ in $I$. If $f$ is continuous on $(-\infty,\infty)$, we say $f$ is \textbf{continuous everywhere}.
\end{enumerate}
\end{definition}
A useful way to establish whether or not a function $f$ is continuous at $c$ is to verify the following three things:
\begin{enumerate}
\item $\ds \lim_{x\to c} f(x)$ exists,
\item $f(c)$ is defined, and
\item $\ds \lim_{x\to c} f(x) = f(c)$.
\end{enumerate}
If $f$ is defined near $c$ but is not continuous at $c$, then we say that $f$ is \textbf{discontinuous at} $\mathbf{c}$ or $f$ has a \textbf{discontinuity at} $\mathbf{c}$. We will discuss three types of discontinuities, as seen in \autoref{fig:types_of_discont}.\index{discontinuous}
\noindent\begin{minipage}[t]{\linewidth}\noindent%
\captionsetup{type=figure}%
\centering
\begin{tabular}{ c c c }
\begin{tikzpicture}
\begin{axis}[width=.8\marginparwidth, axis y line=middle,axis x line=middle, ymin=-3, ymax=3, xmin=-3, xmax=3, name=myplot]
\addplot[draw={\colorone}, domain=-3:3, thick, smooth] {(x+1)/2};
\fill[thick] (axis cs:1,2) circle (1.5pt);
\fill[white,draw=black,thick] (axis cs:1,1) circle (1.5pt);
\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=.8\marginparwidth, axis y line=middle,axis x line=middle, ymin=-3, ymax=3, xmin=-3, xmax=3, name=myplot]
\addplot[draw={\colorone}, domain=-3:.9, thick, smooth] {1/(1-x)};
\addplot[draw={\colorone}, domain=1:3, thick, smooth] {3-x};
\fill[thick] (axis cs:1,2) circle (1.5pt);
\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=.8\marginparwidth, axis y line=middle,axis x line=middle, ymin=-3, ymax=3, xmin=-3, xmax=3, name=myplot]
\addplot[draw={\colorone}, domain=-3:1, thick, smooth] {(x+1)/2};
\addplot[draw={\colorone}, domain=1:3, thick, smooth] {3-x};
\fill[white,draw=black,thick] (axis cs:1,1) circle (1.5pt);
\fill[thick] (axis cs:1,2) circle (1.5pt);
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}
\\
Removable & Infinite & Jump
\end{tabular}
\caption{Three types of discontinuities}
\label{fig:types_of_discont}
\end{minipage}
\noindent
\begin{minipage}{\linewidth}
\begin{description}
\item[Removable discontinuity] This type of discontinuity is called removable because we could remove the discontinuity by redefining the function at a single point.
\item[Infinite discontinuity] The function is approaching $\pm \infty$ at some $x$ value.
\item[Jump discontinuity] The function ``jumps'' from one value to another.
\end{description}
\end{minipage}
\youtubeVideo{hlorAjS0xWE}{Continuity and Limits Made Easy --- Part 1 of 2}
\begin{example}[Finding intervals of continuity]\label{ex_contint1}
Let $f$ be defined as shown in \autoref{fig_continuous1}. Give the interval(s) on which $f$ is continuous.
%
\mtable{A graph of $f$ in \autoref{ex_contint1}.}{fig_continuous1}{\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=-.4,ymax=1.7,xmin=-.4,xmax=3.4,name=myplot]
\addplot [draw={\colorone},smooth,thick] coordinates {(0.,1.5) (0.1,1.54) (0.2,1.56) (0.3,1.56) (0.4,1.54) (0.5,1.5)(0.6,1.44) (0.7,1.36) (0.8,1.26) (0.9,1.14) (1.,1.)};
\addplot [draw={\colorone},smooth,thick] coordinates {(1.,1.) (2,1)};
\addplot [draw={\colorone},smooth,thick] coordinates {(2.,1.) (2.1,1.09) (2.2,1.16) (2.3,1.21) (2.4,1.24) (2.5,1.25)
(2.6,1.24) (2.7,1.21) (2.8,1.16) (2.9,1.09) (3.,1.)};
\fill[white,draw=black,thick] (axis cs:1,1) circle (1.5pt);
\fill[black,draw=black] (axis cs:2,1) circle (1pt);
\fill[black,draw=black] (axis cs:0,1.5) circle (1pt);
\fill[black,draw=black] (axis cs:3,1) circle (1pt);
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}}
%
\solution
We proceed by examining the three criteria for continuity.
\begin{enumerate}
\item The limits $\ds \lim_{x\to c} f(x)$ exists for all $c$ between 0 and 3.
\item $f(c)$ is defined for all $c$ between 0 and 3, \emph{except for} $c=1$. We know immediately that $f$ cannot be continuous at $x=1$.
\item The limit $\ds \lim_{x\to c} f(x) = f(c)$ for all $c$ between 0 and 3, except, of course, for $c=1$.
\end{enumerate}
We conclude that $f$ is continuous at every point of $(0,3)$ except at $x=1$. Therefore $f$ is continuous on $(0,1)\cup(1,3)$.
\end{example}
\mtable{A graph of the step function in \autoref{ex_contint2}.}{fig:continuous2}{\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=-2.4,ymax=2.4,xmin=-2.4,xmax=3.4,name=myplot]
\foreach \x in {-2,-1,...,2} {
\edef\temp{
\noexpand\draw[draw={\colorone},smooth,thick](axis cs:\x,\x)--(axis cs:{\x+1},\x);
\noexpand\fill[black,draw=black](axis cs:\x,\x)circle(1pt);
\noexpand\fill[white,draw=black](axis cs:{\x+1},\x)circle(1pt);
}
\temp
}
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}}
\begin{example}[Finding intervals of continuity]\label{ex_contint2}
The \emph{floor function},
\index{floor function}
$f(x) = \lfloor x \rfloor$, returns the largest integer smaller than or equal to the input $x$. (For example, $f(\pi) = \lfloor \pi \rfloor = 3$.) The graph of $f$ in \autoref{fig:continuous2} demonstrates why this is often called a ``step function.'' \\
Give the intervals on which $f$ is continuous.
\solution
We examine the three criteria for continuity.
\begin{enumerate}
\item The limits $\lim_{x\to c} f(x)$ do not exist at the jumps from one ``step'' to the next, which occur at all integer values of $c$. Therefore the limits exist for all $c$ except when $c$ is an integer.
\item The function is defined for all values of $c$.
\item The limit $\ds \lim_{x\to c} f(x) = f(c)$ for all values of $c$ where the limit exist, since each step consists of just a line.
\end{enumerate}
We conclude that $f$ is continuous everywhere except at integer values of $c$. So the intervals on which $f$ is continuous are
\[\dotsc, (-2,-1), (-1,0), (0,1), (1,2), \dotsc.\]
\end{example}
Our definition of continuity on an interval specifies the interval is an open interval. At endpoints or points of discontinuity we may consider continuity from the right or left.
\begin{definition}[Right and Left Continuity]\label{def:left_right_cont}
\textbf{Right Continuous}
Let $f$ be defined on a closed interval with left endpoint $a$. We say that $f$ is \textbf{continuous from the right at $a$} (or \textbf{right continuous at $a$}) if \[\lim_{x\to a^+} f(x)=f(a).\vspace{-\baselineskip}\]\index{continuity!right}
\textbf{Left Continuous}
Let $f$ be defined on a closed interval with right endpoint $b$. We say that $f$ is \textbf{continuous from the left at $b$} (or \textbf{left continuous at $b$}) if
\[\lim_{x\to b^-} f(x)=f(b).\vspace{-\baselineskip}\]\index{continuity!left}
\end{definition}
We can then extend the definition of continuity to closed intervals by considering the appropriate one-sided limits at the endpoints.
\begin{definition}[Continuity on Closed Intervals]\label{def:closed_continuity}
Let $f$ be defined on the closed interval $[a,b]$ for some real numbers $a,b$. Then $f$ is \textbf{continuous on $[a,b]$} if:
\begin{enumerate}
\item $f$ is continuous on $(a,b)$,
\item $f$ is right continuous at $a$ and
\item $f$ is left continuous at $b$.
\end{enumerate}
\end{definition}
We can make the appropriate adjustments to talk about continuity on half-open intervals such as $[a,b)$ or $(a,b]$ if necessary.\bigskip
%
%Using this new definition, we can adjust our answer in \autoref{ex_contint2} by stating that the floor function is continuous on the following half-open intervals \[\dotsc, [-2,-1), [-1,0), [0,1), [1,2), \dotsc.\] This can tempt us to conclude that $f$ is continuous everywhere; after all, if $f$ is continuous on $[0,1)$ and $[1,2)$, isn't $f$ also continuous on $[0,2)$? Of course, the answer is \emph{no}, and the graph of the floor function immediately confirms this.\\
%
%Continuous functions are important as they behave in a predictable fashion: functions attain the value they approach. Because continuity is so important, most of the functions you have likely seen in the past are continuous on their domains. This is demonstrated in the following example where we examine the intervals of continuity of a variety of common functions.\\
Continuity is inherently tied to the properties of limits. Because of this, the properties of limits found in Theorems \ref{thm:limit_algebra} and \ref{thm:poly_rat}
apply to continuity as well. We will utilize these properties in the following example.
\begin{example}[Determining intervals on which a function is continuous]\label{ex_cont_funct1}
For each of the following functions, give the domain of the function and the interval(s) on which it is continuous.
\begin{multicols}{2}
\begin{enumerate}\lxAddClass{columns2}
\item $f(x) = 1/x$
\item $f(x) = \sin x$
\item $f(x) = \sqrt{x}$
\item $f(x) = \sqrt{1-x^2}$
\item $f(x) = \abs x$
\item[]
\end{enumerate}
\end{multicols}
\solution
We examine each in turn.
\begin{enumerate}
\item The domain of $f(x) = 1/x$ is $(-\infty,0) \cup (0,\infty)$. As it is a rational function, we apply \autoref{thm:poly_rat} to recognize that $f$ is continuous on all of its domain.
\item The domain of $f(x) = \sin x$ is all real numbers, or $(-\infty,\infty)$. Applying \autoref{thm:lim_continuous} shows that $\sin x$ is continuous everywhere.
\item The domain of $f(x) = \sqrt{x}$ is $[0,\infty)$. Applying \autoref{thm:lim_continuous} shows that $f(x) = \sqrt{x}$ is continuous on its domain of $[0,\infty)$.
\item The domain of $f(x) = \sqrt{1-x^2}$ is $[-1,1]$. Applying Theorems \ref{thm:limit_algebra} and \ref{thm:lim_continuous} shows that $f$ is continuous on all of its domain, $[-1,1]$.
\item The domain of $f(x) = \abs x$ is $(-\infty,\infty)$. We can define the absolute value function as $\ds f(x) = \begin{cases}-x & x<0 \\ x & x\geq 0\end{cases}$. Each ``piece'' of this piecewise defined function is continuous on all of its domain, giving that $f$ is continuous on $(-\infty,0)$ and $[0,\infty)$. We cannot assume this implies that $f$ is continuous on $(-\infty,\infty)$; we need to check that $\ds \lim_{x\to 0}f(x) = f(0)$, as $x=0$ is the point where $f$ transitions from one ``piece'' of its definition to the other. It is easy to verify that this is indeed true, hence we conclude that $f(x) = \abs{x}$ is continuous everywhere.
\end{enumerate}
\end{example}
The following theorem states how continuous functions can be combined to form other continuous functions.
\begin{theorem}[Properties of Continuous Functions]\label{thm:continuity_algebra}
Let $f$ and $g$ be continuous functions on an interval $I$, let $c$ be a real number and let $n$ be a positive integer. The following functions are continuous on $I$.
\begin{enumerate}
\item \makebox[9em][l]{Sums/Differences:} $f\pm g$
\item \makebox[9em][l]{Constant Multiples:} $c\cdot f$
\item \makebox[9em][l]{Products:} $f\cdot g$
\item \makebox[9em][l]{Quotients:} $f/g$ \qquad {\small (as long as $g\neq 0$ on $I$)}
\item \makebox[9em][l]{Powers:} $f\,^n$
\item \makebox[9em][l]{Roots:} $\sqrt[n]{f}$ \qquad {\small (if $f\geq 0$ on $I$ or $n$ is odd)}
\end{enumerate}
\end{theorem}
The proofs of each of the parts of \autoref{thm:continuity_algebra} follow from the Basic Limit Properties given in \autoref{thm:limit_algebra}. We will prove the product of two continuous functions is continuous now.
\begin{proof}
We know that $f$ and $g$ are continuous at $c$ so by definition we have
\[\lim_{x\to c}f(x)=f(c) \quad \text{and} \quad \lim_{x\to c} g(x)=g(c).\]
Therefore,\vspace{-.3\baselineskip}
\begin{align*}
\lim_{x\to c} (f\cdot g)(x)&=\lim_{x\to c} f(x)\cdot g(x)\\
&=\lim_{x\to c}f(x) \cdot \lim_{x\to c} g(x)\\
&=f(c)\cdot g(c)\\
&=(f\cdot g)(c).\qedhere
\end{align*}
\end{proof}
\begin{theorem}[Continuity of Compositions]\label{thm:composition_continuous}
Let $f$ be continuous on $I$, where the range of $f$ on $I$ is $J$, and let $g$ be continuous on $J$. Then\vspace{-.3\baselineskip}
\[(g\circ f)(x)=g(f(x))\]
is continuous on $I$.
\end{theorem}
Now knowing the definition of continuity we can re-read \autoref{thm:lim_continuous} as giving a list of functions that are continuous on their domains.
\begin{theorem}[Continuous Functions]\label{thm:continuous_functions}
The following functions are continuous on their domains.\index{continuous function!properties}
\begin{multicols}{2}
\begin{enumerate}\lxAddClass{columns2}
\item $\ds f(x) = \sin x$
\item $\ds f(x) = \cos x$
\item $\ds f(x) = \tan x$
\item $\ds f(x) = \cot x$
\item $\ds f(x) = \sec x$
\item $\ds f(x) = \csc x$
\item $\ds f(x) = \ln x$
\item $\ds f(x) = a^x$ ($a>0$)
% \item $\ds f(x) = \sqrt[n]{x}$,
% {\small (where $n$ is a positive integer)}
% \item[]
\end{enumerate}
\end{multicols}
\end{theorem}
%\autoref{thm:continuity_algebra} and \autoref{thm:continuous_functions} tell us that the following types of functions are continuous on their domains:
%\begin{center}
%\begin{tabular}{l l l}
%polynomials & rational functions & exponential functions\\
%trigonometric functions & root functions & logarithmic functions
%\end{tabular}
%\end{center}
In the following example, we will show how we apply the previous theorems.
\begin{example}[Determining intervals on which a function is continuous]\label{ex_cont_funct}
State the interval(s) on which each of the following functions is continuous.
\begin{multicols}{2}
\begin{enumerate}\lxAddClass{columns2}
\item $\ds f(x) = \sqrt{x-1} + \sqrt{5-x}$
\item $\ds f(x) = x\sin x$
\item $\ds f(x) = \tan x$
\item $\ds f(x) = \sqrt{\ln x}$
\end{enumerate}
\end{multicols}
\solution
We examine each in turn, applying Theorems \ref{thm:continuity_algebra} and \ref{thm:continuous_functions} as appropriate.
\mtable{A graph of $f$ in\\\autoref{ex_cont_funct}(1).}{fig_continuous3}{\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=-.4,ymax=3.2,xmin=-.4,xmax=5.4,name=myplot]
\addplot [draw={\colorone},smooth,thick,domain=1:5] {sqrt(x-1)+sqrt(5-x)};
\fill[black,draw=black] (axis cs:1,2) circle (1pt);
\fill[black,draw=black] (axis cs:5,2) circle (1pt);
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}}
\begin{enumerate}
\item The two square-root terms are continuous on the intervals $[1,\infty)$ and $(-\infty,5]$, respectively. As $f$ is continuous only where each term is continuous, $f$ is continuous on the intersection of these two intervals: $[1,5]$. A graph of $f$ is displayed in \autoref{fig_continuous3}.
\item The functions $y=x$ and $y=\sin x$ are each continuous everywhere, hence their product is, too.
\item \autoref{thm:continuous_functions} states that $f(x) = \tan x$ is continuous ``on its domain.'' Its domain includes all real numbers except odd multiples of $\pi/2$. Thus $f(x) = \tan x$ is continuous on
\[
\dotsc, \left(-\frac{3\pi}{2},-\frac{\pi}2\right),\ \left(-\frac{\pi}2,\frac{\pi}2\right),\ \left(\frac{\pi}2,\frac{3\pi}2\right),\dotsc
\]
or, equivalently, on $D = \{x\in \mathbb{R}\ \vert\ x\neq \frac{(2n+1)\pi}2,\ n\in\mathbb{Z}\}$.
\item The domain of $y = \sqrt{x}$ is $[0,\infty)$. The range of $y=\ln x$ is $(-\infty,\infty)$, but if we restrict its domain to $[1,\infty)$ its range is $[0,\infty)$. So restricting $y = \ln x$ to the domain of $[1,\infty)$ restricts its output is $[0,\infty)$, on which $y = \sqrt{x}$ is defined. Thus the domain of $f(x) = \sqrt{\ln x}$ is $[1,\infty)$.
\end{enumerate}
\end{example}
A common way of thinking of a continuous function is that ``its graph can be sketched without lifting your pencil.'' That is, its graph forms a ``continuous'' curve, without holes, breaks or jumps. While beyond the scope of this text, this pseudo-definition glosses over some of the finer points of continuity. Very strange functions are continuous that one would be hard pressed to actually sketch by hand.
This intuitive notion of continuity does help us understand another important concept as follows. Suppose $f$ is defined on $[1,2]$ and $f(1) = -10$ and $f(2) = 5$. If $f$ is continuous on $[1,2]$ (i.e., its graph can be sketched as a continuous curve from $(1,-10)$ to $(2,5)$) then we know intuitively that somewhere on $[1,2]$ $f$ must be equal to $-9$, and $-8$, and $-7,\ -6,\ \dotsc,\ 0,\ 1/2,$ etc. In short, $f$ takes on all \emph{intermediate} values between $-10$ and $5$. It may take on more values; $f$ may actually equal 6 at some time, for instance, but we are guaranteed all values between $-10$ and 5.
While this notion seems intuitive, it is not trivial to prove and its importance is profound. Therefore the concept is stated in the form of a theorem and illustrated in \autoref{fig_ivt}.
\mtable[-1in]{A situation where the Intermediate Value Theorem applies (top) and does not (bottom).}{fig_ivt}{%
\begin{tikzpicture}
\begin{axis}[width=\marginparwidth, xtick={.7, 1.5, 4.7}, xticklabels={\scriptsize{$a$},\scriptsize{$c$},\scriptsize{$b$}}, ytick={.54, 2.98,4.16},yticklabels={\scriptsize{$f(b)$},\scriptsize{$L$},\scriptsize{$f(a)$}}, axis y line=middle,axis x line=middle, ymin=-.5, ymax=5.5, xmin=-.5, xmax=5.2, name=myplot]
\addplot[draw={\colorone}, domain=0:5, thick, smooth] {.2*(x-2)*(x-2)*(x-2)-2*(x-2)+2};
\draw[draw={\colortwo},thick] (axis cs:1.5,0) -- (axis cs: 1.5,2.98);
\draw[draw={\colortwo},thick] (axis cs:1.5,2.98) -- (axis cs: 0,2.98);
\draw[dashed,thin](axis cs: .7,0)--(axis cs:.7,4.16);
\draw[dashed,thin](axis cs: .7,4.16)--(axis cs:0,4.16);
\draw[dashed,thin](axis cs: 4.7,0)--(axis cs:4.7,.54);
\draw[dashed,thin](axis cs: 4.7,.54)--(axis cs:0,.54);
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\node[\colorone] at (3.5,1.1){\scriptsize $y=f(x)$};
\end{tikzpicture}
\\ (a) \\
\begin{tikzpicture}
\begin{axis}[width=\marginparwidth, axis y line=middle, axis x line=middle, name=myplot, ymin=-.5, ymax=5.5, xmin=-.5, xmax=4.2, xtick={1,2,3.5}, xticklabels={\scriptsize{$a$},\scriptsize{?},\scriptsize{$b$}}, ytick={.5,1.5,3.5},yticklabels={\scriptsize{$f(a)$}, \scriptsize{$L$}, \scriptsize{$f(b)$}}]
\addplot[draw={\colorone}, domain=0:2, thick, smooth] {x/2};
\addplot[draw={\colorone}, domain=2:4, thick, smooth] {x};
\fill[thick] (axis cs:2,2) circle (1.5pt);
\fill[white,draw=black,thick] (axis cs:2,1) circle (1.5pt);
\draw[draw={\colortwo}, thick](axis cs: 2,0) -- (axis cs: 2,1.5);
\draw[draw={\colortwo},thick](axis cs: 2,1.5)--(axis cs: 0,1.5);
\draw[dashed,thin](axis cs: 1,0)--(axis cs:1,.5);
\draw[dashed,thin](axis cs: 1,.5)--(axis cs:0,.5);
\draw[dashed,thin](axis cs: 3.5,0)--(axis cs:3.5,3.5);
\draw[dashed,thin](axis cs: 3.5,3.5)--(axis cs:0,3.5);
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\node[\colorone] at (3,2.3){\scriptsize $y=f(x)$};
\end{tikzpicture}
\\ (b)}
\begin{theorem}[Intermediate Value Theorem]\label{thm:IVT}
Let $f$ be a continuous function on $[a,b]$ and, without loss of generality, let $f(a) < f(b)$. Then for every value $y$, where $f(a) < y < f(b)$, there exists at least one value $c$ in $(a,b)$ such that $f(c) = y$\index{Intermediate Value Theorem}
\end{theorem}
%\hfill\hyperref[pf:IVT]{(see the proof)}
%The Intermediate Value Theorem appears entirely obvious, but it actually depends on a subtle property of the real numbers called completeness. The theorem does not hold if we use the rational numbers in place of the real numbers. For example, we can use $f(x)=x^2-2$, $a=0$ and $b=2$. Then there is no rational number so that $f(c)=0$.
One important application of the Intermediate Value Theorem is root finding. Given a function $f$, we are often interested in finding values of $x$ where $f(x) = 0$. These roots may be very difficult to find exactly. Good approximations can be found through successive applications of this theorem. Suppose through direct computation we find that $f(a) <0 $ and $f(b)>0$, where $a<b$. The Intermediate Value Theorem states that there exists at least one $c$ in $[a,b]$ such that $f(c) = 0$. The theorem does not give us any clue as to where that value is in the interval $[a,b]$, just that it exists.
\begin{example}[Finding roots]\label{ex_root_exists}
Show that $f(x)=x^3+x+3$ has at least one real root.
\solution
We must determine an interval on which the function changes from positive to negative values. We start by evaluating $f$ at different values. We see that $f(0)=3>0$ and $f(1)=5>0$. As we choose larger positive values of $x$, we can see that $f(x)$ values will continue to grow. Looking at negative $x$-values, $f(-1)=1>0$ and $f(-2)=-7<0$ so we know $f(x)$ must change sign in $[-2,-1]$. Because $f(x)$ is a polynomial, it is continuous on all real numbers so is continuous on $[-2,-1]$. By the Intermediate Value Theorem there is a $c$ in $(-2,-1)$ where $f(x)=0$. Thus $f(x)$ must have at least one real root on $(-2,-1)$.
\end{example}
Note that in the above example you were not asked to find the root, just to show that the function \emph{had} a root. %We could find a smaller interval that would better approximate the root using the \textbf{Bisection Method}. We demonstrate this in the following example.
There is a technique that produces a good approximation of $c$. Let $d$ be the midpoint of the interval $[a,b]$ and consider $f(d)$. There are three possibilities:
\begin{enumerate}
\item $f(d) = 0$ --- we got lucky and stumbled on the actual value. We stop as we found a root.
\item $f(d) <0$ Then we know there is a root of $f$ on the interval $[d,b]$ --- we have halved the size of our interval, hence are closer to a good approximation of the root.
\item $f(d) >0$ Then we know there is a root of $f$ on the interval $[a,d]$ --- again,we have halved the size of our interval, hence are closer to a good approximation of the root.
\end{enumerate}
Successively applying this technique is called the \textbf{Bisection Method} \index{Bisection Method} of root finding. We continue until the interval is sufficiently small. We demonstrate this in the following example.
\mtable{Graphing a root of\\
$f(x) = x-\cos x$.}{fig:xminuscosx}{\begin{tikzpicture}
\begin{axis}[width=\marginparwidth,tick label style={font=\scriptsize},
minor x tick num=4,axis y line=middle,axis x line=middle,
ymin=-1.1,ymax=.7,xmin=-.05,xmax=1.07,name=myplot]
\addplot [draw={\colorone},smooth,thick,domain=0:1] {x-cos(deg(x))};
\end{axis}
\node [right] at (myplot.right of origin) {\scriptsize $x$};
\node [above] at (myplot.above origin) {\scriptsize $y$};
\end{tikzpicture}}
\begin{example}[Using the Bisection Method]\label{ex_bisect_method}
Approximate the root of $f(x) = x-\cos x$, accurate to three places after the decimal.
\solution
Consider the graph of $f(x) = x-\cos x$, shown in \autoref{fig:xminuscosx}. It is clear that the graph crosses the $x$-axis somewhere near $x=0.8$. To start the Bisection Method, pick an interval that contains $0.8$. We choose $[0.7,0.9]$. Note that all we care about are signs of $f(x)$, not their actual value, so this is all we display.
\begin{description}
\item[Iteration 1:] $f(0.7) < 0$, $f(0.9) > 0$, and $f(0.8) >0$. So replace $0.9$ with $0.8$ and repeat.
\item[Iteration 2:] $f(0.7)<0$, $f(0.8) > 0$, and at the midpoint, $0.75$, we see that $f(0.75) >0 $. So replace $0.8$ with $0.75$ and repeat. Note that we don't need to continue to check the endpoints, just the midpoint. Thus we put the rest of the iterations in \autoref{table:rootfinding}.
\end{description}
\mtable{Iterations of the Bisection Method of Root Finding}{table:rootfinding}%
{\footnotesize\noindent \begin{tabular}{ c c c }
\hspace{-1em}\parbox{2.3em}{Itera-\\tion~\#}\hspace{-1em} & Interval & Midpoint Sign \\ \midrule
1 & $[0.7,0.9]$ & $f(0.8) >0$ \\
2 & $[0.7,0.8] $ & $f(0.75) >0$ \\
3 & $[0.7,0.75]$ & $f(0.725)<0$\\
4 & $[0.725,0.75]$ & $f(0.7375)<0$\\
5 & $[0.7375,0.75]$ & $f(0.7438)>0$\\
6 & $[0.7375,0.7438]$ & $f(0.7407)>0$\\
7 & $[0.7375,0.7407]$ & $f(0.7391)>0$\\
8 & $[0.7375,0.7391]$ & $f(0.7383)<0$\\
9 & $[0.7383,0.7391]$ & $f(0.7387)<0$\\
10 & $[0.7387,0.7391]$ & $f(0.7389)<0$\\
11 & $[0.7389,0.7391]$ & $f(0.7390)<0$\\
12 & $[0.7390,0.7391]$
\end{tabular}}%
Notice that in the 12$^\text{th}$ iteration we have the endpoints of the interval each starting with $0.739$. Thus we have narrowed the zero down to an accuracy of the first three places after the decimal. Using a computer, we have
\[ f(0.7390) = -0.00014, \quad f(0.7391) = 0.000024.\]
Either endpoint of the interval gives a good approximation of where $f$ is 0. The Intermediate Value Theorem states that the actual zero is still within this interval. While we do not know its exact value, we know it starts with $0.739$.
This type of exercise is rarely done by hand. Rather, it is simple to program a computer to run such an algorithm and stop when the endpoints differ by a preset small amount. One of the authors did write such a program and found the zero of $f$, accurate to 10 places after the decimal, to be 0.7390851332. While it took a few minutes to write the program, it took less than a thousandth of a second for the program to run the necessary 35 iterations. In less than 8 hundredths of a second, the zero was calculated to 100 decimal places (with less than 200 iterations).
\end{example}
It is a simple matter to extend the Bisection Method to solve problems similar to ``Find $x$, where $f(x) = 0$.'' For instance, we can find $x$, where $f(x) = 1$. %This may seem obvious, but to many it is not.
It actually works very well to define a new function $g$ where $g(x) = f(x) - 1$. Then use the Bisection Method to solve $g(x)=0$.
Similarly, given two functions $f$ and $g$, we can use the Bisection Method to solve $f(x) = g(x)$. Once again, create a new function $h$ where $h(x) = f(x)-g(x)$ and solve $h(x) = 0$.
In \autoref{sec:newton} another equation solving method will be introduced, called Newton's Method. In many cases, Newton's Method is much faster. It relies on more advanced mathematics, though, so we will wait before introducing it.
This section formally defined what it means to be a continuous function. ``Most'' functions that we deal with are continuous, so often it feels odd to have to formally define this concept. Regardless, it is important, and forms the basis of the next chapter.
\ifbool{latexml}{
\printexercises{exercises/01-05-exercises}
}{}
\section*{Chapter Summary}
In this chapter we:
\begin{itemize}
\item defined the limit,
\item found accessible ways to approximate their values numerically and graphically,
\item developed a method of proving the value of a limit ($\epsilon$-$\delta$ proofs),
\item explored when limits do not exist,
\item considered limits that involved infinity, and
\item defined continuity and explored properties of continuous functions.
\end{itemize}
Why? Mathematics is famous for building on itself and calculus proves to be no exception. In the next chapter we will be interested in ``dividing by 0.'' That is, we will want to divide a quantity by a smaller and smaller number and see what value the quotient approaches. In other words, we will want to find a limit. These limits will enable us to, among other things, determine \emph{exactly} how fast something is moving when we are only given position information.
Later, we will want to add up an infinite list of numbers. We will do so by first adding up a finite list of numbers, then take a limit as the number of things we are adding approaches infinity. Surprisingly, this sum often is finite; that is, we can add up an infinite list of numbers and get, for instance, 42.
These are just two quick examples of why we are interested in limits. Many students dislike this topic when they are first introduced to it, but over time an appreciation is often formed based on the scope of its applicability.
\ifbool{latexml}{}{
\printexercises{exercises/01-05-exercises}
}
% todo Find an interactive example of the bisection method where you specify the function and endpoints