align fix; theorem style; condition number

This commit is contained in:
jverzani
2024-10-31 14:22:21 -04:00
parent 3e7e3a9727
commit 18aae2aa93
61 changed files with 1705 additions and 819 deletions

View File

@@ -16,6 +16,8 @@ using SymPy
---
![A Möbius strip by Koo Jeong A](figures/korean-mobius.jpg){width=40%}
The definition Google finds for *continuous* is *forming an unbroken whole; without interruption*.
@@ -54,12 +56,15 @@ However, [Cauchy](http://en.wikipedia.org/wiki/Cours_d%27Analyse) defined contin
The [modern](http://en.wikipedia.org/wiki/Continuous_function#History) definition simply pushes the details to the definition of the limit:
::: {.callout-note icon=false}
## Definition of continuity at a point
> A function $f(x)$ is continuous at $x=c$ if $\lim_{x \rightarrow c}f(x) = f(c)$.
A function $f(x)$ is continuous at $x=c$ if $\lim_{x \rightarrow c}f(x) = f(c)$.
:::
This says three things
The definition says three things
* The limit exists at $c$.
@@ -67,11 +72,14 @@ This says three things
* The value of the limit is the same as $f(c)$.
This speaks to continuity at a point, we can extend this to continuity over an interval $(a,b)$ by saying:
The defined speaks to continuity at a point, we can extend it to continuity over an interval $(a,b)$ by saying:
::: {.callout-note icon=false}
## Definition of continuity over an open interval
> A function $f(x)$ is continuous over $(a,b)$ if at each point $c$ with $a < c < b$, $f(x)$ is continuous at $c$.
A function $f(x)$ is continuous over $(a,b)$ if at each point $c$ with $a < c < b$, $f(x)$ is continuous at $c$.
:::
Finally, as with limits, it can be convenient to speak of *right* continuity and *left* continuity at a point, where the limit in the definition is replaced by a right or left limit, as appropriate.
@@ -192,7 +200,7 @@ $$
What value of $c$ will make $f(x)$ a continuous function?
We note that for $x < 0$ and for $x > 0$ the function is a simple polynomial, so is continuous. At $x=0$ to be continuous we need a limit to exists and be equal to $f(0)$, which is $c$. A limit exists if the left and right limits are equal. This means we need to solve for $c$ to make the left and right limits equal. We do this next with a bit of overkill in this case:
We note that for $x < 0$ and for $x > 0$ the function is defined by a simple polynomial, so is continuous. At $x=0$ to be continuous we need a limit to exists and be equal to $f(0)$, which is $c$. A limit exists if the left and right limits are equal. This means we need to solve for $c$ to make the left and right limits equal. We do this next with a bit of overkill in this case:
```{julia}
@@ -206,7 +214,7 @@ We need to solve for $c$ to make `del` zero:
```{julia}
solve(del, c)
solve(del ~ 0, c)
```
This gives the value of $c$.

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@@ -17,14 +17,19 @@ using SymPy
---
Continuity for functions is a valued property which carries implications. In this section we discuss two: the intermediate value theorem and the extreme value theorem. These two theorems speak to some fundamental applications of calculus: finding zeros of a function and finding extrema of a function.
![Between points M and M lies an F](figures/ivt.jpg){width=40%}
Continuity for functions is a valued property which carries implications. In this section we discuss two: the intermediate value theorem and the extreme value theorem. These two theorems speak to some fundamental applications of calculus: finding zeros of a function and finding extrema of a function. [L'Hospitals](https://ia801601.us.archive.org/26/items/infinimentpetits1716lhos00uoft/infinimentpetits1716lhos00uoft.pdf) figure 55, above, suggests why.
## Intermediate Value Theorem
::: {.callout-note icon=false}
## The intermediate value theorem
> The *intermediate value theorem*: If $f$ is continuous on $[a,b]$ with, say, $f(a) < f(b)$, then for any $y$ with $f(a) \leq y \leq f(b)$ there exists a $c$ in $[a,b]$ with $f(c) = y$.
If $f$ is continuous on $[a,b]$ with, say, $f(a) < f(b)$, then for any $y$ with $f(a) \leq y \leq f(b)$ there exists a $c$ in $[a,b]$ with $f(c) = y$.
:::
```{julia}
@@ -98,7 +103,9 @@ sign_chart(f, -3, 3)
The intermediate value theorem can find the sign of the function *between* adjacent zeros, but how are the zeros identified?
Here, we use the Bolzano theorem to give an algorithm - the *bisection method* - to locate a value $c$ in $[a,b]$ with $f(c) = 0$ under the assumptions:
* $f$ is continuous on $[a,b]$
* $f$ changes sign between $a$ and $b$. (In particular, when $f(a)$ and $f(b)$ have different signs.)
::: {.callout-note}
@@ -375,11 +382,11 @@ For symbolic expressions, as below, then, as a convenience, an equation (formed
```{julia}
@syms x
solve(cos(x) ~ x, (0, 2))
find_zero(cos(x) ~ x, (0, 2))
```
:::
[![Intersection of two curves as illustrated by Canadian artist Kapwani Kiwanga.](figures/intersection-biennale.jpg)](https://www.gallery.ca/whats-on/touring-exhibitions-and-loans/around-the-world/canada-pavilion-at-the-venice-biennale/kapwani-kiwanga-trinket)
[![Intersection of two curves as illustrated by Canadian artist Kapwani Kiwanga.](figures/intersection-biennale.jpg)](https://www.gallery.ca/whats-on/touring-exhibitions-and-loans/around-the-world/canada-pavilion-at-the-venice-biennale/kapwani-kiwanga-trinket){width=40%}
##### Example: Inverse functions
@@ -496,11 +503,12 @@ For the model without wind resistance, we can graph the function easily enough.
plot(j, 0, 500)
```
Well, we haven't even seen the peak yet. Better to do a little spade work first. This is a quadratic function, so we can use `roots` from `SymPy` to find the roots:
Well, we haven't even seen the peak yet. Better to do a little spade work first. This is a quadratic function, so we can use `solve` from `SymPy` to find the roots:
```{julia}
roots(j(x))
@syms x
solve(j(x) ~ 0, x)
```
We see that $1250$ is the largest root. So we plot over this domain to visualize the flight:
@@ -706,22 +714,25 @@ The Extreme Value Theorem is another consequence of continuity.
To discuss the extreme value theorem, we define an *absolute maximum*.
::: {.callout-note icon=false}
## Absolute maximum, absolute minimum
> The absolute maximum of $f(x)$ over an interval $I$, when it exists, is the value $f(c)$, $c$ in $I$, where $f(x) \leq f(c)$ for any $x$ in $I$.
>
> Similarly, an *absolute minimum* of $f(x)$ over an interval $I$ can be defined, when it exists, by a value $f(c)$ where $c$ is in $I$ *and* $f(c) \leq f(x)$ for any $x$ in $I$.
The absolute maximum of $f(x)$ over an interval $I$, when it exists, is the value $f(c)$, $c$ in $I$, where $f(x) \leq f(c)$ for any $x$ in $I$.
Similarly, an *absolute minimum* of $f(x)$ over an interval $I$ can be defined, when it exists, by a value $f(c)$ where $c$ is in $I$ *and* $f(c) \leq f(x)$ for any $x$ in $I$.
:::
Related but different is the concept of a relative of *local extrema*:
::: {.callout-note icon=false}
## Local maximum, local minimum
> A local maxima for $f$ is a value $f(c)$ where $c$ is in **some** *open* interval $I=(a,b)$, $I$ in the domain of $f$, and $f(c)$ is an absolute maxima for $f$ over $I$. Similarly, an local minima for $f$ is a value $f(c)$ where $c$ is in **some** *open* interval $I=(a,b)$, $I$ in the domain of $f$, and $f(x)$ is an absolute minima for $f$ over $I$.
A local maxima for $f$ is a value $f(c)$ where $c$ is in **some** *open* interval $I=(a,b)$, $I$ in the domain of $f$, and $f(c)$ is an absolute maxima for $f$ over $I$. Similarly, an local minima for $f$ is a value $f(c)$ where $c$ is in **some** *open* interval $I=(a,b)$, $I$ in the domain of $f$, and $f(x)$ is an absolute minima for $f$ over $I$.
The term *local extrema* is used to describe either a local maximum or local minimum.
:::
The key point, is the extrema are values in the *range* that are realized by some value in the *domain* (possibly more than one.)
@@ -742,14 +753,16 @@ nothing
```
[![Elevation profile of the Hardrock 100 ultramarathon. Treating the elevation profile as a function, the absolute maximum is just about 14,000 feet and the absolute minimum about 7600 feet. These are of interest to the runner for different reasons. Also of interest would be each local maxima and local minima - the peaks and valleys of the graph - and the total elevation climbed - the latter so important/unforgettable its value makes it into the chart's title.
](limits/figures/hardrock-100.jpeg)](https://hardrock100.com)
](figures/hardrock-100.jpeg)](https://hardrock100.com){width=50%}
The extreme value theorem discusses an assumption that ensures absolute maximum and absolute minimum values exist.
::: {.callout-note icon=false}
## The extreme value theorem
> The *extreme value theorem*: If $f(x)$ is continuous over a closed interval $[a,b]$ then $f$ has an absolute maximum and an absolute minimum over $[a,b]$.
If $f(x)$ is continuous over a closed interval $[a,b]$ then $f$ has an absolute maximum and an absolute minimum over $[a,b]$.
:::
(By continuous over $[a,b]$ we mean continuous on $(a,b)$ and right continuous at $a$ and left continuous at $b$.)
@@ -1013,7 +1026,7 @@ nothing
```
![Trajectories of potential cannonball fires with air-resistance included. (http://ej.iop.org/images/0143-0807/33/1/149/Full/ejp405251f1_online.jpg)
](figures/cannonball.jpg)
](figures/cannonball.jpg){width=50%}
In 1638, according to Amir D. [Aczel](http://books.google.com/books?id=kvGt2OlUnQ4C&pg=PA28&lpg=PA28&dq=mersenne+cannon+ball+tests&source=bl&ots=wEUd7e0jFk&sig=LpFuPoUvODzJdaoug4CJsIGZZHw&hl=en&sa=X&ei=KUGcU6OAKJCfyASnioCoBA&ved=0CCEQ6AEwAA#v=onepage&q=mersenne%20cannon%20ball%20tests&f=false), an experiment was performed in the French Countryside. A monk, Marin Mersenne, launched a cannonball straight up into the air in an attempt to help Descartes prove facts about the rotation of the earth. Though the experiment was not successful, Mersenne later observed that the time for the cannonball to go up was greater than the time to come down. ["Vertical Projection in a Resisting Medium: Reflections on Observations of Mersenne".](http://www.maa.org/publications/periodicals/american-mathematical-monthly/american-mathematical-monthly-contents-junejuly-2014)

View File

@@ -181,9 +181,12 @@ Informally, if a limit exists it is the value that $f(x)$ gets close to as $x$ g
The modern formulation is due to Weierstrass:
::: {.callout-note icon=false}
## The $\epsilon-\delta$ Definition of a limit of $f(x)$
> The limit of $f(x)$ as $x$ approaches $c$ is $L$ if for every real $\epsilon > 0$, there exists a real $\delta > 0$ such that for all real $x$, $0 < \lvert x c \rvert < \delta$ implies $\lvert f(x) L \rvert < \epsilon$. The notation used is $\lim_{x \rightarrow c}f(x) = L$.
The limit of $f(x)$ as $x$ approaches $c$ is $L$ if for every real $\epsilon > 0$, there exists a real $\delta > 0$ such that for all real $x$, $0 < \lvert x c \rvert < \delta$ implies $\lvert f(x) L \rvert < \epsilon$. The notation used is $\lim_{x \rightarrow c}f(x) = L$.
:::
We comment on this later.
@@ -266,14 +269,14 @@ xs = [1/10^i for i in 1:5]
This progression can be seen to be increasing. Cauchy, in his treatise, can see this through:
$$
\begin{align*}
(1 + \frac{1}{m})^n &= 1 + \frac{1}{1} + \frac{1}{1\cdot 2}(1 - \frac{1}{m}) + \\
& \frac{1}{1\cdot 2\cdot 3}(1 - \frac{1}{m})(1 - \frac{2}{m}) + \cdots \\
&+
\frac{1}{1 \cdot 2 \cdot \cdots \cdot m}(1 - \frac{1}{m}) \cdot \cdots \cdot (1 - \frac{m-1}{m}).
\end{align*}
$$
These values are clearly increasing as $m$ increases. Cauchy showed the value was bounded between $2$ and $3$ and had the approximate value above. Then he showed the restriction to integers was not necessary. Later we will use this definition for the exponential function:
@@ -597,6 +600,7 @@ Hmm, the values in `ys` appear to be going to $0.5$, but then end up at $0$. Is
```{julia}
xs = [1/10^i for i in 1:8]
y1s = [1 - cos(x) for x in xs]
y2s = [x^2 for x in xs]
[xs y1s y2s]
@@ -722,7 +726,7 @@ For example, the limit at $0$ of $(1-\cos(x))/x^2$ is easily handled:
limit((1 - cos(x)) / x^2, x => 0)
```
The pair notation (`x => 0`) is used to indicate the variable and the value it is going to. A `dir` argument is used to indicate ``x \rightarrow c+`` (the default), ``x \rightarrow c-``, and ``x \rightarrow c``.
The pair notation (`x => 0`) is used to indicate the variable and the value it is going to. A `dir` argument is used to indicate $x \rightarrow c+$ (the default, or `dir="+"`), $x \rightarrow c-$ (`dir="-"`), and $x \rightarrow c$ (`dir="+-"`).
##### Example
@@ -856,7 +860,7 @@ This accurately shows the limit does not exist mathematically, but `limit(ceil(x
The `limit` function doesn't compute limits from the definition, rather it applies some known facts about functions within a set of rules. Some of these rules are the following. Suppose the individual limits of $f$ and $g$ always exist (and are finite) below.
$$
\begin{align*}
\lim_{x \rightarrow c} (a \cdot f(x) + b \cdot g(x)) &= a \cdot
\lim_{x \rightarrow c} f(x) + b \cdot \lim_{x \rightarrow c} g(x)
@@ -870,7 +874,7 @@ The `limit` function doesn't compute limits from the definition, rather it appli
\frac{\lim_{x \rightarrow c} f(x)}{\lim_{x \rightarrow c} g(x)}
&(\text{provided }\lim_{x \rightarrow c} g(x) \neq 0)\\
\end{align*}
$$
These are verbally described as follows, when the individual limits exist and are finite then:
@@ -920,7 +924,7 @@ $$
This is clearly related to the function $f(x) = \sin(x)/x$, which has a limit of $1$ as $x \rightarrow 0$. We see $g(x) = k f(kx)$ is the limit in question. As $kx \rightarrow 0$, though not taking a value of $0$ except when $x=0$, the limit above is $k \lim_{x \rightarrow 0} f(kx) = k \lim_{u \rightarrow 0} f(u) = k$.
Basically when taking a limit as $x$ goes to $0$ we can multiply $x$ by any constant and figure out the limit for that. (It is as though we "go to" $0$ faster or slower. but are still going to $0$.
Basically when taking a limit as $x$ goes to $0$ we can multiply $x$ by any constant and figure out the limit for that. (It is as though we "go to" $0$ faster or slower, but are still going to $0$.)
Similarly,

View File

@@ -22,6 +22,8 @@ nothing
---
![To infinity and beyond](figures/buzz-infinity.jpg){width=40%}
The limit of a function at $c$ need not exist for one of many different reasons. Some of these reasons can be handled with extensions to the concept of the limit, others are just problematic in terms of limits. This section covers examples of each.
@@ -97,8 +99,11 @@ But unlike the previous example, this function *would* have a limit if the defin
Let's loosen up the language in the definition of a limit to read:
> The limit of $f(x)$ as $x$ approaches $c$ is $L$ if for every neighborhood, $V$, of $L$ there is a neighborhood, $U$, of $c$ for which $f(x)$ is in $V$ for every $x$ in $U$, except possibly $x=c$.
::: {.callout-note icon=false}
The limit of $f(x)$ as $x$ approaches $c$ is $L$ if for every neighborhood, $V$, of $L$ there is a neighborhood, $U$, of $c$ for which $f(x)$ is in $V$ for every $x$ in $U$, except possibly $x=c$.
:::
The $\epsilon-\delta$ definition has $V = (L-\epsilon, L + \epsilon)$ and $U=(c-\delta, c+\delta)$. This is a rewriting of $L-\epsilon < f(x) < L + \epsilon$ as $|f(x) - L| < \epsilon$.
@@ -106,12 +111,16 @@ The $\epsilon-\delta$ definition has $V = (L-\epsilon, L + \epsilon)$ and $U=(c-
Now for the definition:
::: {.callout-note icon=false}
## The $\epsilon-\delta$ Definition of a right limit
> A function $f(x)$ has a limit on the right of $c$, written $\lim_{x \rightarrow c+}f(x) = L$ if for every $\epsilon > 0$, there exists a $\delta > 0$ such that whenever $0 < x - c < \delta$ it holds that $|f(x) - L| < \epsilon$. That is, $U$ is $(c, c+\delta)$
A function $f(x)$ has a limit on the right of $c$, written $\lim_{x \rightarrow c+}f(x) = L$ if for every $\epsilon > 0$, there exists a $\delta > 0$ such that whenever $0 < x - c < \delta$ it holds that $|f(x) - L| < \epsilon$. That is, $U$ is $(c, c+\delta)$
Similarly, a limit on the left is defined where $U=(c-\delta, c)$.
:::
The `SymPy` function `limit` has a keyword argument `dir="+"` or `dir="-"` to request that a one-sided limit be formed. The default is `dir="+"`. Passing `dir="+-"` will compute both one side limits, and throw an error if the two are not equal, in agreement with no limit existing.
@@ -354,7 +363,7 @@ limit(g(x), x=>0, dir="+")
## Limits of sequences
After all this, we still can't formalize the basic question asked in the introduction to limits: what is the area contained in a parabola. For that we developed a sequence of sums: $s_n = 1/2 \cdot((1/4)^0 + (1/4)^1 + (1/4)^2 + \cdots + (1/4)^n)$. This isn't a function of $x$, but rather depends only on non-negative integer values of $n$. However, the same idea as a limit at infinity can be used to define a limit.
After all this, we still can't formalize the basic question asked in the introduction to limits: what is the area contained in a parabola. For that we developed a sequence of sums: $s_n = 1/2 \cdot((1/4)^0 + (1/4)^1 + (1/4)^2 + \cdots + (1/4)^n)$. This isn't a function of real $x$, but rather depends only on non-negative integer values of $n$. However, the same idea as a limit at infinity can be used to define a limit.
> Let $a_0,a_1, a_2, \dots, a_n, \dots$ be a sequence of values indexed by $n$. We have $\lim_{n \rightarrow \infty} a_n = L$ if for every $\epsilon > 0$ there exists an $M>0$ where if $n > M$ then $|a_n - L| < \epsilon$.