lots of cleanup
This commit is contained in:
1 parent
ae461659e0
commit
253295ff6e
91 files changed
+18268
-7856
No files matched your search
@@ -1,9 +1,12 @@
|
||||
[deps]
|
||||
AbbreviatedStackTraces = "ac637c84-cc71-43bf-9c33-c1b4316be3d4"
|
||||
CalculusWithJulia = "a2e0e22d-7d4c-5312-9169-8b992201a882"
|
||||
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
|
||||
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
|
||||
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
|
||||
Mustache = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70"
|
||||
PlotlyBase = "a03496cd-edff-5a9b-9e67-9cda94a718b5"
|
||||
PlotlyKaleido = "f2990250-8cf9-495f-b13a-cce12b45703c"
|
||||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
||||
QuizQuestions = "612c44de-1021-4a21-84fb-7261cf5eb2d4"
|
||||
Richardson = "708f8203-808e-40c0-ba2d-98a6953ed40d"
|
||||
|
||||
@@ -16,7 +16,11 @@ using SymPy
|
||||
|
||||
---
|
||||
|
||||
{width=40%}
|
||||
::: {#fig-mobius-strip-biennale}
|
||||
{width=40%}
|
||||
|
||||
A Möbius strip by Koo Jeong A
|
||||
:::
|
||||
|
||||
|
||||
The definition Google finds for *continuous* is *forming an unbroken whole; without interruption*.
|
||||
@@ -25,30 +29,29 @@ The definition Google finds for *continuous* is *forming an unbroken whole; with
|
||||
The concept in calculus, as transferred to functions, is similar. Roughly speaking, a continuous function is one whose graph could be drawn without having to lift (or interrupt) the pencil drawing it.
|
||||
|
||||
|
||||
Consider these two graphs:
|
||||
|
||||
Consider the two graphs show in @fig-two-plots-one-continuous-one-not-almost-always-equal.
|
||||
|
||||
::: {#fig-two-plots-one-continuous-one-not-almost-always-equal}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
plt = plot([-1,0], [-1,-1], color=:black, legend=false, linewidth=5)
|
||||
plot!(plt, [0, 1], [ 1, 1], color=:black, linewidth=5)
|
||||
plt
|
||||
```
|
||||
|
||||
and
|
||||
|
||||
|
||||
```{julia}
|
||||
plt1 = plot([-1,0], [-1,-1], color=:black, legend=false, linewidth=5)
|
||||
plot!(plt1, [0, 1], [ 1, 1], color=:black, linewidth=5)
|
||||
plt1
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
plot([-1,-.1, .1, 1], [-1,-1, 1, 1], color=:black, legend=false, linewidth=5)
|
||||
plt2 = plot([-1,-.1, .1, 1], [-1,-1, 1, 1], color=:black, legend=false, linewidth=5)
|
||||
|
||||
plot(plt1, plt2)
|
||||
```
|
||||
|
||||
Though similar at some level - they agree at nearly every value of $x$ - the first has a "jump" from $-1$ to $1$ instead of the transition in the second one. The first is not continuous at $0$ - a break is needed to draw it - where as the second is continuous.
|
||||
Plot of two functions that are equal at most of their points
|
||||
:::
|
||||
|
||||
Though similar at some level---they agree at nearly every value of $x$--- the first has a "jump" from $-1$ to $1$ instead of the transition in the second one. The first is not continuous at $0$---a break is needed to draw it---where as the second is continuous.
|
||||
|
||||
|
||||
A formal definition of continuity was a bit harder to come about. At [first](http://en.wikipedia.org/wiki/Intermediate_value_theorem) the concept was that for any $y$ between any two values in the range for $f(x)$, the function should take on the value $y$ for some $x$. Clearly this could distinguish the two graphs above, as one takes no values in $(-1,1)$, whereas the other - the continuous one - takes on all values in that range.
|
||||
A formal definition of continuity was historically a bit harder to develop. At [first](http://en.wikipedia.org/wiki/Intermediate_value_theorem) the concept was that for any $y$ between any two values in the range for $f(x)$, the function should take on the value $y$ for some $x$. Clearly this could distinguish the two graphs above, as one takes no values in $(-1,1)$, whereas the other---the continuous one---takes on all values in that range.
|
||||
|
||||
|
||||
However, [Cauchy](http://en.wikipedia.org/wiki/Cours_d%27Analyse) defined continuity by $f(x + \alpha) - f(x)$ being small whenever $\alpha$ was small. This basically rules out "jumps" and proves more useful as a tool to describe continuity.
|
||||
@@ -56,26 +59,25 @@ 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
|
||||
::: {.definition title="Definition of continuity at a point"}
|
||||
|
||||
A function $f(x)$ is continuous at $x=c$ if $\lim_{x \rightarrow c}f(x) = f(c)$.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
The definition says three things
|
||||
The definition says three things:
|
||||
|
||||
* the limit exists at $c$;
|
||||
|
||||
* The limit exists at $c$.
|
||||
* The function is defined at $c$ ($c$ is in the domain).
|
||||
* The value of the limit is the same as $f(c)$.
|
||||
* the function is defined at $c$ ($c$ is in the domain of $f$); and
|
||||
|
||||
* the value of the limit is the same as $f(c)$.
|
||||
|
||||
|
||||
The definition 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
|
||||
::: {.definition title="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$.
|
||||
|
||||
@@ -84,7 +86,13 @@ A function $f(x)$ is continuous over $(a,b)$ if at each point $c$ with $a < 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.
|
||||
|
||||
In particular, a function is *continuous* over $[a,b]$ if it is continuous on $(a,b)$, left continuous at $b$ and right continuous at $a$.
|
||||
In particular:
|
||||
|
||||
::: {.definition title="Definition of continuity over a close interval"}
|
||||
|
||||
A function is *continuous* over $[a,b]$ if it is continuous on $(a,b)$, left continuous at $b$ and right continuous at $a$.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
:::{.callout-warning}
|
||||
@@ -102,7 +110,7 @@ Most familiar functions are continuous everywhere.
|
||||
* For example, a monomial function $f(x) = ax^n$ for non-negative, integer $n$ will be continuous. This is because the limit exists everywhere, the domain of $f$ is all $x$ and there are no jumps.
|
||||
* Similarly, the building-block trigonometric functions $\sin(x)$, $\cos(x)$ are continuous everywhere.
|
||||
* So are the exponential functions $f(x) = a^x, a > 0$.
|
||||
* The hyperbolic sine ($(e^x - e^{-x})/2$) and cosine ($(e^x + e^{-x})/2$) are, as $e^x$ is.
|
||||
* The hyperbolic sine ($(e^x - e^{-x})/2$) and cosine ($(e^x + e^{-x})/2$) are continuous everywhere, as $e^x$ is.
|
||||
* The hyperbolic tangent is, as $\cosh(x) > 0$ for all $x$.
|
||||
|
||||
|
||||
@@ -112,7 +120,7 @@ Some familiar functions are *mostly* continuous but not everywhere.
|
||||
* For example, $f(x) = \sqrt{x}$ is continuous on $(0,\infty)$ and right continuous at $0$, but it is not defined for negative $x$, so can't possibly be continuous there.
|
||||
* Similarly, $f(x) = \log(x)$ is continuous on $(0,\infty)$, but it is not defined at $x=0$, so is not right continuous at $0$.
|
||||
* The tangent function $\tan(x) = \sin(x)/\cos(x)$ is continuous everywhere *except* the points $x$ with $\cos(x) = 0$ ($\pi/2 + k\pi, k$ an integer).
|
||||
* The hyperbolic co-tangent is not continuous at $x=0$ – when $\sinh$ is $0$,
|
||||
* The hyperbolic co-tangent is not continuous at $x=0$---when $\sinh$ is $0$,
|
||||
* The semicircle $f(x) = \sqrt{1 - x^2}$ is *continuous* on $(-1, 1)$. It is not continuous at $-1$ and $1$, though it is right continuous at $-1$ and left continuous at $1$. (It is continuous on $[-1,1]$.)
|
||||
|
||||
|
||||
@@ -122,10 +130,13 @@ Some familiar functions are *mostly* continuous but not everywhere.
|
||||
There are various reasons why a function may not be continuous.
|
||||
|
||||
|
||||
* The function $f(x) = \sin(x)/x$ has a limit at $0$ but is not defined at $0$, so is not continuous at $0$. The function can be redefined to make it continuous.
|
||||
* The function $f(x) = 1/x$ is continuous everywhere *except* $x=0$ where *no* limit exists.
|
||||
* A rational function $f(x) = p(x)/q(x)$ will be continuous everywhere except where $q(x)=0$. (The function $f$ may still have a limit where $q$ is $0$, should factors cancel, but $f$ won't be defined at such values.)
|
||||
* The function
|
||||
* The function $f(x) = \sin(x)/x$ has a limit at $0$ but is not defined at $0$, so is not continuous at $0$. The function can be redefined to make it continuous.
|
||||
|
||||
* The function $f(x) = 1/x$ is continuous everywhere *except* $x=0$ where *no* limit exists.
|
||||
|
||||
* A rational function $f(x) = p(x)/q(x)$ will be continuous everywhere except where $q(x)=0$. (The function $f$ may still have a limit where $q$ is $0$, should factors cancel, but $f$ won't be defined at such values.)
|
||||
|
||||
* The function
|
||||
|
||||
|
||||
$$
|
||||
@@ -139,9 +150,10 @@ $$
|
||||
is implemented by `Julia`'s `sign` function. It has a value at $0$, but no limit at $0$, so is not continuous at $0$. Furthermore, the left and right limits exist at $0$ but are not equal to $f(0)$ so the function is not left or right continuous at $0$. It is continuous everywhere except at $x=0$.
|
||||
|
||||
|
||||
* Similarly, the function defined by this graph
|
||||
* Similarly, the function defined by the graph in @fig-line-with-removable-discontinity-at-0 is not continuous at $x=0$. It has a limit of $0$ at $0$, a function value $f(0) =1/2$, but the limit and the function value are not equal.
|
||||
|
||||
|
||||
::: {#fig-line-with-removable-discontinity-at-0}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
@@ -153,11 +165,13 @@ C = Shape(0.02 * sin.(ts), 0.03 * cos.(ts))
|
||||
plot!(C, fill=(:white,1), line=(:black, 1))
|
||||
```
|
||||
|
||||
is not continuous at $x=0$. It has a limit of $0$ at $0$, a function value $f(0) =1/2$, but the limit and the function value are not equal.
|
||||
Function with a removable discontinuity
|
||||
:::
|
||||
|
||||
|
||||
* The `floor` function, which rounds down to the nearest integer, is also not continuous at the integers, but is right continuous at the integers, as, for example, $\lim_{x \rightarrow 0+} f(x) = f(0)$. This graph emphasizes the right continuity by placing a filled marker for the value of the function when there is a jump and an open marker where the function is not that value.
|
||||
* The `floor` function, which rounds down to the nearest integer, is also not continuous at the integers, but is right continuous at the integers, as, for example, $\lim_{x \rightarrow 0+} f(x) = f(0)$. The graph in @fig-floor-function-with-left-right-limits-indicated emphasizes the right continuity by placing a filled marker for the value of the function when there is a jump and an open marker where the function is not that value.
|
||||
|
||||
::: {#fig-floor-function-with-left-right-limits-indicated}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
plt = let
|
||||
@@ -200,9 +214,13 @@ plt
|
||||
plotly()
|
||||
nothing
|
||||
```
|
||||
The `floor` function
|
||||
:::
|
||||
|
||||
* The function $f(x) = 1/x^2$ is not continuous at $x=0$: $f(x)$ is not defined at $x=0$ and $f(x)$ has no limit at $x=0$ (in the usual sense).
|
||||
* On the Wikipedia page for [continuity](https://en.wikipedia.org/wiki/Continuous_function) the example of Dirichlet's function is given:
|
||||
* The function $f(x) = 1/x^2$ is not continuous at $x=0$: $f(x)$ is not defined at $x=0$ and $f(x)$ has no limit at $x=
|
||||
0$ (in the usual sense).
|
||||
|
||||
* On the Wikipedia page for [continuity](https://en.wikipedia.org/wiki/Continuous_function) the example of Dirichlet's function is given:
|
||||
|
||||
|
||||
$$
|
||||
@@ -232,7 +250,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 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:
|
||||
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 exist *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}
|
||||
@@ -260,15 +278,18 @@ solve(ex1(x=>0) ~ ex2(x=>0), c)
|
||||
|
||||
##### Example
|
||||
|
||||
Identifying from its graph that a function is discontinuous or not can be complicated by the graphing algorithm which simply connects adjacent points with a line segment allowing the eye to fill in the dot-to-dot graphic as a curve. The default plot of the `floor` function shows a potential issue:
|
||||
Identifying from its graph that a function is discontinuous or not can be complicated by the graphing algorithm which simply connects adjacent points with a line segment allowing the eye to fill in the dot-to-dot graphic as a curve. The default plot in @fig-plot-of-floor-function-minus5-halves-to-5-halves-shows-artifacts-of-plotting of the `floor` function shows a potential issue.
|
||||
|
||||
::: {#fig-plot-of-floor-function-minus5-halves-to-5-halves-shows-artifacts-of-plotting}
|
||||
```{julia}
|
||||
plot(floor, -5/2, 5/2; label=false)
|
||||
plot(floor, -5/2, 5/2; legend=false)
|
||||
```
|
||||
The `floor` function plotted without taking care of the discontinuties may appear "continuous"
|
||||
:::
|
||||
|
||||
The "risers" on the steps are an artifact of the basic dot-to-dot algorithm, which assumes continuity between adjacent points (we were more careful in our earlier plot of this function).
|
||||
The "risers" on the steps are an artifact of the basic dot-to-dot algorithm, which assumes continuity between adjacent points (we were more careful in our earlier plot of this function in @fig-floor-function-with-left-right-limits-indicated).
|
||||
|
||||
The following simple function just plots a bunch of points, leaving the eye to fill in the line, though so many points are chosen this doesn't require much effort for simple cases. This function also plots a point on the $x$- and $y$-axes (emphasized by the argument `framestyle=:origin`) for each point graphed to emphasize the range of $y$ values for the specified $x$ values.
|
||||
The following simple function just plots a bunch of points, leaving the eye to fill in the line, though so many points are chosen this doesn't require much effort for simple cases. This function also plots a point on the $x$- and $y$-axes (emphasized by the argument `framestyle=:origin`) for each point graphed to emphasize the range of $y$ values for the specified $x$ values. @fig-pixel-plot-function-kinda-silly-but-just-points-loads shows the `floor` function plotted this way.
|
||||
|
||||
```{julia}
|
||||
function pixel_plot(f, a, b; kwargs...)
|
||||
@@ -280,25 +301,33 @@ function pixel_plot(f, a, b; kwargs...)
|
||||
p = plot(;framestyle=:origin, legend=false, kwargs...)
|
||||
|
||||
scatter!(p, xs, ys; marker=(:square, :black, 1)) # f(x)
|
||||
scatter!(p, xs, zs; marker=(:square, :blue, 2, 0.03)) # domain, [a,b]
|
||||
scatter!(p, zs, ys; marker=(:square, :red, 3, 0.25)) # range
|
||||
scatter!(p, xs, zs; marker=(:square, :blue, 2, 0.03)) # domain, [a,b]
|
||||
scatter!(p, zs, ys; marker=(:square, :red, 3, 0.25)) # range
|
||||
|
||||
p
|
||||
end
|
||||
|
||||
pixel_plot(floor, -5/2, 5/2)
|
||||
```
|
||||
|
||||
The broken up range suggests a fundamentally discontinuous function. In the next section we will see this differently---that a continuous function will have an unbroken range when restricted to some interval $[a,b]$.
|
||||
::: {#fig-pixel-plot-function-kinda-silly-but-just-points-loads}
|
||||
```{julia}
|
||||
pixel_plot(floor, -5/2, 5/2)
|
||||
```
|
||||
Plot of `floor` function over $[-5/2, 5/2]$ generated by plotting many points rather than using the dot-to-dot method
|
||||
:::
|
||||
|
||||
For one more example, here we see the difference between `sin` and `sign`, as functions:
|
||||
The broken up range suggests a fundamentally discontinuous function. In the next section we will state this differently---that a continuous function *will* have an unbroken range when restricted to some interval $[a,b]$.
|
||||
|
||||
For one more example, @fig-pixel-plot-sin-sign-big-differences shows the difference between `sin` and `sign`, as functions:
|
||||
|
||||
::: {#fig-pixel-plot-sin-sign-big-differences}
|
||||
```{julia}
|
||||
p1 = pixel_plot(sin, -pi, pi; title="sin")
|
||||
p2 = pixel_plot(sign, -pi, pi; title="sign")
|
||||
plot(p1, p2)
|
||||
```
|
||||
Plot of both `sin` and `sign` functions
|
||||
|
||||
:::
|
||||
The continuous `sin` function has an unbroken range, $[-1,1]$; the discountinous `sign` function has a broken range consisting of ${-1, 0, 1}$.
|
||||
|
||||
## Rules for continuity
|
||||
@@ -306,27 +335,33 @@ The continuous `sin` function has an unbroken range, $[-1,1]$; the discountinous
|
||||
|
||||
As we've seen, functions can be combined in several ways. How do these relate with continuity?
|
||||
|
||||
|
||||
::: {.relationship title="Rules of continuity"}
|
||||
Suppose $f(x)$ and $g(x)$ are both continuous on $I$. Then:
|
||||
|
||||
* The linear combination $h(x) = a f(x) + b g(x)$ is continuous on $I$ for any real numbers $a$ and $b$;
|
||||
|
||||
* The linear combination $h(x) = a f(x) + b g(x)$ is continuous on $I$ for any real numbers $a$ and $b$;
|
||||
* The product $h(x) = f(x) \cdot g(x)$ is continuous on $I$; and
|
||||
* The quotient $h(x) = f(x) / g(x)$ is continuous at all points $c$ in $I$ **where** $g(c) \neq 0$.
|
||||
* The composition $h(x) = f(g(x))$ is continuous at $x=c$ *if* $g(x)$ is continuous at $c$ *and* $f(x)$ is continuous at $g(c)$.
|
||||
* The product $h(x) = f(x) \cdot g(x)$ is continuous on $I$; and
|
||||
|
||||
* The quotient $h(x) = f(x) / g(x)$ is continuous at all points $c$ in $I$ **where** $g(c) \neq 0$.
|
||||
|
||||
So, continuity is preserved for all of the basic operations except when dividing by $0$.
|
||||
* The composition $h(x) = f(g(x))$ is continuous at $x=c$ *if* $g(x)$ is continuous at $c$ *and* $f(x)$ is continuous at $g(c)$.
|
||||
|
||||
Continuity is preserved for all of the basic operations except when dividing by $0$.
|
||||
:::
|
||||
|
||||
|
||||
##### Examples
|
||||
|
||||
|
||||
* Since a monomial $f(x) = ax^n$ ($n$ a non-negative integer) is continuous, by the first rule, any polynomial will be continuous.
|
||||
* Since both $f(x) = e^x$ and $g(x)=\sin(x)$ are continuous everywhere, so will be $h(x) = e^x \cdot \sin(x)$.
|
||||
* Since $f(x) = e^x$ is continuous everywhere and $g(x) = -x$ is continuous everywhere, the composition $h(x) = e^{-x}$ will be continuous everywhere.
|
||||
* Since $f(x) = x$ is continuous everywhere, the function $h(x) = 1/x$ - a ratio of continuous functions - will be continuous everywhere *except* possibly at $x=0$ (where it is not continuous).
|
||||
* The function $h(x) = e^{x\ln(x)}$ will be continuous on $(0,\infty)$, the same domain that $g(x) = x\ln(x)$ is continuous. This function (which simplifies to $x^x$ when $x>0$) has a right limit at $0$ (of $1$), but is not right continuous, as $h(0)$ is not defined. (The function `h(x) = exp(x*log(x))` is not defined at `0` **but** the function `h(x) = x^x` is defined at `0.0` to be `1.0`.)
|
||||
* Since a monomial $f(x) = ax^n$ ($n$ a non-negative integer) is continuous, by the first rule, any polynomial will be continuous.
|
||||
|
||||
* Since both $f(x) = e^x$ and $g(x)=\sin(x)$ are continuous everywhere, so will be $h(x) = e^x \cdot \sin(x)$.
|
||||
|
||||
* Since $f(x) = e^x$ is continuous everywhere and $g(x) = -x$ is continuous everywhere, the composition $h(x) = e^{-x}$ will be continuous everywhere.
|
||||
|
||||
* Since $f(x) = x$ is continuous everywhere, the function $h(x) = 1/x$---a ratio of continuous functions---will be continuous everywhere *except* possibly at $x=0$ (where it is not continuous).
|
||||
|
||||
* The function $h(x) = e^{x\ln(x)}$ will be continuous on $(0,\infty)$, the same domain that $g(x) = x\ln(x)$ is continuous. This function (which simplifies to $x^x$ when $x>0$) has a right limit at $0$ (of $1$), but is not right continuous, as $h(0)$ is not defined. (In `Julia`, the function `h(x) = exp(x*log(x))` is not defined at `0` **but** the function `h(x) = x^x` is defined at `0.0` to be `1.0`.)
|
||||
|
||||
|
||||
## Questions
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+255
-202
@@ -10,7 +10,7 @@ This section uses the following add-on packages:
|
||||
using CalculusWithJulia
|
||||
using Plots
|
||||
plotly()
|
||||
using Richardson # for extrapolation
|
||||
using Richardson # for numeric limits
|
||||
using SymPy # for symbolic limits
|
||||
```
|
||||
|
||||
@@ -18,12 +18,12 @@ using SymPy # for symbolic limits
|
||||
---
|
||||
|
||||
|
||||
An historic problem in the history of math was to find the area under the graph of $f(x)=x^2$ between $[0,1]$.
|
||||
A historic problem in the history of math was to find the area under the graph of $f(x)=x^2$ between $[0,1]$.
|
||||
|
||||
|
||||
There wasn't a ready-made formula for the area of this shape, as was known for a triangle or a square. However, [Archimedes](http://en.wikipedia.org/wiki/The_Quadrature_of_the_Parabola) found a method to compute areas enclosed by a parabola and line segments that cross the parabola.
|
||||
|
||||
|
||||
::: {#fig-make-archimedes-triangle-graph}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
@@ -84,33 +84,35 @@ gif(anim, imgfile, fps = 1)
|
||||
|
||||
|
||||
caption = L"""
|
||||
The first triangle has area $1/2$, the second has area $1/8$, then $2$ have area $(1/8)^2$, $4$ have area $(1/8)^3$, ...
|
||||
With some algebra, the total area then should be $1/2 \cdot (1 + (1/4) + (1/4)^2 + \cdots) = 2/3$.
|
||||
"""
|
||||
|
||||
plotly()
|
||||
ImageFile(imgfile, caption)
|
||||
```
|
||||
|
||||
The figure illustrates a means to compute the area bounded by the parabola, the line $y=1$ and the line $x=0$ using triangles. It suggests that this area can be found by adding the following sum
|
||||
The first triangle has area $1/2$, the second has area $1/8$, then $2$ have area $(1/8)^2$, $4$ have area $(1/8)^3$, ... With some algebra, the total area then should be $1/2 \cdot (1 + (1/4) + (1/4)^2 + \cdots) = 2/3$.
|
||||
:::
|
||||
|
||||
|
||||
@fig-make-archimedes-triangle-graph illustrates a means to compute the area bounded by the parabola, the line $y=1$ and the line $x=0$ using triangles. It suggests that this area can be found by adding the following sum
|
||||
|
||||
|
||||
$$
|
||||
A = 1/2 + 1/8 + 2 \cdot (1/8)^2 + 4 \cdot (1/8)^3 + \cdots
|
||||
$$
|
||||
|
||||
This value is $2/3$, so the area under the curve would be $1/3$. Forget about this specific value - which through more modern machinery becomes uneventful - and focus for a minute on the method: a problem is solved by a suggestion of an infinite process, in this case the creation of more triangles to approximate the unaccounted for area. This is the so-call method of [exhaustion](http://en.wikipedia.org/wiki/Method_of_exhaustion) known since the 5th century BC.
|
||||
This value is $2/3$, so the area under the curve would be $1/3$. Forget about this specific value---which through more modern machinery becomes uneventful---and focus for a minute on the method: a problem is solved by a suggestion of an infinite process, in this case the creation of more triangles to approximate the unaccounted for area. This is the so-called method of [exhaustion](http://en.wikipedia.org/wiki/Method_of_exhaustion), a method known since the 5th century BC.
|
||||
|
||||
|
||||
Archimedes used this method to solve a wide range of area problems related to basic geometric shapes, including a more general statement of what we described above.
|
||||
|
||||
|
||||
The $\cdots$ in the sum expression are the indication that this process continues and that the answer is at the end of an *infinite* process. To make this line of reasoning rigorous requires the concept of a limit. The concept of a limit is then an old one, but it wasn't until the age of calculus that it was formalized.
|
||||
The $\cdots$ in the sum expression indicate that this process continues and that the answer is at the end of an *infinite* process. To make this line of reasoning rigorous requires the concept of a limit. The concept of a limit is then an old one, but it wasn't until the age of calculus that it was formalized.
|
||||
|
||||
|
||||
Next, we illustrate how Archimedes approximated $\pi$ – the ratio of the circumference of a circle to its diameter – using interior and exterior $n$-gons whose perimeters could be computed.
|
||||
|
||||
|
||||
::: {#fig-archimedes-pi-approximation}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
@@ -172,13 +174,15 @@ for (x, y, n, col) ∈ zip(xs, ys, ns, (blue, green, purple, red))
|
||||
end
|
||||
|
||||
caption = L"""
|
||||
The ratio of the circumference of a circle to its diameter, $\pi$, can be approximated from above and below by computing the perimeters of the inscribed $n$-gons. Archimedes computed the perimeters for $n$ being $12$, $24$, $48$, and $96$ to determine that $3~10/71 \leq \pi \leq 3~1/7$.
|
||||
"""
|
||||
plotly()
|
||||
ImageFile(p, caption)
|
||||
```
|
||||
|
||||
Here Archimedes uses *bounds* to constrain an unknown value. Had he been able to compute these bounds for larger and larger $n$ the value of $\pi$ could be more accurately determined. In a "limit" it would be squeezed in to have a specific value, which we now know is an irrational number.
|
||||
The ratio of the circumference of a circle to its diameter, $\pi$, can be approximated from above and below by computing the perimeters of the inscribed $n$-gons. Archimedes computed the perimeters for $n$ being $12$, $24$, $48$, and $96$ to determine that $3~10/71 \leq \pi \leq 3~1/7$.
|
||||
:::
|
||||
|
||||
With @fig-archimedes-pi-approximation Archimedes uses *bounds* to constrain an unknown value. Had he been able to compute these bounds for larger and larger $n$ the value of $\pi$ could be more accurately determined. In a "limit" it would be squeezed in to have a specific value, which we now know is an irrational number.
|
||||
|
||||
|
||||
Continuing these concepts, [Fermat](http://en.wikipedia.org/wiki/Adequality) in the 1600s essentially took a limit to find the slope of a tangent line to a polynomial curve. Newton in the late 1600s, exploited the idea in his development of calculus (as did Leibniz). Yet it wasn't until the 1800s that [Bolzano](http://en.wikipedia.org/wiki/Limit_of_a_function#History), Cauchy and Weierstrass put the idea on a firm footing.
|
||||
@@ -187,15 +191,20 @@ Continuing these concepts, [Fermat](http://en.wikipedia.org/wiki/Adequality) in
|
||||
To make things more precise, we begin by discussing the limit of a univariate function as $x$ approaches $c$.
|
||||
|
||||
|
||||
Informally, if a limit exists it is the value that $f(x)$ gets close to as $x$ gets close to - but not equal to - $c$.
|
||||
Informally, if a limit exists it is the value that $f(x)$ gets close to as $x$ gets close to---but not equal to---$c$.
|
||||
|
||||
|
||||
The modern formulation is due to Weierstrass:
|
||||
|
||||
::: {.callout-note icon=false}
|
||||
## The $\epsilon-\delta$ Definition of a limit of $f(x)$
|
||||
::: {.definition title="Definition: a limit"}
|
||||
The $\epsilon-\delta$ Definition of a limit of $f(x)$ defines
|
||||
the limit of $f(x)$ as $x$ approaches $c$ as $L$, written,
|
||||
|
||||
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$.
|
||||
$$
|
||||
\lim_{x \rightarrow c} f(x) = L,
|
||||
$$
|
||||
|
||||
by if for every real $\epsilon > 0$, there exists a real $\delta > 0$ such that for all real $x$, if $0 < \lvert x − c \rvert < \delta$ then $\lvert f(x) − L \rvert < \epsilon$.
|
||||
|
||||
:::
|
||||
|
||||
@@ -210,7 +219,9 @@ $$
|
||||
\frac{\sin(x)}{x} \quad\text{and}\quad (1 + x)^{1/x}.
|
||||
$$
|
||||
|
||||
These take the indeterminate forms $0/0$ and $1^\infty$, which are found by just putting $0$ in for $x$. An expression does not need to be defined at $c$, as these two aren't at $c=0$, to discuss its limit. Cauchy illustrates two methods to approach the questions above. The first is to pull out an inequality:
|
||||
These take the indeterminate forms $0/0$ and $1^\infty$, which are found by just putting $0$ in for $x$. To discuss a limit an expression does not need to be defined at $c$, as these two aren't at $c=0$. Cauchy illustrates two methods to approach the questions above.
|
||||
|
||||
The first is to pull out an inequality:
|
||||
|
||||
|
||||
$$
|
||||
@@ -227,7 +238,8 @@ $$
|
||||
This bounds the expression $\sin(x)/x$ between $1$ and $\cos(x)$ and as $x$ gets close to $0$, the value of $\cos(x)$ "clearly" goes to $1$, hence $L$ must be $1$. This is an application of the squeeze theorem, the same idea Archimedes implied when bounding the value for $\pi$ above and below.
|
||||
|
||||
|
||||
The above bound comes from this figure, for small $x > 0$:
|
||||
The above bound comes from a picture like that in @fig-sin-cos-bound, for small $\theta > 0$:
|
||||
|
||||
|
||||
::: {#fig-sin-cos-bound}
|
||||
|
||||
@@ -283,7 +295,7 @@ plotly()
|
||||
nothing
|
||||
```
|
||||
|
||||
Triangle $\triangle ABD$ has less area than the shaded wedge, which has less area than triangle $\triangle ACD$. Their respective areas are $(1/2)\sin(\theta)$, $(1/2)\theta$, and $(1/2)\tan(\theta)$. The inequality used to show $\sin(x)/x$ is bounded below by $\cos(x)$ and above by $1$ comes from a division by $(1/2) \sin(x)$ and taking reciprocals.
|
||||
Triangle $\triangle ABD$ has less area than the shaded wedge, which has less area than triangle $\triangle ACD$. Their respective areas are $(1/2)\sin(\theta)$, $(1/2)\theta$, and $(1/2)\tan(\theta)$. The inequality used to show $\sin(\theta)/\theta$ is bounded below by $\cos(\theta)$ and above by $1$ comes from a division by $(1/2) \sin(\theta)$ and taking reciprocals.
|
||||
|
||||
:::
|
||||
|
||||
@@ -306,7 +318,7 @@ xs = [1/10^i for i in 1:5]
|
||||
[xs f.(xs)]
|
||||
```
|
||||
|
||||
This progression can be seen to be increasing. Cauchy, in his treatise, can see this through:
|
||||
This progression can be seen to be increasing. Cauchy, in his treatise, saw this through:
|
||||
|
||||
|
||||
$$
|
||||
@@ -322,7 +334,7 @@ These values are clearly increasing as $m$ increases. Cauchy showed the value wa
|
||||
|
||||
|
||||
$$
|
||||
e^x = \lim_{n \rightarrow \infty} (1 + \frac{x}{n})^n,
|
||||
e^x = \lim_{n \rightarrow \infty} \left(1 + \frac{x}{n}\right)^n,
|
||||
$$
|
||||
|
||||
with a suitably defined limit.
|
||||
@@ -337,14 +349,14 @@ These two cases illustrate that though the definition of the limit exists, the c
|
||||
First it should be noted that for most of the functions encountered, the concepts of a limit at a typical point $c$ is nothing more than just function evaluation at $c$. This is because, at a typical point, the functions are nicely behaved (what we will soon call "*continuous*"). However, most questions asked about limits find points that are not typical. For these, the result of evaluating the function at $c$ is typically undefined, and the value comes in one of several *indeterminate forms*: $0/0$, $\infty/\infty$, $0 \cdot \infty$, $\infty - \infty$, $0^0$, $1^\infty$, and $\infty^0$.
|
||||
|
||||
|
||||
`Julia` can help - at times - identify these indeterminate forms, as many such operations produce `NaN`. For example:
|
||||
`Julia` can help---at times---identify these indeterminate forms, as many such operations produce `NaN`. For example:
|
||||
|
||||
|
||||
```{julia}
|
||||
0/0, Inf/Inf, 0 * Inf, Inf - Inf
|
||||
```
|
||||
|
||||
However, the values with powers generally do not help, as the IEEE standard has `0^0` evaluating to 1:
|
||||
However, the values with powers generally do not look indeterminate, as the IEEE standard has `0^0` evaluating to 1:
|
||||
|
||||
|
||||
```{julia}
|
||||
@@ -375,49 +387,60 @@ The above is really just a heuristic. For some functions this is just not true.
|
||||
## Graphical approaches to limits
|
||||
|
||||
|
||||
Let's return to the function $f(x) = \sin(x)/x$. This function was studied by Euler as part of his solution to the [Basel](http://en.wikipedia.org/wiki/Basel_problem) problem. He knew that near $0$, $\sin(x) \approx x$, so the ratio is close to $1$ if $x$ is near $0$. Hence, the intuition is $\lim_{x \rightarrow 0} \sin(x)/x = 1$, as Cauchy wrote. We can verify this limit graphically two ways. First, a simple graph shows no issue at $0$:
|
||||
Let's return to the function $f(x) = \sin(x)/x$. This function was studied by Euler as part of his solution to the [Basel](http://en.wikipedia.org/wiki/Basel_problem) problem. He knew that near $0$, $\sin(x) \approx x$, so the ratio is close to $1$ if $x$ is near $0$. Hence, the intuition is $\lim_{x \rightarrow 0} \sin(x)/x = 1$, as Cauchy wrote. We can verify this limit graphically two ways. First, a graph along with the points identified to produce it shows no issue at $0$. The $y$ values of @fig-sinx-over-x-minuspi-over-2-to-pi-over-2 seem to go to $1$ as the $x$ values get close to $0$. (That the graph looks defined at $0$ is due to the fact that the points sampled to graph do not include $0$.)
|
||||
|
||||
|
||||
::: {#fig-sinx-over-x-minuspi-over-2-to-pi-over-2}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
|
||||
#| echo: false
|
||||
f(x) = sin(x)/x
|
||||
plot(f, -pi/2, pi/2;
|
||||
seriestype=[:scatter, :line], # show points and line segments
|
||||
legend=false)
|
||||
```
|
||||
|
||||
The $y$ values of the graph seem to go to $1$ as the $x$ values get close to $0$. (That the graph looks defined at $0$ is due to the fact that the points sampled to graph do not include $0$.)
|
||||
Plot of $f(x) = \sin(x)/x$ over $[-\pi/2, \pi2/]$. The graph made by `plot(f, -pi/2, pi/2`)` does not show the issue at $0$ and so suggests a limit of $1$.
|
||||
:::
|
||||
|
||||
|
||||
We can also verify Euler's intuition through this graph:
|
||||
|
||||
We can also verify Euler's intuition through a graph (@fig-plot-sin-and-x-over-minus-pi-over-2-to-pi-over-2).
|
||||
|
||||
::: {#fig-plot-sin-and-x-over-minus-pi-over-2-to-pi-over-2}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
plot(sin, -pi/2, pi/2)
|
||||
plot!(identity) # the function y = x, like how zero is y = 0
|
||||
plot(sin, -pi/2, pi/2; label="f(x)=sin(x)")
|
||||
plot!(identity; label="f(x)=x") # the function y = x, like how zero is y = 0
|
||||
```
|
||||
|
||||
That the two are indistinguishable near $0$ makes it easy to see that their ratio should be going towards $1$.
|
||||
Plot of both $f(x) = \sin(x)$ and the line $y=x$ over $[-\pi/2, \pi/2]$ showing there similar behaviour near $0$
|
||||
:::
|
||||
|
||||
That the two graphs are indistinguishable near $0$ makes it easy to see that their ratio should be going towards $1$.
|
||||
|
||||
|
||||
A parametric plot shows the same, we see below the slope at $(0,0)$ is *basically* $1$, because the two functions are varying at the same rate when they are each near $0$
|
||||
|
||||
A parametric plot shows the same, we see below the slope at $(0,0)$ is *basically* $1$, because the two functions are varying at the same rate when they are each near $0$. In @fig-parametric-plot-of-sin-and-y-equal-x the line $y=x$ is added for easy identification of the slope.
|
||||
|
||||
::: {#fig-parametric-plot-of-sin-and-y-equal-x}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
plot(sin, identity, -pi/2, pi/2) # parametric plot
|
||||
plot(sin, identity, -pi/2, pi/2; label="sin") # parametric plot
|
||||
plot!(identity; line=(:dash, :gray25), label="y=x" ) # add y-x line
|
||||
```
|
||||
|
||||
The graphical approach to limits - plotting $f(x)$ around $c$ and observing if the $y$ values seem to converge to an $L$ value when $x$ get close to $c$ - allows us to gather quickly if a function seems to have a limit at $c$, though the precise value of $L$ may be hard to identify.
|
||||
Parametric plot of $(\sin(t), t)$ for $t$ in $[-\pi/2, \pi/2]$ along with the line $y=x$. That the two graphs are similar at $(0,0)$ suggests that the limit of the ratio is $1$.
|
||||
:::
|
||||
|
||||
The graphical approach to limits---plotting $f(x)$ around $c$ and observing if the $y$ values seem to converge to an $L$ value when $x$ get close to $c$---allows us to gather quickly if a function seems to have a limit at $c$, though the precise value of $L$ may be hard to identify.
|
||||
|
||||
|
||||
##### Example
|
||||
|
||||
|
||||
This example illustrates the same limit a different way. Sliding the $x$ value towards $0$ shows $f(x) = \sin(x)/x$ approaches a value of $1$.
|
||||
This example illustrates the same limit a different way. Sliding the $x$ value towards $0$ in @fig-jsxgraph-sinx-over-x shows $f(x) = \sin(x)/x$ approaches a value of $1$.
|
||||
|
||||
::: {#fig-jsxgraph-sinx-over-x}
|
||||
|
||||
```{=html}
|
||||
<div id="jsxgraph" style="width: 500px; height: 500px;"></div>
|
||||
@@ -450,6 +473,9 @@ txt = b.create('text', [2, 1, function() {
|
||||
}]);
|
||||
```
|
||||
|
||||
Interactive animation suggesting a limit for $\sin(x)/x$ at $x=0$
|
||||
:::
|
||||
|
||||
##### Example
|
||||
|
||||
|
||||
@@ -470,16 +496,18 @@ c = 2
|
||||
f(c)
|
||||
```
|
||||
|
||||
The `NaN` indicates that this function is indeterminate at $c=2$. A quick plot gives us an idea that the limit exists and is roughly $-0.2$:
|
||||
The `NaN` indicates that this function is indeterminate at $c=2$. A quick plot (@fig-quick-plot-of-rational-function-over-1-to-3) gives us an idea that the limit exists and is roughly $-0.2$. The graph looks "continuous." In fact, the value $c=2$ is termed a *removable singularity* as redefining $f(x)$ to be $-0.2$ when $x=2$ results in a "continuous" function.
|
||||
|
||||
|
||||
::: {#fig-quick-plot-of-rational-function-over-1-to-3}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
c, delta = 2, 1
|
||||
plot(f, c - delta, c + delta)
|
||||
```
|
||||
|
||||
The graph looks "continuous." In fact, the value $c=2$ is termed a *removable singularity* as redefining $f(x)$ to be $-0.2$ when $x=2$ results in a "continuous" function.
|
||||
A quick plot of the rational function $f(x)$ over $[2-1, 2+1]$ (centered about $2$)
|
||||
:::
|
||||
|
||||
|
||||
As an aside, we can redefine `f` using the "ternary operator":
|
||||
@@ -490,7 +518,7 @@ As an aside, we can redefine `f` using the "ternary operator":
|
||||
f(x) = x == 2.0 ? -0.2 : (x^2 - 5x + 6) / (x^2 + x - 6)
|
||||
```
|
||||
|
||||
This particular case is a textbook example: one can easily factor $f(x)$ to get:
|
||||
This particular case is a textbook example---one can easily factor $f(x)$ to get:
|
||||
|
||||
|
||||
$$
|
||||
@@ -568,7 +596,7 @@ Same story. The numeric evidence supports a limit of $L=0.6$.
|
||||
::: {.callout-note}
|
||||
### The `lim` function
|
||||
|
||||
The `CalculusWithJulia` package provides a convenience function `lim(f, c)` to create tables to showcase limits. The `dir` keyword can be `"+-"` (the default) to show values from both the left and the right; `"+"` to only show values to the right of `c`; and `"-"` to only show values to the left of `c`:
|
||||
The `CalculusWithJulia` package provides a convenience function `lim(f, c)` to create tables to showcase limits.^[The `limit` function, by default, only takes *right* limits; to be defined in the next section. The `dir` keyword argument can change this with `dir="+-"` for the two-sided limits discussed here, `dir="-"` for left limits, and the default `dir="+"` for right limits.]
|
||||
|
||||
For example:
|
||||
|
||||
@@ -576,11 +604,7 @@ For example:
|
||||
lim(f, c)
|
||||
```
|
||||
|
||||
The numbers are displayed in decreasing order so the values on the left side of $c$ are read from bottom to top:
|
||||
|
||||
```{julia}
|
||||
lim(f, c; dir="-") # or even lim(f, c, -)
|
||||
```
|
||||
The numbers evaluated by `f` are displayed in decreasing order so the values on the left side of $c$ are read from bottom to top.
|
||||
|
||||
:::
|
||||
|
||||
@@ -652,17 +676,66 @@ Looking at the bottom of the second column reveals the error. The value of `1 -
|
||||
Not that we needed to. The answer would have been clear if we had stopped with `x=1e-6` (with `n=6`) say.
|
||||
|
||||
|
||||
In general, some functions will frustrate the numeric approach. It is best to be wary of results. At a minimum they should confirm what a quick graph shows, though even that isn't enough, as this next example shows.
|
||||
In general, some functions will frustrate the numeric approach. It is best to be wary of results. At a minimum they should confirm what a quick graph shows, though even that isn't always enough.
|
||||
|
||||
|
||||
|
||||
### Richardson extrapolation
|
||||
|
||||
The [`Richardson`](https://github.com/JuliaMath/Richardson.jl) package can numerically compute limits of a wide class of functions in a way that avoids numeric issues, as above.
|
||||
|
||||
|
||||
```{julia}
|
||||
using Richardson
|
||||
f(x) = (1 - cos(x)) / x^2
|
||||
c, h0 = 0, 1
|
||||
extrapolate(f, h0; x0=c)
|
||||
```
|
||||
|
||||
The value `h0=1` in this case is just a starting point of the algorithm and is near `x0` but otherwise need not be worried about. (It is like the value in the left column of the first line output by `lim` for a right-hand limit, not the "going to" part.) In the answer the first value is the estimated limit, the second an error that is used to track when the computed values differ from the mathematically expected values.
|
||||
|
||||
Let $f_0(x) = f(x)$. The basic [algorithm](https://en.wikipedia.org/wiki/Richardson_extrapolation) assumes we can express the value for $L$ in a form such as:
|
||||
|
||||
|
||||
$$
|
||||
L = f_0(h) + a_0 h^{k_0} + a_1 h^{k_1} + a_2 h^{k_2} + \text{error}.
|
||||
$$
|
||||
|
||||
Such a form is known as a series expansion; later the Taylor series expansion will be presented.
|
||||
The error is understood to depend on $h^{k_3}$ in a more precise way than we describe here. But the key is that the $L - f_0(h)$ is not zero and the most important term in how far from zero is $a_0 h^{k_0}$. The trick of Richardson is to evaluate the above at $h/t$ for some $t$ to get another estimate for $L$, then multiply this new estimate by $t^{k_0}$, and then subtract the old estimate to get:
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
(t^{k_0} - 1) L &= (t^{k_0} f_0\left(\frac{h}{t}\right) - f_0(h)) \\
|
||||
&+ (t^{k_0} a_0 \left(\frac{h}{t}\right)^{k_0} - a_0 h^{k_0}) \\
|
||||
&+ (t^{k_0} a_1 \left(\frac{h}{t}\right)^{k_1} - a_1 h^{k_1}) \\
|
||||
&+ (t^{k_0} a_2 \left(\frac{h}{t}\right)^{k_2} - a_2 h^{k_2}) + \text{error}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
The rationale for this choice is that the second line, with $a_0$, will cancel out leaving a new expression for $L$:
|
||||
|
||||
$$
|
||||
L = f_1(h) + \tilde{a}_1 h^{k_1} + \tilde{a}_2 h^{k_2} + \text{error}
|
||||
$$
|
||||
|
||||
where
|
||||
|
||||
$$
|
||||
f_1(h) = \frac{t^{k_0} f_0\left(\frac{h}{t}\right) - f_0(h)}{t^{k_0} - 1}.
|
||||
$$
|
||||
|
||||
This changes the important term in the difference between $L$ and $f_1(h)$ to an expression in $h^{k_1}$, a presumably smaller term. This process can be repeated to produce $f_2$, $f_3$, etc. However, as seen, even if mathematically this can get better an better, it may not be the case computationally. But these differences between the computational and
|
||||
their mathematical expectation can be evaluated so that the `extrapolate` function can stop its work before issues arise.
|
||||
|
||||
##### Example
|
||||
|
||||
|
||||
Let $h(x)$ be defined by
|
||||
Some problems are beyond a numeric approach. Let $h(x)$ be defined by
|
||||
|
||||
|
||||
$$
|
||||
h(x) = x^2 + 1 + \log(| 11 \cdot x - 15 |)/99.
|
||||
h(x) = x^2 + 1 + \log(\lvert 11 \cdot x - 15 \rvert)/99.
|
||||
$$
|
||||
|
||||
The question is to investigate
|
||||
@@ -672,14 +745,17 @@ $$
|
||||
\lim_{x \rightarrow 15/11} h(x)
|
||||
$$
|
||||
|
||||
A plot shows the answer appears to be straightforward:
|
||||
|
||||
The plot in @fig-k-obryants-sneaky-function shows the answer appears to be straightforward.
|
||||
|
||||
::: {#fig-k-obryants-sneaky-function}
|
||||
```{julia}
|
||||
h(x) = x^2 + 1 + log(abs(11*x - 15))/99
|
||||
plot(h, 15/11 - 1, 15/11 + 1)
|
||||
```
|
||||
|
||||
Plot of a function with the property that it has a vertical asymptote with left and right limits of $-\infty$ and yet the function is never negative when evaluated at a 64-bit floating point number
|
||||
:::
|
||||
|
||||
Taking values near $15/11$ shows nothing perhaps too unusual:
|
||||
|
||||
|
||||
@@ -692,64 +768,7 @@ lim(h, c; n = 16)
|
||||
(Though the graph and table do hint at something a bit odd---the graph shows a blip, the table doesn't show values in the second column going towards a specific value.)
|
||||
|
||||
|
||||
However the limit in this case is $-\infty$ (or DNE), as there is an aysmptote at $c=15/11$. The problem is the asymptote due to the logarithm is extremely narrow and happens between floating point values to the left and right of $15/11$.
|
||||
|
||||
|
||||
### Richardson extrapolation
|
||||
|
||||
|
||||
The [`Richardson`](https://github.com/JuliaMath/Richardson.jl) package provides a function to extrapolate a function `f(x)` to `f(x0)`, as the numeric limit does. We illustrate its use by example:
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
f(x) = sin(x)/x
|
||||
extrapolate(f, 1)
|
||||
```
|
||||
|
||||
The answer involves two terms, the second being an estimate for the error in the estimation of `f(0)`.
|
||||
|
||||
|
||||
The values the method chooses could be viewed as follows:
|
||||
|
||||
|
||||
```{julia}
|
||||
#| term: true
|
||||
extrapolate(1) do x # using `do` notation for the function
|
||||
@show x
|
||||
sin(x)/x
|
||||
end
|
||||
```
|
||||
|
||||
The `extrapolate` function avoids the numeric problems encountered in the following example
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
f(x) = (1 - cos(x)) / x^2
|
||||
extrapolate(f, 1)
|
||||
```
|
||||
|
||||
To find limits at a value of `c` not equal to `0`, we set the `x0` argument. For example,
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
f(x) = (sqrt(x) - 5) / (sqrt(x-16) - 3)
|
||||
c = 25
|
||||
extrapolate(f, 1, x0=25)
|
||||
```
|
||||
|
||||
This value can also be `Inf`, in anticipation of infinite limits to be discussed in a subsequent section:
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
f(x) = (x^2 - 2x + 1)/(x^3 - 3x^2 + 2x + 1)
|
||||
extrapolate(f, 10, x0=Inf)
|
||||
```
|
||||
|
||||
(The starting value should be to the right of any zeros of the denominator.)
|
||||
However the limit in this case is $-\infty$ (or DNE), as there is an asymptote at $c=15/11$. The problem is the asymptote due to the logarithm is extremely narrow and happens between floating point values to the left and right of $15/11$.
|
||||
|
||||
|
||||
## Symbolic approach to limits
|
||||
@@ -766,17 +785,17 @@ 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, or `dir="+"`), $x \rightarrow c-$ (`dir="-"`), and $x \rightarrow c$ (`dir="+-"`).
|
||||
The pair notation (`x => 0`) is used to indicate the variable and the value it is going to. In the next section we introduce the `dir` keyword argument.
|
||||
|
||||
|
||||
##### Example
|
||||
|
||||
|
||||
We look again at this function which despite having a vertical asymptote at $x=15/11$ has the property that it is positive for all floating point values, making both a numeric and graphical approach impossible:
|
||||
We look again at the function which despite having a vertical asymptote at $x=15/11$ has the property that it is positive for all floating point values, making both a numeric and graphical approach impossible:
|
||||
|
||||
|
||||
$$
|
||||
h(x) = x^2 + 1 + \log(| 11 \cdot x - 15 |)/99.
|
||||
h(x) = x^2 + 1 + \log(\lvert 11 \cdot x - 15 \rvert)/99.
|
||||
$$
|
||||
|
||||
We find the limit symbolically at $c=15/11$ as follows, taking care to use the exact value `15//11` and not the *floating point* approximation returned by `15/11`:
|
||||
@@ -800,14 +819,15 @@ $$
|
||||
\lim_{\rho \rightarrow 1} \frac{x^{1-\rho} - 1}{1 - \rho}.
|
||||
$$
|
||||
|
||||
We have for the first:
|
||||
We have for the first:^[This and the next two `limit` calls should have `dir="+-"` specified, as the default of SymPy is to only compute a limit from the right side of `c`.]
|
||||
|
||||
|
||||
|
||||
```{julia}
|
||||
limit( (2sin(x) - sin(2x)) / (x - sin(x)), x => 0; dir="+-")
|
||||
limit( (2sin(x) - sin(2x)) / (x - sin(x)), x => 0)
|
||||
```
|
||||
|
||||
(The `dir = "+-"` indicates take both a right and left limit and ensure both exist and are equal.)
|
||||
|
||||
|
||||
The second is similarly done, though here we define a function for variety:
|
||||
|
||||
@@ -815,7 +835,7 @@ The second is similarly done, though here we define a function for variety:
|
||||
```{julia}
|
||||
#| hold: true
|
||||
f(x) = (exp(x) - 1 - x) / x^2
|
||||
limit(f(x), x => 0; dir="+-")
|
||||
limit(f(x), x => 0)
|
||||
```
|
||||
|
||||
Finally, for the third we define a new variable and proceed:
|
||||
@@ -823,7 +843,7 @@ Finally, for the third we define a new variable and proceed:
|
||||
|
||||
```{julia}
|
||||
@syms rho::real
|
||||
limit( (x^(1-rho) - 1) / (1 - rho), rho => 1; dir="+-")
|
||||
limit( (x^(1-rho) - 1) / (1 - rho), rho => 1)
|
||||
```
|
||||
|
||||
This last limit demonstrates that the `limit` function of `SymPy` can readily evaluate limits that involve parameters, though at times some assumptions on the parameters may be needed, as was done through `rho::real`.
|
||||
@@ -856,13 +876,18 @@ The value is not `NaN`, rather `Inf`. This is because `cos(pi/2)` is not exactly
|
||||
limit(j(x), x => PI/2)
|
||||
```
|
||||
|
||||
The value is not right, as this simple graph suggests the limit is in fact $-1$:
|
||||
The value is not right, as this simple graph (@fig-simple-graph-cosx-over-x-minus-pi-over-2) suggests the limit is in fact $-1$:
|
||||
|
||||
::: {#fig-simple-graph-cosx-over-x-minus-pi-over-2}
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
plot(j, pi/4, 3pi/4)
|
||||
```
|
||||
|
||||
Plot of $f(x) = \cos(x) / (x - \pi/2)$ over $[-\pi/4, 3\pi/4]$
|
||||
:::
|
||||
|
||||
The difference between `pi` and `PI` can be significant, and though usually `pi` is silently converted to `PI`, it doesn't happen here as the division by `2` happens first, which turns the symbol into an approximate floating point number. Hence, `SymPy` is giving the correct answer for the problem it is given, it just isn't the problem we wanted to look at.
|
||||
|
||||
|
||||
@@ -871,34 +896,20 @@ Trying again, being more aware of how `pi` and `PI` differ, we have:
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
f(x) = cos(x) / (x - PI/2)
|
||||
limit(f(x), x => PI/2)
|
||||
j(x) = cos(x) / (x - PI/2)
|
||||
limit(j(x), x => PI/2)
|
||||
```
|
||||
|
||||
(The value `pi` is able to be exactly converted to `PI` when used in `SymPy`, as it is of type `Irrational`, and is not a floating point value. However, the expression `pi/2` converts `pi` to a floating point value and then divides by `2`, hence the loss of exactness when used symbolically.)
|
||||
|
||||
|
||||
##### Example: left and right limits
|
||||
|
||||
|
||||
Right and left limits will be discussed in the next section; here we give an example of the idea. The mathematical convention is to say a limit exists if both the left *and* right limits exist and are equal. Informally a right (left) limit at $c$ only considers values of $x$ more (less) than $c$. The `limit` function of `SymPy` finds directional limits by default, a right limit, where $x > c$.
|
||||
|
||||
|
||||
The left limit can be found by passing the argument `dir="-"`. Passing `dir="+-"` (and not `"-+"`), as done in a few examples above, will compute the mathematical limit, throwing an error in `Python` if no limit exists.
|
||||
|
||||
|
||||
```{julia}
|
||||
limit(ceil(x), x => 0), limit(ceil(x), x => 0, dir="-")
|
||||
```
|
||||
|
||||
This accurately shows the limit does not exist mathematically, but `limit(ceil(x), x => 0)` does exist (as it finds a right limit).
|
||||
|
||||
|
||||
## Rules for limits
|
||||
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
::: {.relationship title="Rules for limits"}
|
||||
|
||||
Suppose the individual limits of $f$ and $g$ exist (and are finite) on the right-hand sides below. Then:
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
@@ -912,43 +923,55 @@ $$
|
||||
%%
|
||||
\lim_{x \rightarrow c} \frac{f(x)}{g(x)} &=
|
||||
\frac{\lim_{x \rightarrow c} f(x)}{\lim_{x \rightarrow c} g(x)}
|
||||
&(\text{provided }\lim_{x \rightarrow c} g(x) \neq 0)\\
|
||||
\quad\quad(\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:
|
||||
These rules are verbally described as follows, when the individual limits exist and are finite then:
|
||||
|
||||
|
||||
* Limits involving sums, differences or scalar multiples of functions *exist* **and** can be **computed** by first doing the individual limits and then combining the answers appropriately.
|
||||
* Limits of products exist and can be found by computing the limits of the individual factors and then combining.
|
||||
* Limits of ratios *exist* and can be found by computing the limit of the individual terms and then dividing **provided** you don't divide by $0$. The last part is really important, as this rule is no help with the common indeterminate form $0/0$.
|
||||
* Limits involving sums, differences or scalar multiples of functions *exist* *and* can be *computed* by first doing the individual limits and then combining the answers appropriately.
|
||||
|
||||
* Limits of products exist and can be found by computing the limits of the individual factors and then combining.
|
||||
|
||||
* Limits of ratios *exist* and can be found by computing the limit of the individual terms and then dividing **provided** you don't divide by $0$. The last part is really important, as this rule is no help with the common indeterminate form $0/0$.
|
||||
|
||||
|
||||
In addition, consider the composition:
|
||||
In addition
|
||||
|
||||
::: {.relationship title="Limit rule for a composition"}
|
||||
Consider the limit of a composition:
|
||||
|
||||
|
||||
$$
|
||||
\lim_{x \rightarrow c} f(g(x))
|
||||
\lim_{x \rightarrow c} f(g(x)).
|
||||
$$
|
||||
|
||||
Suppose that
|
||||
|
||||
|
||||
* The outer limit, $\lim_{x \rightarrow b} f(x) = L$, exists, and
|
||||
* the inner limit, $\lim_{x \rightarrow c} g(x) = b$, exists **and**
|
||||
* for some neighborhood around $c$ (not including $c$) $g(x)$ is not $b$,
|
||||
* The outer limit, $\lim_{x \rightarrow b} f(x) = L$, exists, and
|
||||
|
||||
* the inner limit, $\lim_{x \rightarrow c} g(x) = b$, exists, **and**
|
||||
|
||||
* for some neighborhood around $c$ (not including $c$) $g(x)$ is not $b$.
|
||||
|
||||
|
||||
Then the limit exists and equals $L$:
|
||||
|
||||
|
||||
$\lim_{x \rightarrow c} f(g(x)) = \lim_{u \rightarrow b} f(u) = L.$
|
||||
$$
|
||||
\lim_{x \rightarrow c} f(g(x)) = \lim_{u \rightarrow b} f(u) = L.
|
||||
$$
|
||||
:::
|
||||
|
||||
|
||||
|
||||
An alternative, is to assume $f(x)$ is defined at $b$ and equal to $L$ (which is the definition of continuity), but that isn't the assumption above, hence the need to exclude $g$ from taking on a value of $b$ (where $f$ may not be defined) near $c$.
|
||||
|
||||
|
||||
These rules, together with the fact that our basic algebraic functions have limits that can be found by simple evaluation, mean that many limits are easy to compute.
|
||||
These limit rules, together with the fact that our basic algebraic functions have limits that can be found by simple evaluation, mean that many limits are easy to compute.
|
||||
|
||||
|
||||
##### Example: composition
|
||||
@@ -961,7 +984,7 @@ $$
|
||||
\lim_{x \rightarrow 0} \frac{\sin(kx)}{x}.
|
||||
$$
|
||||
|
||||
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$.
|
||||
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 function in the limit of the 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$.)
|
||||
@@ -980,7 +1003,7 @@ as this is the limit of $f(g(x))$ with $f$ as above and $g(x) = x^2$. We need $
|
||||
##### Example: products
|
||||
|
||||
|
||||
Consider this more complicated limit found on this [Wikipedia](http://en.wikipedia.org/wiki/L%27H%C3%B4pital%27s_rule) page.
|
||||
Consider this more complicated limit found on this [Wikipedia](http://en.wikipedia.org/wiki/L%27H%C3%B4pital%27s_rule) page:
|
||||
|
||||
|
||||
$$
|
||||
@@ -1007,29 +1030,40 @@ limit(sin(PI*x)/(PI*x) * l(x), x => 1//2)
|
||||
|
||||
Consider again the limit of $\cos(\pi x) / (1 - (2x)^2)$ at $c=1/2$. A graph of both the top and bottom functions shows the indeterminate, $0/0$, form:
|
||||
|
||||
|
||||
::: {#fig-plot-cos-pix-and-1-minus-2x-squared}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
plot(cos(pi*x), 0.4, 0.6)
|
||||
plot!(1 - (2x)^2)
|
||||
```
|
||||
|
||||
However, following Euler's insight that $\sin(x)/x$ will have a limit at $0$ of $1$ as $\sin(x) \approx x$, and $x/x$ has a limit of $1$ at $c=0$, we can see that $\cos(\pi x)$ looks like $-\pi\cdot (x - 1/2)$ and $(1 - (2x)^2)$ looks like $-4(x-1/2)$ around $x=1/2$:
|
||||
Plot of $f(x) = \cos(\pi x)$ and $g(x) = 1 - (2x)^2$ over $[0.5 - 0.1, 0.5 + 0.1]$. The plot shows at $x=0.5$ the ratio will be indeterminate.
|
||||
:::
|
||||
|
||||
However, following Euler's insight that $\sin(x)/x$ will have a limit at $0$ of $1$ as $\sin(x) \approx x$, and $x/x$ has a limit of $1$ at $c=0$, in @fig-plot-cos-pi-x-tangent-line-and-1-minus-2x-squared-and-tangent-line we can see that $\cos(\pi x)$ looks like $-\pi\cdot (x - 1/2)$ and $(1 - (2x)^2)$ looks like $-4(x-1/2)$ around $x=1/2$. These lines are "tangent lines".
|
||||
|
||||
|
||||
::: {#fig-plot-cos-pi-x-tangent-line-and-1-minus-2x-squared-and-tangent-line}
|
||||
|
||||
```{julia}
|
||||
plot(cos(pi*x), 0.4, 0.6)
|
||||
plot!(-pi*(x - 1/2))
|
||||
#| echo: false
|
||||
|
||||
p1 = plot(cos(pi*x), 0.4, 0.6; label = "cos(pi*x)")
|
||||
plot!(p1, -pi*(x - 1/2); label="tangent line")
|
||||
|
||||
p2 = plot(1 - (2x)^2, 0.4, 0.6; label="1 - (2x)^2")
|
||||
plot!(p2, -4(x - 1/2); label="tangent line")
|
||||
|
||||
plot(p1, p2)
|
||||
```
|
||||
|
||||
```{julia}
|
||||
plot(1 - (2x)^2, 0.4, 0.6)
|
||||
plot!(-4(x - 1/2))
|
||||
```
|
||||
Plot of $\cos(\pi x)$ and its tangent line and a plot of $1 - (2x)^2$ and its tangent line over $[0.5 - 0.1, 0.5 + 0.1]$
|
||||
:::
|
||||
|
||||
So around $c=1/2$ the ratio should look like $-\pi (x-1/2) / ( -4(x - 1/2)) = \pi/4$, which indeed it does, as that is the limit.
|
||||
So around $c=1/2$ the ratio of the functions should look like the ratio of the lines or $-\pi (x-1/2) / ( -4(x -1/2)) = \pi/4$, which indeed it does, as that is the limit.
|
||||
|
||||
|
||||
This is the basis of L'Hôpital's rule, which we will return to once the derivative is discussed.
|
||||
This is the basis of L'Hospital's rule, which we will return to once the derivative is discussed so that a tangent line can be mathematically described.
|
||||
|
||||
|
||||
##### Example: sums
|
||||
@@ -1054,10 +1088,10 @@ Why? We can express the function $e^{\csc(x)}/e^{\cot(x)}$ as the above function
|
||||
|
||||
### The squeeze theorem
|
||||
|
||||
Sometimes limits can be found by bounding more complicated functions by easier functions.
|
||||
Sometimes limits can be found by bounding more complicated functions by easier to reason about functions.
|
||||
|
||||
::: {.theorem title="Theorem: squeeze theorem"}
|
||||
|
||||
::: {.callout-note icon=false}
|
||||
## The [squeeze theorem](http://en.wikipedia.org/wiki/Squeeze_theorem)
|
||||
|
||||
Fix $c$ in $I=(a,b)$. Suppose for all $x$ in $I$, except possibly $c$, there are two functions $l$ and $u$, satisfying:
|
||||
|
||||
@@ -1077,10 +1111,12 @@ $$
|
||||
\lim_{x\rightarrow c} f(x) = L.
|
||||
$$
|
||||
|
||||
The functions $l$ and $u$ [squeeze](http://en.wikipedia.org/wiki/Squeeze_theorem)) $f$.
|
||||
:::
|
||||
|
||||
The figure shows a usage of the squeeze theorem to show $\sin(x)/x \rightarrow 1$ as $\cos(x) \leq \sin(x)x \leq 1$ for $x$ close to $0$.
|
||||
The figure shows a usage of the squeeze theorem to show $\sin(x)/x \rightarrow 1$ as $\cos(x) \leq \sin(x)/x \leq 1$ for $x$ close to $0$.
|
||||
|
||||
::: {#fig-animation-for-square-theorem-cos-sinx-over-x}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
@@ -1102,13 +1138,14 @@ imgfile = tempname() * ".gif"
|
||||
gif(anim, imgfile, fps = 1)
|
||||
|
||||
|
||||
caption = """
|
||||
As ``x`` goes to ``0``, the values of ``\\sin(x)/x`` are squeezed between ``\\cos(x)`` and ``1`` which both converge to ``1``.
|
||||
"""
|
||||
caption = ""
|
||||
plotly()
|
||||
ImageFile(imgfile, caption)
|
||||
```
|
||||
|
||||
As $x$ goes to $0$, the values of $\sin(x)/x$ are squeezed between the values of $\cos(x)$ and $1$, and both functions converge to $1$.
|
||||
:::
|
||||
|
||||
## Limits from the definition
|
||||
|
||||
|
||||
@@ -1178,7 +1215,7 @@ plotly()
|
||||
nothing
|
||||
```
|
||||
|
||||
Figure illustrating requirements of $\epsilon-\delta$ definition of the limit. The image (shaded red on $y$ axis) of the $x$ within $\delta$ of $c$ (except for $c$ and shaded blue on the $x$ axis) must stay within the bounds of $L-\epsilon$ and $L+ \epsilon$, where $\delta$ may be chosen based on $\epsilon$ but needs to be chosen for every positive $\epsilon$, not just a fixed one as in this figure.
|
||||
Figure illustrating requirements of $\epsilon-\delta$ definition of the limit. The image (shaded red on $y$ axis) of the $x$ within $\delta$ of $c$ (except for $c$ and shaded blue on the $x$ axis) must stay within the bounds of $L-\epsilon$ and $L+ \epsilon$, where $\delta$ may be chosen based on $\epsilon$ but needs to be chosen for every positive $\epsilon$, not just a fixed one.
|
||||
:::
|
||||
|
||||
A simple case is the linear case. Consider the function $f(x) = 3x + 2$. Verify that the limit at $c=1$ is $5$.
|
||||
@@ -1191,17 +1228,14 @@ We show "numerically" that $\delta = \epsilon/3$.
|
||||
#| hold: true
|
||||
f(x) = 3x + 2
|
||||
c, L = 1, 5
|
||||
epsilon = rand() # some number in (0,1)
|
||||
epsilon = rand() # some number in (0,1)
|
||||
delta = epsilon / 3
|
||||
xs = c .+ delta * rand(100) # 100 numbers, c < x < c + delta
|
||||
as = [abs(f(x) - L) < epsilon for x in xs]
|
||||
all(as) # are all the as true?
|
||||
all(as) # are all the as true?
|
||||
```
|
||||
|
||||
These lines produce a random $\epsilon$, the resulting $\delta$, and then verify for 100 numbers within $(c, c+\delta)$ that the inequality $\lvert f(x) - L \rvert < \epsilon$ holds for each. Running them again and again should always produce `true` if $L$ is the limit and $\delta$ is chosen properly.
|
||||
|
||||
|
||||
(Of course, we should also verify values to the left of $c$.)
|
||||
These lines produce a random $\epsilon$, the resulting $\delta$, and then verify for 100 numbers within $(c, c+\delta)$ that the inequality $\lvert f(x) - L \rvert < \epsilon$ holds for each. Running them again and again should always produce `true` if $L$ is the limit and $\delta$ is chosen properly. Of course, we should also verify values to the left of $c$.
|
||||
|
||||
|
||||
(The random numbers are technically in $[0,1)$, so in theory `epsilon` could be `0`. So the above approach would be more solid if some guard, such as `epsilon = max(eps(), rand())`, was used. As the formal definition is the domain of paper-and-pencil, we don't fuss.)
|
||||
@@ -1286,13 +1320,14 @@ With this result, the rules of limits can immediately extend this to any polynom
|
||||
###### Question
|
||||
|
||||
|
||||
From the graph, find the limit:
|
||||
From the graph in @fig-limit-rational-function-x-squared-minus-3x-plus-2-over-x-squared-minus-6x-plua-5, find the limit:
|
||||
|
||||
|
||||
$$
|
||||
L = \lim_{x\rightarrow 1} \frac{x^2−3x+2}{x^2−6x+5}
|
||||
$$
|
||||
|
||||
::: {#fig-limit-rational-function-x-squared-minus-3x-plus-2-over-x-squared-minus-6x-plua-5}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
@@ -1300,11 +1335,14 @@ f(x) = (x^2 - 3x +2) / (x^2 - 6x + 5)
|
||||
plot(f, 0,2)
|
||||
```
|
||||
|
||||
Plot of $f(x)$ over $[1-1, 1 + 1]$.
|
||||
:::
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
answ = 1/4
|
||||
numericq(answ, 1e-1)
|
||||
answer = 1/4
|
||||
numericq(answer, 1e-1)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1317,6 +1355,7 @@ $$
|
||||
L = \lim_{x \rightarrow -2} \frac{x}{x+1} \frac{x^2}{x^2 + 4}
|
||||
$$
|
||||
|
||||
::: {#fig-plot-x-over-x-plus-1-times-x-squared-over-x-squared-plus-4}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
@@ -1324,6 +1363,9 @@ f(x) = x/(x+1)*x^2/(x^2+4)
|
||||
plot(f, -3, -1.25)
|
||||
```
|
||||
|
||||
Plot of $f(x)$ over $[-3, -1.25]$
|
||||
:::
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
@@ -1335,22 +1377,24 @@ numericq(val, 1e-1)
|
||||
###### Question
|
||||
|
||||
|
||||
Graphically investigate the limit
|
||||
Graphically investigate the limit of
|
||||
|
||||
|
||||
$$
|
||||
L = \lim_{x \rightarrow 0} \frac{e^x - 1}{x}.
|
||||
$$
|
||||
|
||||
What is the value of $L$?
|
||||
|
||||
using @fig-exp-x-minus-1-over-x. What is the value of $L$?
|
||||
|
||||
::: {#fig-exp-x-minus-1-over-x}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
f(x) = (exp(x) - 1)/x
|
||||
p = plot(f, -1, 1)
|
||||
```
|
||||
Plot of $f(x) = (e^x - 1)/x$ over $[-1,1]$
|
||||
:::
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
@@ -1382,9 +1426,9 @@ numericq(val, 1e-2)
|
||||
###### Question
|
||||
|
||||
|
||||
Select the graph for which there is no limit at $a$.
|
||||
|
||||
In @fig-which-graph-has-no-limit-at-a select the graph for which there is no limit at $a$.
|
||||
|
||||
::: {#fig-which-graph-has-no-limit-at-a}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
@@ -1423,6 +1467,9 @@ let
|
||||
end
|
||||
```
|
||||
|
||||
Select the graph with no limit at $a$
|
||||
:::
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
plotly();
|
||||
@@ -1452,8 +1499,8 @@ What is $L$?
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = ["``0``", "``1``", "``e^x``"]
|
||||
answ = 3
|
||||
radioq(choices, answ)
|
||||
answer = 3
|
||||
radioq(choices, answer)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1480,8 +1527,8 @@ Using the last result, what is the value of $L$?
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = ["``\\cos(x)``", "``\\sin(x)``", "``1``", "``0``", "``\\sin(h)/h``"]
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
answer = 1
|
||||
buttonq(choices, answer)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1565,8 +1612,8 @@ The limit of $\sin(x)/x$ at $0$ has a numeric value. This depends upon the fact
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = [q"0", q"1", q"pi/180", q"180/pi"]
|
||||
answ = 3
|
||||
radioq(choices, answ)
|
||||
answer = 3
|
||||
radioq(choices, answer)
|
||||
```
|
||||
|
||||
What is the limit `limit(sinpi(x)/x, x => 0)`?
|
||||
@@ -1576,8 +1623,8 @@ What is the limit `limit(sinpi(x)/x, x => 0)`?
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = [q"0", q"1", q"pi", q"1/pi"]
|
||||
answ = 3
|
||||
radioq(choices, answ)
|
||||
answer = 3
|
||||
radioq(choices, answer)
|
||||
```
|
||||
|
||||
###### Question: limit properties
|
||||
@@ -1656,8 +1703,8 @@ choices = [
|
||||
"Yes, the value is `-11.5123`",
|
||||
"No, the value heads to negative infinity"
|
||||
];
|
||||
answ = 3;
|
||||
radioq(choices, answ)
|
||||
answer = 3;
|
||||
buttonq(choices, answer)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1752,8 +1799,8 @@ What is `limit(ex, x => 0)`?
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = ["``e^{km}``", "``e^{k/m}``", "``k/m``", "``m/k``", "``0``"]
|
||||
answwer = 1
|
||||
radioq(choices, answwer)
|
||||
answer = 1
|
||||
radioq(choices, answer)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1866,31 +1913,37 @@ buttonq(choices, 2; explanation=explanation)
|
||||
###### Question: The squeeze theorem
|
||||
|
||||
|
||||
Let's look at the function $f(x) = x \sin(1/x)$. A graph around $0$ can be made with:
|
||||
|
||||
Let's look at the function $f(x) = x \sin(1/x)$. @fig-squeeze-theorem-x-sin-1-over-x-and-abs-x shows the graph of the function near $0$ and also the graph of $\lvert x \rvert$ and $-\lvert x \rvert$.
|
||||
|
||||
::: {#fig-squeeze-theorem-x-sin-1-over-x-and-abs-x}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
f(x) = x == 0 ? NaN : x * sin(1/x)
|
||||
c, delta = 0, 1/4
|
||||
plot(f, c - delta, c + delta)
|
||||
plot!(abs)
|
||||
plot!(x -> -abs(x))
|
||||
plot(f, c - delta, c + delta; legend=false, line=(:blue,))
|
||||
plot!(abs; line=(:black,))
|
||||
plot!(x -> -abs(x); line=(:black,))
|
||||
```
|
||||
|
||||
This graph clearly oscillates near $0$. To the graph of $f$, we added graphs of both $g(x) = \lvert x\rvert$ and $h(x) = - \lvert x\rvert$. From this graph it is easy to see by the "squeeze theorem" that the limit at $x=0$ is $0$. Why?
|
||||
Plot of $f(x) = x \sin(1/x)$ over $[-1/4, 1/4]$ along with $\lvert x\rvert$ and $-\lvert x \rvert$.
|
||||
:::
|
||||
|
||||
|
||||
This graph clearly oscillates near $0$. To the graph of $f$, we added graphs of both
|
||||
$g(x) = \lvert x\rvert$ and $h(x) = - \lvert x\rvert$.
|
||||
From the graph in @fig-squeeze-theorem-x-sin-1-over-x-and-abs-x it is easy to see by the "squeeze theorem" that the limit at $x=0$ is $0$. Why?
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices=[L"""The functions $g$ and $h$ both have a limit of $0$ at $x=0$ and the function $f$ is in
|
||||
between both $g$ and $h$, so must to have a limit of $0$.
|
||||
""",
|
||||
L"The functions $g$ and $h$ squeeze each other as $g(x) > h(x)$",
|
||||
L"The functions $g$ and $h$ squeeze each other as $g(x) > h(x)$",
|
||||
L"The function $f$ has no limit - it oscillates too much near $0$"]
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
answer = 1
|
||||
buttonq(choices, answer)
|
||||
```
|
||||
|
||||
(The [Wikipedia](https://en.wikipedia.org/wiki/Squeeze_theorem) entry for the squeeze theorem has this unverified, but colorful detail:
|
||||
|
||||
+147
-137
@@ -13,17 +13,14 @@ plotly()
|
||||
using SymPy
|
||||
```
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
#| results: "hidden"
|
||||
using DataFrames
|
||||
nothing
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
{width=40%}
|
||||
::: {#fig-buzz-lightyear-likely-not-AI-generated}
|
||||
{width=40%}
|
||||
|
||||
To infinity and beyond
|
||||
:::
|
||||
|
||||
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.
|
||||
|
||||
@@ -50,7 +47,7 @@ plot(f, range(-1, stop=1, length=1000))
|
||||
Graph of the function $f(x) = \sin(1/x)$ near $0$. It oscillates infinitely many times around $0$.
|
||||
:::
|
||||
|
||||
The graph oscillates between $-1$ and $1$ infinitely many times on this interval - so many times, that no matter how close one zooms in, the graph on the screen will fail to capture them all. Graphically, there is no single value of $L$ that the function gets close to, as it varies between all the values in $[-1,1]$ as $x$ gets close to $0$. A simple proof that there is no limit, is to take any $\epsilon$ less than $1$, then with any $\delta > 0$, there are infinitely many $x$ values where $f(x)=1$ and infinitely many where $f(x) = -1$. That is, there is no $L$ with $|f(x) - L| < \epsilon$ when $\epsilon$ is less than $1$ for all $x$ near $0$.
|
||||
The graph oscillates between $-1$ and $1$ infinitely many times on this interval---so many times, that no matter how close one zooms in, the graph on the screen will fail to capture them all. Graphically, there is no single value of $L$ that the function gets close to, as it varies between all the values in $[-1,1]$ as $x$ gets close to $0$. A simple proof that there is no limit, is to take any $\epsilon$ less than $1$, then with any $\delta > 0$, there are infinitely many $x$ values where $f(x)=1$ and infinitely many where $f(x) = -1$. That is, there is no $L$ with $|f(x) - L| < \epsilon$ when $\epsilon$ is less than $1$ for all $x$ near $0$.
|
||||
|
||||
|
||||
This function basically has too many values it gets close to. Another favorite example of such a function is the function that is $0$ if $x$ is rational and $1$ if not. This function will have no limit anywhere, not just at $0$, and for basically the same reason as above.
|
||||
@@ -63,17 +60,21 @@ $$
|
||||
-|x| \leq x \sin(1/x) \leq |x|.
|
||||
$$
|
||||
|
||||
The following figure illustrates:
|
||||
@fig-squeze-x-sin-1-over-x-minus1-1 illustrates:
|
||||
|
||||
|
||||
::: {#fig-squeze-x-sin-1-over-x-minus1-1}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
f(x) = x * sin(1/x)
|
||||
plot(f, -1, 1; label="f")
|
||||
plot!(abs; label="|.|")
|
||||
plot!(x -> -abs(x); label="-|.|")
|
||||
```
|
||||
Plot of $f(x) = x \sin(1/x)$ over $[-1,1]$ with graphs of $\lvert x\rvert$ and $-\lvert x \rvert$ added
|
||||
:::
|
||||
|
||||
The [squeeze](http://en.wikipedia.org/wiki/Squeeze_theorem) theorem of calculus is the formal reason $f$ has a limit at $0$, as both the upper function, $|x|$, and the lower function, $-|x|$, have a limit of $0$ at $0$.
|
||||
As seen in the last section, the [squeeze](http://en.wikipedia.org/wiki/Squeeze_theorem) theorem of calculus is the formal reason $f$ has a limit at $0$, as both the upper function, $|x|$, and the lower function, $-|x|$, have a limit of $0$ at $0$.
|
||||
|
||||
|
||||
## Right and left limits
|
||||
@@ -82,27 +83,29 @@ The [squeeze](http://en.wikipedia.org/wiki/Squeeze_theorem) theorem of calculus
|
||||
Another example where $f(x)$ has no limit is the function $f(x) = x /|x|, x \neq 0$. This function is $-1$ for negative $x$ and $1$ for positive $x$. Again, this function will have a limit everywhere except possibly at $x=0$, where division by $0$ is possible.
|
||||
|
||||
|
||||
It's graph is
|
||||
|
||||
|
||||
::: {#fig-plot-abs-x-over-x-minus2-2}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
f(x) = abs(x)/x
|
||||
plot(f, -2, 2)
|
||||
```
|
||||
|
||||
The sharp jump at $0$ is misleading - again, the plotting algorithm just connects the points, it doesn't handle what is a fundamental discontinuity well - the function is not defined at $0$ and jumps from $-1$ to $1$ there. Similarly to our example of $\sin(1/x)$, near $0$ the function get's close to both $1$ and $-1$, so will have no limit. (Again, just take $\epsilon$ smaller than $1$.)
|
||||
Plot of $f(x) = \lvert x \rvert / x$ over $[-2,2]$
|
||||
:::
|
||||
|
||||
The sharp jump in @fig-plot-abs-x-over-x-minus2-2 at $0$ is misleading---again, the plotting algorithm just connects the points, it doesn't handle what is a fundamental discontinuity well---the function is not defined at $0$ and jumps from $-1$ to $1$ there. Similarly to our example of $\sin(1/x)$, near $0$ the function get's close to both $1$ and $-1$, so will have no limit. (Again, just take $\epsilon$ smaller than $1$.)
|
||||
|
||||
|
||||
But unlike the previous example, this function *would* have a limit if the definition didn't consider values of $x$ on both sides of $c$. The limit on the right side would be $1$, the limit on the left side would be $-1$. This distinction is useful, so there is an extension of the idea of a limit to *one-sided limits*.
|
||||
But unlike the previous example of $\sin(1/x)$, this function *would* have a limit if the definition didn't consider values of $x$ on both sides of $c$. The limit on the right side would be $1$, the limit on the left side would be $-1$. This distinction is useful, so there is an extension of the idea of a limit to *one-sided limits*.
|
||||
|
||||
|
||||
Let's loosen up the language in the definition of a limit to read:
|
||||
Let's loosen up the language in the definition of a limit:
|
||||
|
||||
|
||||
::: {.callout-note icon=false}
|
||||
::: {.definition title="Loosened definition of a limit"}
|
||||
|
||||
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 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$.
|
||||
|
||||
:::
|
||||
|
||||
@@ -112,18 +115,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
|
||||
::: {.theorem title="The epsilon-delta definition of a right (and left) 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)$.
|
||||
|
||||
A (two-sided) *limit* exists if and only if both the left- and right-hand limits exist *and* are equal.
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -139,20 +140,23 @@ limit(f(x), x=>0, dir="+"), limit(f(x), x=>0, dir="-")
|
||||
|
||||
:::{.callout-warning}
|
||||
## Warning
|
||||
That means the mathematical limit need not exist when `SymPy`'s `limit` returns an answer, as `SymPy` is only carrying out a one sided limit. Explicitly passing `dir="+-"` or checking that both `limit(ex, x=>c)` and `limit(ex, x=>c, dir="-")` are equal would be needed to confirm a limit exists mathematically.
|
||||
That means the mathematical limit need not exist when `SymPy`'s `limit` returns an answer, as `SymPy` is only carrying out a one-sided limit. Explicitly passing `dir="+-"` or checking that both `limit(ex, x=>c)` and `limit(ex, x=>c, dir="-")` exist and are equal would be needed to confirm a limit exists mathematically.
|
||||
|
||||
:::
|
||||
|
||||
The relation between the two concepts is that a function has a limit at $c$ if and only if the left and right limits exist and are equal. This function $f$ has both existing, but the two limits are not equal.
|
||||
|
||||
|
||||
There are other such functions that jump. Another useful one is the floor function, which just rounds down to the nearest integer. A graph shows the basic shape:
|
||||
|
||||
There are other such functions that jump. Another useful one is the floor function, which just rounds down to the nearest integer. @fig-floor-function-over-minus5-5-without-care shows the basic shape:
|
||||
|
||||
::: {#fig-floor-function-over-minus5-5-without-care}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
plot(floor, -5,5)
|
||||
```
|
||||
|
||||
Plot of `floor` over $[-5,5]$. The vertical lines are artifacts of plotting.
|
||||
:::
|
||||
|
||||
Again, the (nearly) vertical lines are an artifact of the graphing algorithm and not actual points that solve $y=f(x)$. The floor function has limits except at the integers. There the left and right limits differ.
|
||||
|
||||
@@ -176,9 +180,9 @@ However, not all such functions with indeterminate forms of $0^0$ will have a li
|
||||
##### Example
|
||||
|
||||
|
||||
Consider this funny graph:
|
||||
|
||||
Consider the funny graph in @fig-funny-shape-plot-for-limit-questions.
|
||||
|
||||
::: {#fig-funny-shape-plot-for-limit-questions}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
@@ -188,10 +192,10 @@ plot(; legend=false, aspect_ratio=true,
|
||||
xticks = -4:4)
|
||||
plot!([(-4, -1.5),(-2,4)]; line=(:black,1))
|
||||
plot!(x->x^2, -2, -1; line=(:black,1))
|
||||
plot!(exp, -1,0)
|
||||
plot!(x -> 1-2x, 0, 1)
|
||||
plot!(sqrt, 1, 2)
|
||||
plot!(x -> 1-x, 2,3)
|
||||
plot!(exp, -1,0; line=(:black,1))
|
||||
plot!(x -> 1-2x, 0, 1; line=(:black,1))
|
||||
plot!(sqrt, 1, 2; line=(:black,1))
|
||||
plot!(x -> 1-x, 2, 3; line=(:black,1))
|
||||
S = Plots.scale(Shape(:circle), 0.05)
|
||||
|
||||
plot!(Plots.translate(S, -4, -1.5); fill=(:black,))
|
||||
@@ -205,15 +209,18 @@ S = Plots.scale(Shape(:circle), 0.05)
|
||||
|
||||
end
|
||||
```
|
||||
Funny graph where limits are not always obvious from continuity
|
||||
:::
|
||||
|
||||
|
||||
Describe the limits at $-1$, $0$, and $1$.
|
||||
|
||||
|
||||
* At $-1$ we see a jump, there is no limit but instead a left limit of 1 and a right limit appearing to be $1/2$.
|
||||
* At $-1$ we see a jump, there is no limit but instead a left limit of 1 and a right limit of $1/2$, or so.
|
||||
|
||||
* At $0$ we see a limit of $1$.
|
||||
|
||||
* Finally, at $1$ again there is a jump, so no limit. Instead the left limit is about $-1$ and the right limit $1$.
|
||||
* Finally, at $1$ again there is a jump, so no limit. Instead the left limit is $-1$ and the right limit $1$.
|
||||
|
||||
|
||||
## Limits at infinity
|
||||
@@ -238,13 +245,13 @@ The function $f(x) = \sin(x)$ will not have a limit at $+\infty$ for exactly the
|
||||
limit(sin(x), x => oo)
|
||||
```
|
||||
|
||||
(We used `SymPy`'s `oo` for $\infty$ and not `Inf`.)
|
||||
(We use `SymPy`'s variable `oo` for $\infty$ and not `Inf`, though `Inf` can be used.)
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
However, a damped oscillation, such as $f(x) = e^{-x} \sin(x)$ will have a limit:
|
||||
However, a damped oscillation, such as $f(x) = e^{-x} \sin(x)$ will have a limit at $\infty$:
|
||||
|
||||
|
||||
```{julia}
|
||||
@@ -254,7 +261,7 @@ limit(exp(-x)*sin(x), x => oo)
|
||||
---
|
||||
|
||||
|
||||
We have rational functions will have the expected limit. In this example $m = n$, so we get a horizontal asymptote that is not $y=0$:
|
||||
Rational functions will have the expected limit at $\infty$ found by comparing leading terms. In this example $m = n$, so we get a horizontal asymptote that is not $y=0$, rather $y=1/4$:
|
||||
|
||||
|
||||
```{julia}
|
||||
@@ -293,7 +300,7 @@ $$
|
||||
\lim_{x \rightarrow 0+} f(1/x)
|
||||
$$
|
||||
|
||||
So whether $\lim_{x \rightarrow 0+} \sin(1/x)$ exists is equivalent to whether $\lim_{x\rightarrow \infty} \sin(x)$ exists, which clearly does not due to the oscillatory nature of $\sin(x)$.
|
||||
So whether $\lim_{x \rightarrow 0+} \sin(1/x)$ exists is equivalent to whether $\lim_{x\rightarrow \infty} \sin(x)$ exists; clearly it does not due to the oscillatory nature of $\sin(x)$.
|
||||
|
||||
|
||||
Similarly, one can make this reduction
|
||||
@@ -311,35 +318,42 @@ That is, right limits can be analyzed as limits at $\infty$ or right limits at $
|
||||
## Limits of infinity
|
||||
|
||||
|
||||
Vertical asymptotes are nicely defined with, as with horizontal asymptotes, by the graph getting close to some line. However, the formal definition of a limit won't be the same. For a vertical asymptote, the value of $f(x)$ heads towards positive or negative infinity, not some finite $L$. As such, a neighborhood like $(L-\epsilon, L+\epsilon)$ will no longer make sense, rather we replace it with an expression like $(M, \infty)$ or $(-\infty, M)$. As in: the limit of $f(x)$ as $x$ approaches $c$ is *infinity* if for every $M > 0$ there exists a $\delta>0$ such that if $0 < |x-c| < \delta$ then $f(x) > M$. Approaching $-\infty$ would conclude with $f(x) < -M$ for $M>0$.
|
||||
Vertical asymptotes are nicely defined with by the graph getting close to some vertical line. Similar in spirit to horizontal asymptotes but the formal definition of a limit won't be the same. For a vertical asymptote, the value of $f(x)$ heads towards positive or negative infinity, not some finite $L$. As such, a neighborhood like $(L-\epsilon, L+\epsilon)$ will no longer make sense, rather we replace it with an expression like $(M, \infty)$ or $(-\infty, M)$. As in: the limit of $f(x)$ as $x$ approaches $c$ is *infinity* if for every $M > 0$ there exists a $\delta>0$ such that if $0 < |x-c| < \delta$ then $f(x) > M$. Approaching $-\infty$ would conclude with $f(x) < -M$ for $M>0$.
|
||||
|
||||
|
||||
##### Examples
|
||||
##### Example
|
||||
|
||||
|
||||
Consider the function $f(x) = 1/x^2$. This will have a limit at every point except possibly $0$, where division by $0$ is possible. In this case, there is a vertical asymptote, as seen in the following graph. The limit at $0$ is $\infty$, in the extended sense above. For $M>0$, we can take any $0 < \delta < 1/\sqrt{M}$. The following graph shows $M=25$ where the function values are outside of the box, as $f(x) > M$ for those $x$ values with $0 < |x-0| < 1/\sqrt{M}$.
|
||||
Consider the function $f(x) = 1/x^2$. This will have a limit at every point except possibly $0$, where division by $0$ is possible. In this case, there is a vertical asymptote, as seen in @fig-plot-1-over-xsquqred-showing-limit-at-0. The limit at $0$ is $\infty$, in the extended sense above. For $M>0$, we can take any $0 < \delta < 1/\sqrt{M}$. The following graph shows $M=25$ where the function values are outside of the box, as $f(x) > M$ for those $x$ values with $0 < |x-0| < 1/\sqrt{M}$.
|
||||
|
||||
|
||||
::: {#fig-plot-1-over-xsquqred-showing-limit-at-0}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
f(x) = 1/x^2
|
||||
M = 25
|
||||
delta = 1/sqrt(M)
|
||||
|
||||
f(x) = 1/x^2 > 50 ? NaN : 1/x^2
|
||||
plot(f, -1, 1, legend=false)
|
||||
plot(f, -1, 1; ylim=(-5, 50), framestyle=:origin, legend=false)
|
||||
plot!([-delta, delta], [M,M], color=colorant"orange")
|
||||
plot!([-delta, -delta], [0,M], color=colorant"red")
|
||||
plot!([delta, delta], [0,M], color=colorant"red")
|
||||
annotate!([(1/sqrt(M), 0, text(L"\frac{1}{\sqrt{M}}", :top)),
|
||||
(0, M, text(L"M", :right))
|
||||
])
|
||||
```
|
||||
|
||||
---
|
||||
Plot of $f(x) = 1/x^2$ over $[-1,1]$ with overlay suggesting how $\delta$ can be found for a given $M$.
|
||||
:::
|
||||
|
||||
##### Example
|
||||
|
||||
|
||||
The function $f(x)=1/x$ requires us to talk about left and right limits of infinity, with the natural generalization. We can see that the left limit at $0$ is $-\infty$ and the right limit $\infty$:
|
||||
The function $f(x)=1/x$ requires us to talk about left- and right-hand limits of infinity, with the natural generalization. We can see that the left limit at $0$ is $-\infty$ and the right limit $\infty$:
|
||||
|
||||
|
||||
::: {#fig-plot-1-over-x-avoiding-asymptote-at-0}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
@@ -347,6 +361,8 @@ f(x) = 1/x
|
||||
plot(f, 1/50, 1, color=:blue, legend=false)
|
||||
plot!(f, -1, -1/50, color=:blue)
|
||||
```
|
||||
Plot of $f(x) = 1/x$ over $[-1, 1]$
|
||||
:::
|
||||
|
||||
`SymPy` agrees:
|
||||
|
||||
@@ -357,20 +373,23 @@ f(x) = 1/x
|
||||
limit(f(x), x=>0, dir="-"), limit(f(x), x=>0, dir="+")
|
||||
```
|
||||
|
||||
---
|
||||
##### Example
|
||||
|
||||
|
||||
Consider the function $g(x) = x^x(1 + \log(x)), x > 0$. Does this have a *right* limit at $0$?
|
||||
Consider the function $g(x) = x^x(1 + \log(x)), x > 0$ in @fig-plot-x-to-x-times-1-plus-logx. Does this have a *right* limit at $0$?
|
||||
|
||||
|
||||
A quick graph shows that a limit may be $-\infty$:
|
||||
|
||||
|
||||
::: {#fig-plot-x-to-x-times-1-plus-logx}
|
||||
```{julia}
|
||||
g(x) = x^x * (1 + log(x))
|
||||
plot(g, 1/100, 1)
|
||||
```
|
||||
|
||||
Plot of $x^x(1 + \log(x))$ over $(0,1)$
|
||||
:::
|
||||
|
||||
We can check with `SymPy`:
|
||||
|
||||
|
||||
@@ -413,52 +432,71 @@ $$
|
||||
\lim_{x \rightarrow 0} \frac{e^x - 1}{x} = 1,
|
||||
$$
|
||||
|
||||
is an important limit. Using the definition of $e^x$ by an infinite sequence:
|
||||
is an important limit. We show how to mathematically find it assuming
|
||||
this definition of $e^x$ by an infinite sequence:
|
||||
|
||||
|
||||
$$
|
||||
e^x = \lim_{n \rightarrow \infty} (1 + \frac{x}{n})^n,
|
||||
e^x = \lim_{n \rightarrow \infty} \left(1 + \frac{x}{n}\right)^n,
|
||||
$$
|
||||
|
||||
we can establish the limit using the squeeze theorem. First,
|
||||
The limit of this sequence is known to `SymPy`:
|
||||
|
||||
```{julia}
|
||||
@syms x n
|
||||
limit((1 + x/n)^n, n=>oo)
|
||||
```
|
||||
|
||||
|
||||
We use this definition to establish the limit above using the squeeze theorem. First, define a new sequence:
|
||||
|
||||
|
||||
$$
|
||||
A = |(1 + \frac{x}{n})^n - 1 - x| = |\Sigma_{k=0}^n {n \choose k}(\frac{x}{n})^k - 1 - x| = |\Sigma_{k=2}^n {n \choose k}(\frac{x}{n})^k|,
|
||||
\begin{align*}
|
||||
A_n
|
||||
&= \lvert \left(1 + \frac{x}{n}\right)^n - 1 - x\rvert \\
|
||||
&= \lvert \sum_{k=0}^n {n \choose k}\left(\frac{x}{n}\right)^k - 1 - x\rvert \\
|
||||
&= \lvert \sum_{k=2}^n {n \choose k}\left(\frac{x}{n}\right)^k\rvert,
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
the first two sums cancelling off. The above comes from the binomial expansion theorem for a polynomial. Now ${n \choose k} \leq n^k$so we have
|
||||
the first two sums cancelling off. The second line in the above comes from applying binomial expansion theorem for an integer power. Now ${n \choose k} \leq n^k$so we have
|
||||
|
||||
|
||||
$$
|
||||
A \leq \Sigma_{k=2}^n |x|^k = |x|^2 \frac{1 - |x|^{n+1}}{1 - |x|} \leq
|
||||
\frac{|x|^2}{1 - |x|}.
|
||||
\begin{align*}
|
||||
A_n
|
||||
&\leq \lvert \sum_{k=2}^n n^k\left(\frac{x}{n}\right)^k\rvert \\
|
||||
&= \sum_{k=2}^n \lvert x\rvert^k \\
|
||||
&= \lvert x\rvert^2 \frac{1 - \lvert x\rvert^{n+1}}{1 - \lvert x\rvert} \\
|
||||
&\leq \frac{\lvert x\rvert^2}{1 - \lvert x\rvert}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
using the *geometric* sum formula with $x \approx 0$ (and not $1$):
|
||||
We used this *geometric* sum formula with $x \approx 0$ (and not $1$) in the third line:
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
@syms x n i
|
||||
summation(x^i, (i,0,n))
|
||||
@syms r::positive n i
|
||||
summation(r^i, (i, 0, n))
|
||||
```
|
||||
|
||||
As this holds for all $n$, as $n$ goes to $\infty$ we have:
|
||||
As the above holds for all $n$, as $n$ goes to $\infty$ we have:
|
||||
|
||||
|
||||
$$
|
||||
|e^x - 1 - x| \leq \frac{|x|^2}{1 - |x|}
|
||||
\lvert e^x - 1 - x\rvert \leq \frac{\lvert x\rvert^2}{1 - \lvert x\rvert}
|
||||
$$
|
||||
|
||||
Dividing both sides by $x$ and noting that as $x \rightarrow 0$, $|x|/(1-|x|)$ goes to $0$ by continuity, the squeeze theorem gives the limit:
|
||||
Dividing both sides by $x$ and noting that as $x \rightarrow 0$, $\lvert x\rvert/(1-\lvert x\rvert)$ goes to $0$ by continuity, the squeeze theorem gives the limit:
|
||||
|
||||
|
||||
$$
|
||||
\lim_{x \rightarrow 0} \frac{e^x -1}{x} - 1 = 0.
|
||||
$$
|
||||
|
||||
That ${n \choose k} \leq n^k$ can be viewed as the left side counts the number of combinations of $k$ choices from $n$ distinct items, which is less than the number of permutations of $k$ choices, which is less than the number of choices of $k$ items from $n$ distinct ones without replacement – what $n^k$ counts.
|
||||
That ${n \choose k} \leq n^k$ can be viewed as the left side counts the number of combinations of $k$ choices from $n$ distinct items, which is less than the number of permutations of $k$ choices, which is less than the number of choices of $k$ items from $n$ distinct ones without replacement---what $n^k$ counts.
|
||||
|
||||
|
||||
|
||||
@@ -466,60 +504,24 @@ That ${n \choose k} \leq n^k$ can be viewed as the left side counts the number o
|
||||
## Summary
|
||||
|
||||
|
||||
The following table captures the various changes to the definition of the limit to accommodate some of the possible behaviors.
|
||||
@tbl-various-modifications-to-limit-definition captures the various changes to the definition of the limit to accommodate some of the possible behaviors. [Ross](https://doi.org/10.1007/978-1-4614-6271-2) summarizes all this by enumerating the 15 different *related* definitions for $\lim_{x \rightarrow a} f(x) = L$ that arise from $L$ being either finite, $-\infty$, or $+\infty$ and $a$ being any of $c$, $c-$, $c+$, $-\infty$, or $+\infty$.
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
limit_type=[
|
||||
"limit",
|
||||
"right limit",
|
||||
"left limit",
|
||||
L"limit at $\infty$",
|
||||
L"limit at $-\infty$",
|
||||
L"limit of $\infty$",
|
||||
L"limit of $-\infty$",
|
||||
"limit of a sequence"
|
||||
]
|
||||
|
||||
Notation=[
|
||||
L"\lim_{x\rightarrow c}f(x) = L",
|
||||
L"\lim_{x\rightarrow c+}f(x) = L",
|
||||
L"\lim_{x\rightarrow c-}f(x) = L",
|
||||
L"\lim_{x\rightarrow \infty}f(x) = L",
|
||||
L"\lim_{x\rightarrow -\infty}f(x) = L",
|
||||
L"\lim_{x\rightarrow c}f(x) = \infty",
|
||||
L"\lim_{x\rightarrow c}f(x) = -\infty",
|
||||
L"\lim_{n \rightarrow \infty} a_n = L"
|
||||
]
|
||||
::: {#tbl-various-modifications-to-limit-definition .hover .striped tbl-colwidths="[31,23,23,23]"}
|
||||
| Type | Notation | V | U |
|
||||
| -------------------:| -------------------------------------:| --------------------------:| ------------------------:|
|
||||
| limit at $c$| $\lim_{x\rightarrow c}f(x) = L$ | $(L-\epsilon, L+\epsilon)$ | $(c - \delta, c+\delta)$ |
|
||||
| right limit at $c$ | $\lim_{x\rightarrow c+}f(x) = L$ | $(L-\epsilon, L+\epsilon)$ | $(c, c+\delta)$ |
|
||||
| left limit at $c$| $\lim_{x\rightarrow c-}f(x) = L$ | $(L-\epsilon, L+\epsilon)$ | $(c - \delta, c)$ |
|
||||
| limit *at* $\infty$ | $\lim_{x\rightarrow \infty}f(x) = L$ | $(L-\epsilon, L+\epsilon)$ | $(M, \infty)$ |
|
||||
| limit *at* $-\infty$ | $\lim_{x\rightarrow -\infty}f(x) = L$ | $(L-\epsilon, L+\epsilon)$ | $(-\infty, M)$ |
|
||||
| limit *of* $\infty$ | $\lim_{x\rightarrow c}f(x) = \infty$ | $(M, \infty)$ | $(c - \delta, c+\delta)$ |
|
||||
| limit *of* $-\infty$ | $\lim_{x\rightarrow c}f(x) = -\infty$ | $(-\infty, M)$ | $(c - \delta, c+\delta)$ |
|
||||
| limit of a sequence | $\lim_{n \rightarrow \infty} a_n = L$ | $(L-\epsilon, L+\epsilon)$ | $(M, \infty)$ |
|
||||
|
||||
Vs = [
|
||||
L"(L-\epsilon, L+\epsilon)",
|
||||
L"(L-\epsilon, L+\epsilon)",
|
||||
L"(L-\epsilon, L+\epsilon)",
|
||||
L"(L-\epsilon, L+\epsilon)",
|
||||
L"(L-\epsilon, L+\epsilon)",
|
||||
L"(M, \infty)",
|
||||
L"(-\infty, M)",
|
||||
L"(L-\epsilon, L+\epsilon)"
|
||||
]
|
||||
|
||||
Us = [
|
||||
L"(c - \delta, c+\delta)",
|
||||
L"(c, c+\delta)",
|
||||
L"(c - \delta, c)",
|
||||
L"(M, \infty)",
|
||||
L"(-\infty, M)",
|
||||
L"(c - \delta, c+\delta)",
|
||||
L"(c - \delta, c+\delta)",
|
||||
L"(M, \infty)"
|
||||
]
|
||||
|
||||
d = DataFrame(Type=limit_type, Notation=Notation, V=Vs, U=Us)
|
||||
table(d)
|
||||
```
|
||||
|
||||
[Ross](https://doi.org/10.1007/978-1-4614-6271-2) summarizes this by enumerating the 15 different *related* definitions for $\lim_{x \rightarrow a} f(x) = L$ that arise from $L$ being either finite, $-\infty$, or $+\infty$ and $a$ being any of $c$, $c-$, $c+$, $-\infty$, or $+\infty$.
|
||||
: Table illustrating various modifications to the basic limit definition to accommodate a wider range of applicability
|
||||
:::
|
||||
|
||||
|
||||
## Rates of growth
|
||||
@@ -595,7 +597,7 @@ A negative test for compatibility is the following: if
|
||||
|
||||
|
||||
$$
|
||||
\lim_{x \rightarrow \infty} \frac{\log(|f(x)|)}{\log(|g(x)|)} = 0,
|
||||
\lim_{x \rightarrow \infty} \frac{\log(\lvert f(x)\rvert)}{\log(\lvert g(x)\rvert)} = 0,
|
||||
$$
|
||||
|
||||
Then $f$ and $g$ are not compatible (and $g$ grows faster than $f$). Applying this to the last two values of $f$ and $g$, we have
|
||||
@@ -616,7 +618,7 @@ so $f(x) = \exp(x^2)$ grows faster than $g(x) = \exp(x)^2$.
|
||||
Keeping in mind that logarithms grow slower than powers which grow slower than exponentials ($a > 1$) can help understand growth at $\infty$ as a comparison of leading terms does for rational functions.
|
||||
|
||||
|
||||
We can immediately put this to use to compute $\lim_{x\rightarrow 0+} x^x$. We first express this problem using $x^x = (\exp(\ln(x)))^x = e^{x\ln(x)}$. Rewriting $u(x) = \exp(\ln(u(x)))$, which only uses the basic inverse relation between the two functions, can often be a useful step.
|
||||
We can immediately put this to use to compute $\lim_{x\rightarrow 0+} x^x$. We first express this problem using $x^x = (\exp(\ln(x)))^x = e^{x\ln(x)}$. Rewriting $u(x) = \exp(\ln(u(x)))$ can often be a useful step. This rewriting only uses the basic inverse relation between the exponential and logarithmic functions.
|
||||
|
||||
|
||||
As $f(x) = e^x$ is a suitably nice function (continuous) so that the limit of a composition can be computed through the limit of the inside function, $x\ln(x)$, it is enough to see what $\lim_{x\rightarrow 0+} x\ln(x)$ is. We *re-express* this as a limit at $\infty$
|
||||
@@ -636,9 +638,10 @@ The last equality follows, as the function $x$ dominates the function $\ln(x)$.
|
||||
###### Question
|
||||
|
||||
|
||||
Select the graph for which the limit at $a$ is infinite.
|
||||
Select the graph in @fig-select-graph-limit-at-at-infinite for which the limit at $a$ is infinite.
|
||||
|
||||
|
||||
::: {#fig-select-graph-limit-at-at-infinite}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
@@ -677,12 +680,15 @@ plotly()
|
||||
hotspotq(imgfile, (1/2,1), (1/2,1))
|
||||
```
|
||||
|
||||
Select the graph for which the limit $a$ is infinity
|
||||
:::
|
||||
|
||||
###### Question
|
||||
|
||||
|
||||
Select the graph for which the limit at $\infty$ appears to be defined.
|
||||
|
||||
Select the graph in @fig-select-graph-limit-at-infty-exists for which the limit at $\infty$ appears to be defined.
|
||||
|
||||
::: {#fig-select-graph-limit-at-infty-exists}
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
@@ -715,6 +721,8 @@ savefig(p, imgfile)
|
||||
plotly()
|
||||
hotspotq(imgfile, (1/2,1), (1/2,1))
|
||||
```
|
||||
Select the graph for which a limit (finite) at $\infty$ appears to exist
|
||||
:::
|
||||
|
||||
###### Question
|
||||
|
||||
@@ -804,8 +812,8 @@ Find $\lim_{x \rightarrow 2+} (x-3)/(x-2)$.
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices=["``L=-\\infty``", "``L=-1``", "``L=0``", "``L=\\infty``"]
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
answer = 1
|
||||
radioq(choices, answer)
|
||||
```
|
||||
|
||||
Find $\lim_{x \rightarrow -3-} (x-3)/(x+3)$.
|
||||
@@ -815,8 +823,8 @@ Find $\lim_{x \rightarrow -3-} (x-3)/(x+3)$.
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices=["``L=-\\infty``", "``L=-1``", "``L=0``", "``L=\\infty``"]
|
||||
answ = 4
|
||||
radioq(choices, answ)
|
||||
answer = 4
|
||||
radioq(choices, answer)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -866,7 +874,7 @@ Use this fact, to find $L$
|
||||
|
||||
|
||||
```{julia}
|
||||
limit(ex1 - (w/2 - 1), w=>0)
|
||||
limit(ex1 - (w/2 - 1), w=>0; dir="+")
|
||||
```
|
||||
|
||||
$L$ is:
|
||||
@@ -907,7 +915,8 @@ For which value(s) of $k$ in $1,2,3$ is the limit $0$? (Do the above $3$ times u
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = ["``1``", "``2``", "``3``", "``1,2``", "``1,3``", "``2,3``", "``1,2,3``"]
|
||||
radioq(choices, 1, keep_order=true)
|
||||
explanation = "Fix `k` to be an integer (`1`, `2`, or `3`) and then compute `limit(sin(sin(x^2))/x^k, x=>0)`"
|
||||
buttonq(choices, 1; explanation)
|
||||
```
|
||||
|
||||
###### Question: No limit
|
||||
@@ -923,8 +932,8 @@ choices=["The limit does exist - it is any number from -1 to 1",
|
||||
"Err, the limit does exists and is 1",
|
||||
"The function oscillates too much and its y values do not get close to any one value",
|
||||
"Any function that oscillates does not have a limit."]
|
||||
answ = 3
|
||||
radioq(choices, answ)
|
||||
answer = 3
|
||||
buttonq(choices, answer)
|
||||
```
|
||||
|
||||
###### Question $0^0$ is not *always* $1$
|
||||
@@ -947,8 +956,8 @@ Consider different values of $k$ to see if this limit depends on $k$ or not. Wha
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = ["``1``", "``k``", "``\\log(k)``", "The limit does not exist"]
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
answer = 1
|
||||
buttonq(choices, answer)
|
||||
```
|
||||
|
||||
Now, consider this limit:
|
||||
@@ -958,7 +967,7 @@ $$
|
||||
\lim_{x \rightarrow 0+} x^{1/\log_k(x)} = L.
|
||||
$$
|
||||
|
||||
In `julia`, $\log_k(x)$ is found with `log(k,x)`. The default, `log(x)` takes $k=e$ so gives the natural log. So, we would define `h`, for a given `k`, with
|
||||
In `Julia`, $\log_k(x)$ is found with `log(k,x)`. The default, `log(x)` takes $k=e$ so gives the natural log. So, we would define `h`, for a given `k`, with
|
||||
|
||||
|
||||
```{julia}
|
||||
@@ -973,8 +982,8 @@ Consider different values of $k$ to see if the limit depends on $k$ or not. What
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = ["``1``", "``k``", "``\\log(k)``", "The limit does not exist"]
|
||||
answ = 2
|
||||
radioq(choices, answ)
|
||||
answer = 2
|
||||
buttonq(choices, answer)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -996,8 +1005,9 @@ choices=[
|
||||
"the first, second and third ones",
|
||||
"the first, second, third, and fourth ones",
|
||||
"all of them"]
|
||||
answ = 5
|
||||
radioq(choices, answ, keep_order=true)
|
||||
answer = 5
|
||||
explanation = L"Try them all, you will get $\infty$"
|
||||
buttonq(choices, answer; explanation)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1015,8 +1025,8 @@ L"We can talk about the limit at $\infty$ of $f(x) - mx$ being $b$",
|
||||
L"We can say $f(x) - (mx+b)$ has a horizontal asymptote $y=0$",
|
||||
L"We can say $f(x) - mx$ has a horizontal asymptote $y=b$",
|
||||
"Any of the above"]
|
||||
answ = 5
|
||||
radioq(choices, answ, keep_order=true)
|
||||
answer = 5
|
||||
buttonq(choices, answer)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1056,6 +1066,6 @@ choices = [L" $f(x)$ has a limit of $1$ as $x \rightarrow 0$",
|
||||
L" $f(x)$ has a limit of $-1$ as $x \rightarrow 0$",
|
||||
L" $f(x)$ does not have a limit as $x \rightarrow 0$"
|
||||
]
|
||||
answ = 3
|
||||
radioq(choices, answ)
|
||||
answer = 3
|
||||
buttonq(choices, answer)
|
||||
```
|
||||
@@ -21,9 +21,13 @@ nothing
|
||||
|
||||
---
|
||||
|
||||
](./figures/mona-lisa-recursive.png)
|
||||
::: {#fig-mona-mona-mona-lisa}
|
||||

|
||||
|
||||
This section expands on limits of infinite sequences and their sums.
|
||||
Smaller and smaller and smaller..., the [Droste effect](https://en.wikipedia.org/wiki/Droste_effect)
|
||||
:::
|
||||
|
||||
This section expands on limits of infinite sequences and their sums. The material is typically part of the second semester of calculus, but doesn't rely on any new material beyond that on limits already introduced.
|
||||
|
||||
|
||||
## Definitions
|
||||
@@ -37,7 +41,7 @@ A series is a sum of an infinite sequence $\sum_{i=1}^\infty a_i = a_1 + a_2 + a
|
||||
As mentioned, a sequence converges to $L$ if for any $\epsilon$ we can find an $M$ such that if $n > M$ then $|a_n - L| < \epsilon$. A non-convergent sequence is called *divergent*. Series too may be convergent of divergent, with details to come.
|
||||
|
||||
|
||||
## Examples
|
||||
##### Example
|
||||
|
||||
|
||||
Some examples of sequences are:
|
||||
@@ -53,29 +57,26 @@ Some examples of sequences are:
|
||||
|
||||
### Some limit theorems for sequences
|
||||
|
||||
The limit theorems apply to limits of sequences as well:
|
||||
The limit theorems apply to limits of sequences as well, including the following:
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
#### The squeeze theorem
|
||||
:::{.theorem title="The squeeze theorem"}
|
||||
|
||||
If $l_n < a_n < r_n$ and *both* $l_n$ and $r_n$ converge to $L$ then $a_n$ converges to $L$.
|
||||
:::
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
#### Linear combinations
|
||||
:::{.theorem title="Linear combinations"}
|
||||
If $a_n \rightarrow L$ and $b_n \rightarrow M$ then for constants $c$ and $d$:
|
||||
$c\cdot a_n + d \cdot b_n \rightarrow c\cdot L + d\cdot M$.
|
||||
:::
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
#### Products and ratios
|
||||
If $a_n \rightarrow L$ and $b_n \rightarrow M$
|
||||
$a_n \cdot b_n \rightarrow LM$ and if $M != 0$
|
||||
$a_n / b_n \rightarrow L/M$.
|
||||
:::{.theorem title="Products and ratios"}
|
||||
If $a_n \rightarrow L$ and $b_n \rightarrow M$ then
|
||||
$a_n \cdot b_n \rightarrow LM$.
|
||||
|
||||
Further, if $M \neq 0$ then $a_n / b_n \rightarrow L/M$.
|
||||
:::
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
#### Composition
|
||||
:::{.theorem title="Composition"}
|
||||
If the function $f(x)$ has a limit of $L$ at $b$ and
|
||||
$a_n$ converges to $b$ *and* $a_n \neq b$ for large $n$ then
|
||||
|
||||
@@ -89,17 +90,18 @@ $$
|
||||
|
||||
We mention a few other limit theorems for sequences.
|
||||
|
||||
One fact about convergent series is
|
||||
One fact about convergent series is:
|
||||
|
||||
> Convergent series are bounded.
|
||||
:::{.relationship title="Bounded"}
|
||||
Convergent series are bounded.
|
||||
:::
|
||||
|
||||
(That is, there exists an $M>0$ with $-M \leq a_n \leq M$ for all $n$.)
|
||||
|
||||
|
||||
Not all bounded sequences converge; however:
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
##### Bounded and monotone
|
||||
:::{.relationship title="Bounded and monotone"}
|
||||
If $a_n$ is monotone increasing ($a_n \leq a_{n+1}$ for all $n$) and *bounded* then $a_n$ converges.
|
||||
|
||||
This is a [monotone convergence theorem](https://en.wikipedia.org/wiki/Monotone_convergence_theorem). It's proof shows the least upper bound is the limit. A similar statement holds for bounded, monotone decreasing sequences.
|
||||
@@ -107,24 +109,20 @@ This is a [monotone convergence theorem](https://en.wikipedia.org/wiki/Monotone_
|
||||
|
||||
The sequence $a_n = (1 + 1/n)^n$ is both monotone increasing and bounded, hence convergent. As mentioned, it converges to $e$. That this limit has a known value is not a result of the theorem, which only says some value exists.
|
||||
|
||||
|
||||
|
||||
A *subsequence* of an infinite sequence is an infinite sequence chosen by taking only some of the terms (along the same order). A simple example would be $b_n = a_{2n}$, which would take every other term of the sequence $\{a_n\}$. More generally if $\phi(n)$ is an increasing function with integer values, then $b_n = a_{\phi(n)}$ would be a formal way to define a subsequence.
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
##### Bolzano-Weierstrass theorem
|
||||
:::{.theorem title="Bolzano-Weierstrass theorem"}
|
||||
|
||||
Every bounded sequence has a convergent subsequence.
|
||||
:::
|
||||
|
||||
A sketch is to consider the interval $I_1 = [-M,M]$. It has infinitely many values of the sequence in it when $M$ is a bound. Divide this interval in half. There is a choice of $I_2$ so that it also contains infinitely many points of the sequence. (Maybe both do, in which case either choice can be made.) This splitting and choosing can be repeated to create an infinite sequence of *nested* intervals $\{I_n\}$ each containing infinitely many points of $\{a_n\}$ and each of length $M/2^{n-2}$. As these intervals are nested the left-hand endpoints are bounded and increasing, hence convergent.
|
||||
A sketch is to consider the interval $I_1 = [-M,M]$. It has infinitely many values of the sequence in it when $M$ is a bound. Divide this interval in half. There is a choice of $I_2$ so that it also contains infinitely many points of the sequence. (Maybe both do, in which case either choice can be made.) This splitting and choosing can be repeated to create an infinite sequence of *nested* intervals $\{I_n\}$ each containing infinitely many points of $\{a_n\}$ and each of length $M/2^{n-2}$. As these intervals are nested the values closest to the left-hand endpoints are bounded and increasing, hence convergent.
|
||||
|
||||
There may be many different convergent subsequences, this just identified one.
|
||||
There may be many different convergent subsequences, this sketch just identified one.
|
||||
|
||||
Finally, this following fact can be used to reverse the pedagogical approach of defining limits by starting with limits restricted to sequences.
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
##### Limits of functions
|
||||
:::{.relationship title="Limits of functions"}
|
||||
|
||||
The limit of $f(x)$ at $c$ exists and equals $L$ if and only if for *every* sequence $x_n$ in the domain of $f$ converging to $c$ the sequence $s_n = f(x_n)$ converges to $L$.
|
||||
:::
|
||||
@@ -170,10 +168,9 @@ simplify(out)
|
||||
|
||||
We can't set a *value* for `r` symbolically and were `r=1` this sum is different, but we have $|r| < 1$ so the proposed is indeed the partial sum.
|
||||
|
||||
As $n \rightarrow \infty$ for $|r| < 1$ this expression goes to $s = r / (1-r)^2$. It would diverge otherwise.
|
||||
As $n \rightarrow \infty$ for $|r| < 1$ this expression goes to $s = r / (1-r)^2$. It would diverge otherwise.^[This fact has other derivations which don't require knowing the special formula.]
|
||||
|
||||
|
||||
##### Example: Sum of inverse factorials
|
||||
##### Example: sum of inverse factorials
|
||||
|
||||
Consider these two sequences:
|
||||
|
||||
@@ -182,14 +179,14 @@ s_n = \sum_{k=0}^n \frac{1}{k!}, \quad
|
||||
p_n = \left(1 + \frac{1}{n}\right)^n
|
||||
$$
|
||||
|
||||
We know $p_n \rightarrow e$. We will see that it also follows that $s_n \rightarrow e$. That is the series for the sequence $a_k = 1/k!$ converges to $e$.
|
||||
We know $p_n \rightarrow e$. With a fair amount of effort, we will see that it also follows that $s_n \rightarrow e$. That is the series for the sequence $a_k = 1/k!$ converges to $e$.
|
||||
|
||||
First we see that $e$ is in the ballpark.
|
||||
First we confirm that $e$ is in the ballpark.
|
||||
|
||||
We bound each term of $s_n$ for $k \geq 2$
|
||||
For $k \geq 2$ bound each term of $s_n$ with:
|
||||
|
||||
$$
|
||||
a_k = \frac{1}{k!} \leq \frac{1}{(k(k-1))} = \frac{1}{k-1} - \frac{1}{k},
|
||||
a_k = \frac{1}{k!} \leq \frac{1}{k\cdot(k-1)} = \frac{1}{k-1} - \frac{1}{k},
|
||||
$$
|
||||
|
||||
With this, we can identify a telescoping sum:
|
||||
@@ -203,7 +200,7 @@ s_n &= \sum_{k=0}^n a_k\\
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
This is in agreement with $s = e$. To get that value takes more effort and different bounds.
|
||||
With this bound the sequence $s_n$ is bounded and monotone, hence convergent. To identify the value it converges to is $e$ takes more effort and different bounds.
|
||||
|
||||
|
||||
|
||||
@@ -217,7 +214,7 @@ p_n &= \left(1 + \frac{1}{n}\right)^n\\
|
||||
&= \sum_{k=0}^n \frac{n!}{k!(n-k)!}\frac{1}{n^k}\\
|
||||
&= \sum_{k=0}^n \frac{1}{k!}\frac{n!}{(n-k)!}\frac{1}{n^k}\\
|
||||
&= \sum_{k=0}^n \frac{1}{k!} \cdot \left(1 - \frac{1}{n}\right) \cdot \left(1-\frac{2}{n}\right) \cdot \cdots \cdot \left(1 - \frac{k-1}{n}\right)\\
|
||||
&= \sum_{k=0}^n \frac{1}{k!} b_{n,k}
|
||||
&= \sum_{k=0}^n \frac{1}{k!} b_{n,k}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
@@ -242,7 +239,7 @@ $$
|
||||
\left(1 - \frac{1}{n}\right) &\left(1 - \frac{2}{n}\right)\cdot\left(1 - \frac{k}{n}\right)\cdot\left(1 - \frac{k+1}{n}\right)\\
|
||||
&> \left(1 - \frac{1 + 2 + \cdots + k}{n}\right)\left(1 + \frac{k+1}{n}\right)\\
|
||||
&= 1 - \frac{1 + 2 + \cdots + k + (k+1)}{n} + \frac{(1+2+\cdots+k)(k+1)}{n}\\
|
||||
&> 1 - \frac{1 + 2 + \cdots + k + (k+1)}{n}
|
||||
&> 1 - \frac{1 + 2 + \cdots + k + (k+1)}{n}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
@@ -255,7 +252,7 @@ p_n &= \sum_{k=0}^n \frac{1}{k!}b_{n,l}\\
|
||||
&= s_n - \sum_{k=0}^n \frac{1}{k!}\frac{(k-1)k}{2n}\\
|
||||
&= s_n - \frac{1}{2n} \sum_{k=2}^n \frac{1}{(k-2)!}\\
|
||||
&= s_n - \frac{1}{2n} s_{n-2}\\
|
||||
&> s_n - \frac{3}{2n}
|
||||
&> s_n - \frac{3}{2n}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
@@ -279,16 +276,25 @@ There are some general things that are the case for series to understand converg
|
||||
|
||||
First we consider only sequences with non-negative terms.
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
##### Necessary condition for convergence
|
||||
:::{.relationship title="Necessary condition for convergence"}
|
||||
If $a_n \geq 0$ for each $n$ then a necessary condition that $s_n \rightarrow s$ is that $a_n \rightarrow 0$.
|
||||
:::
|
||||
|
||||
This says if $a_n$ does not converge to $0$ then $s_n$ diverges. It is definitely not the case that a sequence that converges to $0$ will lend itself to a convergent series. A famous example would be $\sum_{i=1}^n 1/i$ which diverges. The partial sums of this series are termed the [harmonic series](https://tinyurl.com/ua4893w5) and have the property that $s_n = \ln(n) + \gamma + 1/(2n) + \epsilon_n$ where $e_n \rightarrow 0$ and $\gamma \approx 0.5772$ is a constant termed the Euler-Mascheroni constant. (See `MathConstants.γ`.)
|
||||
This says if $a_n$ does not converge to $0$ then $s_n$ diverges. It is definitely not the case that a sequence that converges to $0$ will lend itself to a convergent series. An important example is the series known as the harmonic series:
|
||||
|
||||
$$
|
||||
s_n = 1 + \frac{1}{2} + \frac{1}{3} + \cdots + \frac{1}{n} = \sum_{i=1}^n \frac{1}{i}.
|
||||
$$
|
||||
|
||||
This series has $1/n \rightarrow 0$, but $s_n \rightarrow \infty$. It is [known](https://en.wikipedia.org/wiki/Euler%27s_constant) that
|
||||
|
||||
$$
|
||||
\lim_{n \rightarrow \infty} \left( \sum_{i=1}^n \frac{1}{i} - \ln(i) \right) = \gamma = 0.57721\cdots
|
||||
$$
|
||||
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
##### Only the tail terms determine convergence
|
||||
:::{.relationship title="Only the tail terms determine convergence"}
|
||||
|
||||
Convergence of $\sum_n a_n$ only depends on the terms for $n > N$ for any fixed $N$.
|
||||
|
||||
Only the tail terms determine convergence, but every term determines the value of the series when it converges.
|
||||
@@ -297,8 +303,8 @@ Only the tail terms determine convergence, but every term determines the value o
|
||||
Fix any $N > 0$, the partial sums with $n>N$ satisfy:
|
||||
|
||||
$$
|
||||
s_n = \sum_{k=1}^n a_k
|
||||
=\sum_{k=1}^N a_k + \sum_{k=N}^n a_k
|
||||
s_n = \sum_{i=1}^n a_i
|
||||
=\sum_{i=1}^N a_i + \sum_{i=N}^n a_i
|
||||
= s_N + (s_n - s_N)
|
||||
$$
|
||||
|
||||
@@ -306,13 +312,13 @@ The limit as $n \rightarrow \infty$ does not depend on the constant $s_N$.
|
||||
|
||||
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
##### Comparison test
|
||||
If $0 \leq c_n \leq a_n \leq b_n$ for each $n$ then
|
||||
:::{.theorem title="Comparison test"}
|
||||
|
||||
* if $\sum_{i=1}^n b_i$ converges then $\sum_{i=0}^n a_i$ converges;
|
||||
If $0 \leq c_n \leq a_n \leq b_n$ for each $n$ then:
|
||||
|
||||
* if $\sum_{i=1}^n c_i$ diverges then $\sum_{i=0}^n a_i$ diverges.
|
||||
* if $\sum_{i=1}^n b_i$ converges then $\sum_{i=1}^n a_i$ converges;
|
||||
|
||||
* if $\sum_{i=1}^n c_i$ diverges then $\sum_{i=1}^n a_i$ diverges.
|
||||
:::
|
||||
|
||||
This can be used to prove, for example, that if a series based on a non-negative sequence converges, any series based on a subsequence will also converge.
|
||||
@@ -348,12 +354,11 @@ We can use the comparison test to say $s_n$ converges, as we earlier saw the bou
|
||||
|
||||
There are other tests that, when applicable, are more direct and avoid needing to identify a bound.
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
##### Ratio test
|
||||
:::{.theorem title="Ratio test"}
|
||||
Consider the series formed from the sequence $\{a_n\}$ with $a_n \geq 0$. The ratios $a_{n+1}/a_n$ can determine if the series converges or diverges:
|
||||
|
||||
* if $a_{n+1}/a_n \rightarrow L$ and $L < 1$ then the series converges
|
||||
* if $a_{n+1}/a_n \rightarrow L$ and $L > 1$ then the series diverges
|
||||
* if $a_{n+1}/a_n \rightarrow L$ and $L < 1$ then the series converges;
|
||||
* if $a_{n+1}/a_n \rightarrow L$ and $L > 1$ then the series diverges; and
|
||||
* if $a_{n+1}/a_n \rightarrow L$ and $L = 1$ then the series may or may not converge.
|
||||
:::
|
||||
|
||||
@@ -363,7 +368,7 @@ $$
|
||||
a_{n+1} \leq a_n r \leq a_{n-1}r^2 \leq \cdots \leq a_1 r^n
|
||||
$$
|
||||
|
||||
By the comparison test, the series $\sum a_k$ converges, since $0 < r < 1$.
|
||||
By the comparison test, the series $\sum a_i$ converges, since $0 < r < 1$.
|
||||
|
||||
The case for $L > 1$ is similar, only we find a lower bound on each term.
|
||||
|
||||
@@ -371,9 +376,9 @@ For the case $L=1$---which is where most hard problems fall---we have examples w
|
||||
|
||||
A similar type of theorem involves powers of the terms in the sequence
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
##### Root test
|
||||
Consider the series formed from the sequence $\{a_n\}$ with $a_n \geq 0$. The values of $(a_n)^{1/n}$ can determine if the series converges or diverges:
|
||||
:::{.theorem title="Root test"}
|
||||
|
||||
Consider the series formed from the sequence $\{a_n\}$ with $a_n \geq 1$. The values of $(a_n)^{1/n}$ can determine if the series converges or diverges:
|
||||
|
||||
* if $(a_n)^{1/n} \rightarrow L$ and $L < 1$ then the series converges
|
||||
* if $(a_n)^{1/n} \rightarrow L$ and $L > 1$ then the series diverges
|
||||
@@ -386,21 +391,32 @@ $a_0 + a_1 + a_2 + \cdots + a_n < r^0 + r^1 + r^2 + \cdots + r^n$. The geometric
|
||||
|
||||
The same two examples ($a_n = 1/n$ and $a_n = 1/n^2$) give examples of divergent and convergent series when $L = 1$.
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
##### The p-series test
|
||||
:::{.theorem title="The p-series test"}
|
||||
Fix $p>0$. Consider the series
|
||||
$$
|
||||
s = \sum_{i=1}^\infty \frac{1}{i^p}
|
||||
s = \sum_{i=1}^\infty \frac{1}{i^p}.
|
||||
$$
|
||||
|
||||
If $p > 1$ this series is convergent; if $0 < p \leq 1$ the series is divergent.
|
||||
* if $p > 1$ this series is convergent;
|
||||
* if $0 < p \leq 1$ the series is divergent.
|
||||
:::
|
||||
|
||||
This test is a consequence of a more general integral test which will be discussed later, below we offer a specific proof.
|
||||
|
||||
When $p = 1$ this clearly diverges, it being the harmonic series.
|
||||
When $p = 1$ this diverges, it being the harmonic series. A short [proof](https://web.williams.edu/Mathematics/lg5/harmonic.pdf) is to assign the answer a value, say $H$ and then:
|
||||
|
||||
When $p < 1$, we have $i^p < i$ so $1/i^p > 1/i$. By the comparison test (to the harmonic series) the series $s$ will diverge.
|
||||
$$
|
||||
\begin{array}{lllllllllllllll}
|
||||
H &=& 1 &+& \frac{1}{2} &+& \frac{1}{3} &+& \frac{1}{4} &+& \frac{1}{5} &+& \frac{1}{6} &+& \cdots\\
|
||||
&\geq& 1 &+& \frac{1}{2} &+& \frac{1}{4} &+& \frac{1}{4} &+& \frac{1}{6} &+& \frac{1}{6} &+& \cdots\\
|
||||
&=& 1 &+& \frac{1}{2} &+& \frac{1}{2} & & &+& \frac{1}{3} & & &+& \cdots\\
|
||||
&=& \frac{1}{2} &+& H & & & & & & & & & &
|
||||
\end{array}
|
||||
$$
|
||||
|
||||
The second line comes by replacing denominators of the form $2n-1$ by the larger value $2n$ and then adding $1/(2n)$ to itself to get $1/n$. Rearranging leaves $H$ and an extra $1/2$. No finite $H$ can satisfy $H \geq 1/2 + H$, so $H$ must be infinite.
|
||||
|
||||
When $p < 1$, we have for $i \geq 1$ that $i^p < i$ so $1/i^p > 1/i$. By the comparison test (to the harmonic series) the series $s$ will diverge.
|
||||
|
||||
|
||||
To prove this series converges when $p > 1$, we split the sum up into different pieces from $2^k$ to $2^{k+1}-1$. Call this sum $t_k$ then $s = \sum_k t_k$ with
|
||||
@@ -417,14 +433,15 @@ The above replaces each term with the smallest value over $2^k$ to $2^{k+1}-1$ a
|
||||
For $p > 1$, the value of $2/2^p < 1$. That is, $s$ is bounded by a geometric series hence convergent.
|
||||
|
||||
##### Example
|
||||
Consider this series
|
||||
Consider the series
|
||||
|
||||
$$
|
||||
\sum_{n=1}^\infty \frac{n^k}{5^n},
|
||||
$$
|
||||
|
||||
for some positive integer $k$.
|
||||
|
||||
Will this converge?
|
||||
Will this series converge?
|
||||
|
||||
The ratio of $a_{n+1}$ to $a_n$ is:
|
||||
|
||||
@@ -439,10 +456,10 @@ As the limit of this ratio is less than $1$, the series converges.
|
||||
|
||||
|
||||
##### Example
|
||||
Let $a$ be a positive number and consider this series
|
||||
Let $a$ be a positive number and consider this series:
|
||||
|
||||
$$
|
||||
\sum_{n=1}^\infty \frac{a^n}{n^n}
|
||||
\sum_{n=1}^\infty \frac{a^n}{n^n}.
|
||||
$$
|
||||
|
||||
Does this converge?
|
||||
@@ -462,14 +479,14 @@ That this is less than $1$ says the series converges.
|
||||
Consider this series:
|
||||
|
||||
$$
|
||||
\sum_{n=3}^\infty \frac{1}{n^{3/2} \log(n)}
|
||||
\sum_{n=3}^\infty \frac{1}{n^{3/2} \log(n)}.
|
||||
$$
|
||||
|
||||
This isn't exactly in the format for the $p$-series test, but we note that $\log(n) \geq 1$ for $n\geq 3$. So
|
||||
|
||||
$$
|
||||
a_n = \frac{1}{n^{3/2} \log(n)}
|
||||
\leq \frac{1}{n^{3/2}}
|
||||
\leq \frac{1}{n^{3/2}}.
|
||||
$$
|
||||
|
||||
The series $\sum n^{-3/2}$ converges by the $p$-series test, hence the series in question must also converge.
|
||||
@@ -484,9 +501,10 @@ First, we say that a series is *absolutely convergent* if $\sum |a_n|$ converges
|
||||
A series which is convergent but not absolutely convergent is termed *conditionally convergent*.
|
||||
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
##### Absolute convergence implies convergence
|
||||
:::{.theorem title="Absolute convergence implies convergence"}
|
||||
|
||||
If the series $\sum a_k$ is *absolutely convergent* then it is convergent.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
@@ -520,8 +538,7 @@ This series is conditionally convergent---not absolutely convergent.
|
||||
|
||||
Why follows immediately from a more general statement.
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
##### Alternating series test
|
||||
:::{.theorem title="Alternating series test"}
|
||||
If $a_n$ and $a_{n+1}$ have different signs for each $n$ *and* $|a_n| \rightarrow 0$ *monotonically* then
|
||||
$$
|
||||
s = \sum_{k=1}^\infty a_k = a_1 + a_2 + a_3 + \cdots
|
||||
@@ -580,7 +597,7 @@ Take the sequence $\{ a_n \}$. This is simply a list of values with some indicat
|
||||
|
||||
* If the series is *conditionally convergent* but not *absolutely convergent* then a reordering may converge (conditionally) to a different value or even diverge.
|
||||
|
||||
The case of the latter is the alternating harmonic series. to see it diverges, we note that the subsequences of both negative and positive terms diverge. Call these $\{b_n\}$ and $\{c_n\}$. To see that we can make these diverge, we note that for any $N>0$ and $L$ we can find $k$ so that $b_N + b_{N+1} + \cdots + b_{N+k} > L$. Now for each $i$, we take a consecutive subsequence of values of $b_n$ which sum to $i + |c_i|$. Then the subsequence formed by a group of $b$s followed by $c_i$ will have partial sums always bigger than $i$, hence divergent.
|
||||
The case of the latter is the alternating harmonic series. to see it diverges, we note that the subsequences of both negative and positive terms diverge. Call these $\{b_n\}$ and $\{c_n\}$. To see that we can make these diverge, we note that for any $N>0$ and $L$ we can find $k$ so that $b_N + b_{N+1} + \cdots + b_{N+k} > L$. Now for each $i$, we take a consecutive subsequence of values of $b_n$ which sum to $i + \lvert c_i\rvert$. Then the subsequence formed by a group of $b$s followed by $c_i$ will have partial sums always bigger than $i$, hence divergent.
|
||||
|
||||
|
||||
## Power series
|
||||
@@ -597,24 +614,24 @@ A typical case is $c=0$. For any fixed $x$ this is simply a series. Convergence
|
||||
|
||||
Suppose the series $\sum a_n$ is absolutely convergent. Then there are some values around $c$ for which the series converges ($x=c$ is one). The *radius of convergence* is a value $r$ for which
|
||||
|
||||
* if $|x-c| < r$ then the power series converges absolutely; and
|
||||
* if $|x-c| > r$ the power series *diverges*.
|
||||
* if $\lvert x-c\rvert < r$ then the power series converges absolutely; and
|
||||
* if $\lvert x-c\rvert > r$ the power series *diverges*.
|
||||
|
||||
The root test indicates why such a value exists.
|
||||
|
||||
Suppose we consider the term $b_n = a_n (x-c)^n$. Then
|
||||
|
||||
$$
|
||||
(|b_n|)^{1/n} = (|a_n|)^{1/n} |x-c|
|
||||
\lvert b_n\rvert^{1/n} = \lvert a_n\rvert^{1/n} \lvert x-c \rvert
|
||||
$$
|
||||
|
||||
If $(|a_n|^{1/n}) \rightarrow L$ then the root test indicates if the power series converges absolutely or not. In particular. If $L|x-c| < 1$ it converges and if $L|x-c| > 1$ it diverges. That is if $|x-c| < 1/L$ or $|x-c| > 1/L$. Taking $r=1/L$ yields the radius of convergence. (For cases where the limit does not exist, a relaxed version of the root test with the *limit inferior* is applicable.)
|
||||
If $\lvert a_n \rvert^{1/n} \rightarrow L$ then the root test indicates if the power series converges absolutely or not. In particular. If $L\lvert x-c \rvert < 1$ it converges and if $L\lvert x-c \rvert > 1$ it diverges. That is if $\lvert x-c \rvert < 1/L$ or $\lvert x-c \rvert > 1/L$. Taking $r=1/L$ yields the radius of convergence. (For cases where the limit does not exist, a relaxed version of the root test with the *limit inferior* is applicable.)
|
||||
|
||||
The ratio test can also be used to establish the radius of convergence provided:
|
||||
|
||||
$$
|
||||
\frac{|a_{n+1}||(x-c)^{n+1}|}{|a_n||(x-c)^n|} =
|
||||
\frac{|a_{n+1}|}{|a_n|} |x-c| \rightarrow L |x-c|.
|
||||
\frac{\lvert a_{n+1} \rvert\lvert (x-c)^{n+1} \rvert}{\lvert a_n \rvert\lvert (x-c)^n \rvert} =
|
||||
\frac{\lvert a_{n+1} \rvert}{\lvert a_n \rvert} \lvert x-c \rvert \rightarrow L \lvert x-c \rvert.
|
||||
$$
|
||||
|
||||
Again, $r=1/L$.
|
||||
@@ -630,9 +647,9 @@ $$
|
||||
This has $c=0$ and $a_n = 1/n!$. The ratio test simplifies to
|
||||
|
||||
$$
|
||||
\frac{|x-c|^{n+1}}{(n+1)!} \cdot
|
||||
\frac{n!}{|x-c|^n} =
|
||||
\frac{|x-c|}{n} \rightarrow 0
|
||||
\frac{\lvert x-c \rvert^{n+1}}{(n+1)!} \cdot
|
||||
\frac{n!}{\lvert x-c \rvert^n} =
|
||||
\frac{\lvert x-c \rvert}{n} \rightarrow 0
|
||||
$$
|
||||
|
||||
Hence $r=\infty$ and the power series is always absolutely convergent.
|
||||
@@ -647,10 +664,10 @@ $$
|
||||
This has term $a_n = (-1)^{n} x^{2n+1}/(2n+1)$, $n\geq 0$. The root test for absolute convergence has
|
||||
|
||||
$$
|
||||
(|a_n|)^{1/n} = \frac{x^{2 + 1/n}}{(2n+1)^{1/n}} \rightarrow x^2
|
||||
(\lvert a_n \rvert)^{1/n} = \frac{x^{2 + 1/n}}{(2n+1)^{1/n}} \rightarrow x^2
|
||||
$$
|
||||
|
||||
Provided $|x| < 1$ the power series will converge.
|
||||
Provided $\lvert x \rvert < 1$ the power series will converge.
|
||||
|
||||
Both these examples are related to *Taylor series* for some function.
|
||||
|
||||
@@ -1077,8 +1094,8 @@ radioq(choices, 2)
|
||||
|
||||
The following extends the comparison test:
|
||||
|
||||
:::{.callout-note appearance="minimal"}
|
||||
### Limit comparison test
|
||||
:::{.theorem title="Limit comparison test"}
|
||||
|
||||
Take two series with *positive* terms $\sum a_n$ and $\sum b_n$.
|
||||
|
||||
If $\lim_{n\rightarrow \infty} a_n/b_n = c$ with $0 < c < \infty$ then either both series converge of both series diverge.
|
||||
@@ -1154,7 +1171,7 @@ L"s - t",
|
||||
L"s \cdot t",
|
||||
L"s / t"
|
||||
]
|
||||
radioq(choices, 31; keep_order=true)
|
||||
radioq(choices, 3; keep_order=true)
|
||||
```
|
||||
|
||||
For completeness, [Wikipedia](https://en.wikipedia.org/wiki/Power_series#Multiplication_and_division) gives this formula for division $s/t = \sum_{n=0}^\infty d_n \cdot (x-c)^n$ where
|
||||
@@ -1164,15 +1181,18 @@ d_0 = \frac{a_0}{b_0}
|
||||
$$
|
||||
|
||||
and
|
||||
|
||||
$$
|
||||
d_n = \frac{1}{b_0^{n+1}} \cdot
|
||||
\begin{vmatrix}
|
||||
a_n & b_1 & b_2 & \cdots & b_n\\
|
||||
a_{n-1} & b_0 & b_1 & \cdots & b_{n-1}\\
|
||||
a_{n-2} & 0 & b_0 & \cdots & b_{n-1}\\
|
||||
\vdots & \vdots & \vdots & \ddots & \vdots\\\
|
||||
a_0 & 0 & 0 & \cdots & b_0
|
||||
\end{vmatrix}
|
||||
\det\left(
|
||||
\begin{array}{ccccc}
|
||||
a_n & b_1 & b_2 & \cdots & b_n\\
|
||||
a_{n-1} & b_0 & b_1 & \cdots & b_{n-1}\\
|
||||
a_{n-2} & 0 & b_0 & \cdots & b_{n-1}\\
|
||||
\vdots & \vdots & \vdots & \ddots & \vdots\\
|
||||
a_0 & 0 &0 & \cdots & b_0\\
|
||||
\end{array}
|
||||
\right)
|
||||
$$
|
||||
|
||||
The last operation is called the determinant and will be discussed later on.
|
||||
The last operation, $\det$, is called the *determinant* and will be discussed later on.
|
||||
Reference in new issue
Block a user