commit
1d12303253
@ -29,6 +29,7 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
||||
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
|
||||
Primes = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae"
|
||||
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
|
||||
QuizQuestions = "612c44de-1021-4a21-84fb-7261cf5eb2d4"
|
||||
RealPolynomialRoots = "87be438c-38ae-47c4-9398-763eabe5c3be"
|
||||
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
|
||||
Richardson = "708f8203-808e-40c0-ba2d-98a6953ed40d"
|
||||
@ -42,5 +43,7 @@ SymbolicNumericIntegration = "78aadeae-fbc0-11eb-17b6-c7ec0477ba9e"
|
||||
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
|
||||
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
|
||||
TaylorSeries = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"
|
||||
TermInterface = "8ea1fca8-c5ef-4a55-8b96-4e9afe9c9a3c"
|
||||
TextWrap = "b718987f-49a8-5099-9789-dcd902bef87d"
|
||||
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
|
||||
UnitfulUS = "7dc9378f-8956-57ef-a780-aa31cc70ff3d"
|
||||
|
@ -72,13 +72,11 @@ $$
|
||||
The author's apply this model to flu statistics from Hong Kong where:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
S(0) &= 7,900,000\\
|
||||
I(0) &= 10\\
|
||||
R(0) &= 0\\
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
In `Julia` we define these, `N` to model the total population, and `u0` to be the proportions.
|
||||
|
||||
@ -133,13 +131,11 @@ The plot shows steady decay, as there is no mixing of infected with others.
|
||||
Adding in the interaction requires a bit more work. We now have what is known as a *system* of equations:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
\frac{ds}{dt} &= -b \cdot s(t) \cdot i(t)\\
|
||||
\frac{di}{dt} &= b \cdot s(t) \cdot i(t) - k \cdot i(t)\\
|
||||
\frac{dr}{dt} &= k \cdot i(t)\\
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Systems of equations can be solved in a similar manner as a single ordinary differential equation, though adjustments are made to accommodate the multiple functions.
|
||||
|
||||
@ -282,12 +278,10 @@ We now solve numerically the problem of a trajectory with a drag force from air
|
||||
The general model is:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
x''(t) &= - W(t,x(t), x'(t), y(t), y'(t)) \cdot x'(t)\\
|
||||
y''(t) &= -g - W(t,x(t), x'(t), y(t), y'(t)) \cdot y'(t)\\
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
with initial conditions: $x(0) = y(0) = 0$ and $x'(0) = v_0 \cos(\theta), y'(0) = v_0 \sin(\theta)$.
|
||||
|
||||
|
@ -70,7 +70,6 @@ That is, if we stitched together pieces of the slope field, would we get a curve
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
#| cache: true
|
||||
## {{{euler_graph}}}
|
||||
function make_euler_graph(n)
|
||||
x, y = symbols("x, y")
|
||||
@ -241,17 +240,7 @@ It is more work for the computer, but not for us, and clearly a much better appr
|
||||
|
||||
## The Euler method
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
imgfile ="figures/euler.png"
|
||||
caption = """
|
||||
Figure from first publication of Euler's method. From [Gander and Wanner](http://www.unige.ch/~gander/Preprints/Ritz.pdf).
|
||||
"""
|
||||
|
||||
ImageFile(:ODEs, imgfile, caption)
|
||||
```
|
||||
.](./figures/euler.png)
|
||||
|
||||
The name of our function reflects the [mathematician](https://en.wikipedia.org/wiki/Leonhard_Euler) associated with the iteration:
|
||||
|
||||
@ -361,9 +350,13 @@ caption = """
|
||||
A child's bead game. What shape wire will produce the shortest time for a bed to slide from a top to the bottom?
|
||||
|
||||
"""
|
||||
ImageFile(:ODEs, imgfile, caption)
|
||||
#ImageFile(:ODEs, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
Restrict our attention to the $x$-$y$ plane, and consider a path, between the point $(0,A)$ and $(B,0)$. Let $y(x)$ be the distance from $A$, so $y(0)=0$ and at the end $y$ will be $A$.
|
||||
|
||||
|
||||
@ -378,16 +371,22 @@ caption = """
|
||||
As early as 1638, Galileo showed that an object falling along `AC` and then `CB` will fall faster than one traveling along `AB`, where `C` is on the arc of a circle.
|
||||
From the [History of Math Archive](http://www-history.mcs.st-and.ac.uk/HistTopics/Brachistochrone.html).
|
||||
"""
|
||||
ImageFile(:ODEs, imgfile, caption)
|
||||
#ImageFile(:ODEs, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||
.
|
||||
](./figures/galileo.png)
|
||||
|
||||
This simulation also suggests that a curved path is better than the shorter straight one:
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
#| cache: true
|
||||
##{{{brach_graph}}}
|
||||
|
||||
function brach(f, x0, vx0, y0, vy0, dt, n)
|
||||
@ -603,13 +602,11 @@ $$
|
||||
We can try the Euler method here. A simple approach might be this iteration scheme:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
x_{n+1} &= x_n + h,\\
|
||||
u_{n+1} &= u_n + h v_n,\\
|
||||
v_{n+1} &= v_n - h \cdot g/l \cdot \sin(u_n).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Here we need *two* initial conditions: one for the initial value $u(t_0)$ and the initial value of $u'(t_0)$. We have seen if we start at an angle $a$ and release the bob from rest, so $u'(0)=0$ we get a sinusoidal answer to the linearized model. What happens here? We let $a=1$, $L=5$ and $g=9.8$:
|
||||
|
||||
|
BIN
quarto/ODEs/figures/galileo.png
Normal file
BIN
quarto/ODEs/figures/galileo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
@ -87,13 +87,11 @@ $$
|
||||
Again, we can integrate to get an answer for any value $t$:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
x(t) - x(t_0) &= \int_{t_0}^t \frac{dv}{dt} dt \\
|
||||
&= (v_0t + \frac{1}{2}a t^2 - at_0 t) |_{t_0}^t \\
|
||||
&= (v_0 - at_0)(t - t_0) + \frac{1}{2} a (t^2 - t_0^2).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
There are three constants: the initial value for the independent variable, $t_0$, and the two initial values for the velocity and position, $v_0, x_0$. Assuming $t_0 = 0$, we can simplify the above to get a formula familiar from introductory physics:
|
||||
|
||||
@ -339,12 +337,10 @@ Differential equations are classified according to their type. Different types h
|
||||
The first-order initial value equations we have seen can be described generally by
|
||||
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
y'(x) &= F(y,x),\\
|
||||
y(x_0) &= x_0.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Special cases include:
|
||||
|
||||
@ -615,9 +611,11 @@ imgfile = "figures/verrazano-narrows-bridge-anniversary-historic-photos-2.jpeg"
|
||||
caption = """
|
||||
The cables of an unloaded suspension bridge have a different shape than a loaded suspension bridge. As seen, the cables in this [figure](https://www.brownstoner.com/brooklyn-life/verrazano-narrows-bridge-anniversary-historic-photos/) would be modeled by a catenary.
|
||||
"""
|
||||
ImageFile(:ODEs, imgfile, caption)
|
||||
# ImageFile(:ODEs, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||
 would be modeled by a catenary.](./figures/verrazano-narrows-bridge-anniversary-historic-photos-2.jpeg)
|
||||
---
|
||||
|
||||
|
||||
@ -668,13 +666,11 @@ Though `y` is messy, it can be seen that the answer is a quadratic polynomial in
|
||||
In a resistive medium, there are drag forces at play. If this force is proportional to the velocity, say, with proportion $\gamma$, then the equations become:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
x''(t) &= -\gamma x'(t), & \quad y''(t) &= -\gamma y'(t) -g, \\
|
||||
x(0) &= x_0, &\quad y(0) &= y_0,\\
|
||||
x'(0) &= v_0\cos(\alpha),&\quad y'(0) &= v_0 \sin(\alpha).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
We now attempt to solve these.
|
||||
|
||||
|
@ -84,7 +84,7 @@ DONE * modify sympy's show method
|
||||
|
||||
## TODO
|
||||
|
||||
|
||||
* ImageFile -> ![]() as much as possible
|
||||
* use pandoc references(?)
|
||||
* mermaid, ojs?
|
||||
|
||||
|
@ -94,22 +94,22 @@ gif_to_img_tpl = Mustache.mt"""
|
||||
<img src="data:image/gif;base64,{{{:data}}}" class="card-img-top" alt="{{{:alt}}}">
|
||||
"""
|
||||
|
||||
|
||||
function ImageFile(f::AbstractString, caption, alt, width)
|
||||
fcontent = occursin(r"^http", f) ? read(download(f), String) : read(f, String)
|
||||
data = base64encode(fcontent)
|
||||
content = Mustache.render(gif_to_img_tpl, data=data, alt=alt)
|
||||
caption = Markdown.parse(caption)
|
||||
ImageFile(f, caption, alt, width, content)
|
||||
end
|
||||
|
||||
|
||||
function Base.show(io::IO, m::MIME"text/html", x::ImageFile)
|
||||
content = x.content
|
||||
if content == nothing
|
||||
data = (read(x.f, String))
|
||||
content = gif_to_image(data=data, alt="figure")
|
||||
end
|
||||
caption = sprint(io -> show(io, "text/html", x.caption))
|
||||
|
||||
caption = (Markdown.html ∘ Markdown.parse)(x.caption)
|
||||
print(io, """<div class="d-flex justify-content-center">""")
|
||||
print(io, " <figure>")
|
||||
print(io, content)
|
||||
@ -122,6 +122,24 @@ function Base.show(io::IO, m::MIME"text/html", x::ImageFile)
|
||||
""")
|
||||
end
|
||||
|
||||
import TextWrap
|
||||
function Base.show(io::IO, m::MIME"text/plain", x::ImageFile)
|
||||
|
||||
caption = (TextWrap.wrap ∘ Markdown.plain ∘ Markdown.parse)(x.caption)
|
||||
println(io, """
|
||||
---------------------------------
|
||||
|
|
||||
| see online version for |
|
||||
| image |
|
||||
| |
|
||||
--------------------------------
|
||||
""")
|
||||
println(io, caption)
|
||||
return nothing
|
||||
end
|
||||
|
||||
|
||||
|
||||
# hack to work around issue
|
||||
# import Markdown
|
||||
# import CalculusWithJulia
|
||||
@ -189,4 +207,13 @@ function Base.show(io::IO, ::MIME"text/html", x::HTMLoutput)
|
||||
end
|
||||
print(io, txt)
|
||||
end
|
||||
|
||||
function Base.show(io::IO, m::MIME"text/plain", x::HTMLoutput)
|
||||
|
||||
caption = (TextWrap.wrap ∘ Markdown.plain ∘ Markdown.parse)(x.caption)
|
||||
println(io, "Content available in online version")
|
||||
println(io, caption)
|
||||
return nothing
|
||||
end
|
||||
|
||||
```
|
||||
|
@ -1,4 +1,4 @@
|
||||
version: "0.12"
|
||||
version: "0.13"
|
||||
|
||||
project:
|
||||
type: book
|
||||
@ -13,6 +13,7 @@ book:
|
||||
search: true
|
||||
repo-url: https://github.com/jverzani/CalculusWithJuliaNotes.jl
|
||||
repo-subdir: quarto/
|
||||
downloads: [pdf]
|
||||
repo-actions: [edit, issue]
|
||||
navbar:
|
||||
background: light
|
||||
@ -133,10 +134,19 @@ website:
|
||||
|
||||
format:
|
||||
html:
|
||||
theme: lux #lux # spacelab # lux # sketchy # cosmo # https://quarto.org/docs/output-formats/html-themes.html
|
||||
theme: lux # spacelab # lux # sketchy # cosmo # https://quarto.org/docs/output-formats/html-themes.html
|
||||
number-depth: 3
|
||||
toc-depth: 3
|
||||
link-external-newwindow: true
|
||||
# pdf:
|
||||
# documentclass: scrbook
|
||||
# classoption: [oneside]
|
||||
# geometry:
|
||||
# - top=30mm
|
||||
# - left=10mm
|
||||
# - right=10mm
|
||||
# - heightrounded
|
||||
# colorlinks: true
|
||||
|
||||
execute:
|
||||
error: true
|
||||
|
@ -234,14 +234,14 @@ The extra step is to specify a "`NonlinearSystem`." It is a system, as in practi
|
||||
|
||||
|
||||
```{julia}
|
||||
ns = NonlinearSystem([eq], [x], [α], name=:ns)
|
||||
ns = NonlinearSystem([eq], [x], [α], name=:ns);
|
||||
```
|
||||
|
||||
The `name` argument is special. The name of the object (`ns`) is assigned through `=`, but the system must also know this same name. However, the name on the left is not known when the name on the right is needed, so it is up to the user to keep them synchronized. The `@named` macro handles this behind the scenes by simply rewriting the syntax of the assignment:
|
||||
|
||||
|
||||
```{julia}
|
||||
@named ns = NonlinearSystem([eq], [x], [α])
|
||||
@named ns = NonlinearSystem([eq], [x], [α]);
|
||||
```
|
||||
|
||||
With the system defined, we can pass this to `NonlinearProblem`, as was done with a function. The parameter is specified here, and in this case is `α => 1.0`. The initial guess is `[1.0]`:
|
||||
@ -365,7 +365,7 @@ The above should be self explanatory. To put into a form to pass to `solve` we d
|
||||
|
||||
|
||||
```{julia}
|
||||
@named sys = OptimizationSystem(Area, [x], [P])
|
||||
@named sys = OptimizationSystem(Area, [x], [P]);
|
||||
```
|
||||
|
||||
(This step is different, as before an `OptimizationFunction` was defined; we use `@named`, as above, to ensure the system has the same name as the identifier, `sys`.)
|
||||
@ -409,7 +409,7 @@ could be similarly approached:
|
||||
@variables x
|
||||
y = Area/x # from A = xy
|
||||
P = 2x + 2y
|
||||
@named sys = OptimizationSystem(P, [x], [Area])
|
||||
@named sys = OptimizationSystem(P, [x], [Area]);
|
||||
|
||||
u0 = [x => 4.0]
|
||||
p = [Area => 25.0]
|
||||
@ -570,14 +570,12 @@ As well, suppose we wanted to parameterize our function and then differentiate.
|
||||
Consider $d/dp \int_0^\pi \sin(px) dx$. We can do this integral directly to get
|
||||
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
\frac{d}{dp} \int_0^\pi \sin(px)dx
|
||||
&= \frac{d}{dp}\left( \frac{-1}{p} \cos(px)\Big\rvert_0^\pi\right)\\
|
||||
&= \frac{d}{dp}\left( -\frac{\cos(p\cdot\pi)-1}{p}\right)\\
|
||||
&= \frac{\cos(p\cdot \pi) - 1)}{p^2} + \frac{\pi\cdot\sin(p\cdot\pi)}{p}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Using `Integrals` with `QuadGK` we have:
|
||||
|
||||
|
@ -468,7 +468,7 @@ layout = Config(title = "Annotations",
|
||||
Plot(data, layout)
|
||||
```
|
||||
|
||||
The following example is more complicated use of the elements previously described. It mimics an image from [Wikipedia](https://en.wikipedia.org/wiki/List_of_trigonometric_identities) for trigonometric identities. The use of $\LaTeX$ does not seem to be supported through the `JavaScript` interface; unicode symbols are used instead. The `xanchor` and `yanchor` keys are used to position annotations away from the default. The `textangle` key is used to rotate text, as desired.
|
||||
The following example is more complicated use of the elements previously described. It mimics an image from [Wikipedia](https://en.wikipedia.org/wiki/List_of_trigonometric_identities) for trigonometric identities. The use of `LaTeX` does not seem to be supported through the `JavaScript` interface; unicode symbols are used instead. The `xanchor` and `yanchor` keys are used to position annotations away from the default. The `textangle` key is used to rotate text, as desired.
|
||||
|
||||
|
||||
```{julia, hold=true}
|
||||
|
@ -513,14 +513,14 @@ This holds two rules: the derivative of a constant times a function is the const
|
||||
This example shows a useful template:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
[2x^2 - \frac{x}{3} + 3e^x]' & = 2[\square]' - \frac{[\square]]}{3} + 3[\square]'\\
|
||||
&= 2[x^2]' - \frac{[x]'}{3} + 3[e^x]'\\
|
||||
&= 2(2x) - \frac{1}{3} + 3e^x\\
|
||||
&= 4x - \frac{1}{3} + 3e^x
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
### Product rule
|
||||
|
||||
@ -541,13 +541,13 @@ The output uses the Leibniz notation to represent that the derivative of $u(x) \
|
||||
This example shows a useful template for the product rule:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
[(x^2+1)\cdot e^x]' &= [\square]' \cdot (\square) + (\square) \cdot [\square]'\\
|
||||
&= [x^2 + 1]' \cdot (e^x) + (x^2+1) \cdot [e^x]'\\
|
||||
&= (2x)\cdot e^x + (x^2+1)\cdot e^x
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
### Quotient rule
|
||||
|
||||
@ -565,13 +565,13 @@ limit((f(x+h) - f(x))/h, h => 0)
|
||||
This example shows a useful template for the quotient rule:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
[\frac{x^2+1}{e^x}]' &= \frac{[\square]' \cdot (\square) - (\square) \cdot [\square]'}{(\square)^2}\\
|
||||
&= \frac{[x^2 + 1]' \cdot (e^x) - (x^2+1) \cdot [e^x]'}{(e^x)^2}\\
|
||||
&= \frac{(2x)\cdot e^x - (x^2+1)\cdot e^x}{e^{2x}}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
##### Examples
|
||||
|
||||
@ -731,17 +731,17 @@ Combined, we would end up with:
|
||||
To see that this works in our specific case, we assume the general power rule that $[x^n]' = n x^{n-1}$ to get:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
f(x) &= x^2 & g(x) &= \sqrt{x}\\
|
||||
f'(\square) &= 2(\square) & g'(x) &= \frac{1}{2}x^{-1/2}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
We use $\square$ for the argument of `f'` to emphasize that $g(x)$ is the needed value, not just $x$:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
[(\sqrt{x})^2]' &= [f(g(x)]'\\
|
||||
&= f'(g(x)) \cdot g'(x) \\
|
||||
@ -749,7 +749,7 @@ $$
|
||||
&= \frac{2\sqrt{x}}{2\sqrt{x}}\\
|
||||
&=1
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
This is the same as the derivative of $x$ found by first evaluating the composition. For this problem, the chain rule is not necessary, but typically it is a needed rule to fully differentiate a function.
|
||||
|
||||
@ -760,12 +760,12 @@ This is the same as the derivative of $x$ found by first evaluating the composit
|
||||
Find the derivative of $f(x) = \sqrt{1 - x^2}$. We identify the composition of $\sqrt{x}$ and $(1-x^2)$. We set the functions and their derivatives into a pattern to emphasize the pieces in the chain-rule formula:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
f(x) &=\sqrt{x} = x^{1/2} & g(x) &= 1 - x^2 \\
|
||||
f'(\square) &=(1/2)(\square)^{-1/2} & g'(x) &= -2x
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Then:
|
||||
|
||||
@ -824,15 +824,12 @@ $$
|
||||
|
||||
Where $h' = (g'(a) + \epsilon_g(h))h \rightarrow 0$ as $h \rightarrow 0$ will be used to simplify the following:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
\begin{align*}
|
||||
f(g(a+h)) - f(g(a)) &=
|
||||
f(g(a) + g'(a)h + \epsilon_g(h)h) - f(g(a)) \\
|
||||
&= f(g(a)) + f'(g(a)) (g'(a)h + \epsilon_g(h)h) + \epsilon_f(h')(h') - f(g(a))\\
|
||||
&= f'(g(a)) g'(a)h + f'(g(a))(\epsilon_g(h)h) + \epsilon_f(h')(h').
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
Rearranging:
|
||||
|
||||
@ -852,17 +849,17 @@ where $\epsilon(h)$ combines the above terms which go to zero as $h\rightarrow 0
|
||||
The chain rule name could also be simply the "composition rule," as that is the operation the rule works for. However, in practice, there are usually *multiple* compositions, and the "chain" rule is used to chain together the different pieces. To get a sense, consider a triple composition $u(v(w(x())))$. This will have derivative:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
[u(v(w(x)))]' &= u'(v(w(x))) \cdot [v(w(x))]' \\
|
||||
&= u'(v(w(x))) \cdot v'(w(x)) \cdot w'(x)
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The answer can be viewed as a repeated peeling off of the outer function, a view with immediate application to many compositions. To see that in action with an expression, consider this derivative problem, shown in steps:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
[\sin(e^{\cos(x^2-x)})]'
|
||||
&= \cos(e^{\cos(x^2-x)}) \cdot [e^{\cos(x^2-x)}]'\\
|
||||
@ -870,7 +867,7 @@ $$
|
||||
&= \cos(e^{\cos(x^2-x)}) \cdot e^{\cos(x^2-x)} \cdot (-\sin(x^2-x)) \cdot [x^2-x]'\\
|
||||
&= \cos(e^{\cos(x^2-x)}) \cdot e^{\cos(x^2-x)} \cdot (-\sin(x^2-x)) \cdot (2x-1)\\
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
##### More examples of differentiation
|
||||
|
||||
@ -986,16 +983,13 @@ Find the derivative of $f(x) = x \cdot e^{-x^2}$.
|
||||
|
||||
Using the product rule and then the chain rule, we have:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
\begin{align*}
|
||||
f'(x) &= [x \cdot e^{-x^2}]'\\
|
||||
&= [x]' \cdot e^{-x^2} + x \cdot [e^{-x^2}]'\\
|
||||
&= 1 \cdot e^{-x^2} + x \cdot (e^{-x^2}) \cdot [-x^2]'\\
|
||||
&= e^{-x^2} + x \cdot e^{-x^2} \cdot (-2x)\\
|
||||
&= e^{-x^2} (1 - 2x^2).
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
---
|
||||
|
||||
@ -1006,15 +1000,15 @@ Find the derivative of $f(x) = e^{-ax} \cdot \sin(x)$.
|
||||
Using the product rule and then the chain rule, we have:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
f'(x) &= [e^{-ax} \cdot \sin(x)]'\\
|
||||
&= [e^{-ax}]' \cdot \sin(x) + e^{-ax} \cdot [\sin(x)]'\\
|
||||
&= e^{-ax} \cdot [-ax]' \cdot \sin(x) + e^{-ax} \cdot \cos(x)\\
|
||||
&= e^{-ax} \cdot (-a) \cdot \sin(x) + e^{-ax} \cos(x)\\
|
||||
&= e^{-ax}(\cos(x) - a\sin(x)).
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
---
|
||||
|
||||
@ -1149,15 +1143,12 @@ Find the first $3$ derivatives of $f(x) = ax^3 + bx^2 + cx + d$.
|
||||
|
||||
Differentiating a polynomial is done with the sum rule, here we repeat three times:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
\begin{align*}
|
||||
f(x) &= ax^3 + bx^2 + cx + d\\
|
||||
f'(x) &= 3ax^2 + 2bx + c \\
|
||||
f''(x) &= 3\cdot 2 a x + 2b \\
|
||||
f'''(x) &= 6a
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
We can see, the fourth derivative – and all higher order ones – would be identically $0$. This is part of a general phenomenon: an $n$th degree polynomial has only $n$ non-zero derivatives.
|
||||
|
||||
@ -1168,16 +1159,16 @@ We can see, the fourth derivative – and all higher order ones – would be ide
|
||||
Find the first $5$ derivatives of $\sin(x)$.
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
f(x) &= \sin(x) \\
|
||||
f'(x) &= \cos(x) \\
|
||||
f''(x) &= -\sin(x) \\
|
||||
f'''(x) &= -\cos(x) \\
|
||||
f^{(4)} &= \sin(x) \\
|
||||
f^{(5)} &= \cos(x)
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
We see the derivatives repeat themselves. (We also see alternative notation for higher order derivatives.)
|
||||
|
||||
@ -1603,7 +1594,7 @@ The right graph is of $g(x) = \exp(x)$ at $x=1$, the left graph of $f(x) = \sin(
|
||||
Assuming the approximation gets better for $h$ close to $0$, as it visually does, the derivative at $1$ for $f(g(x))$ should be given by this limit:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\frac{d(f\circ g)}{dx}\mid_{x=1}
|
||||
&= \lim_{h\rightarrow 0} \frac{f(g(1) + g'(1)h)-f(g(1))}{h}\\
|
||||
@ -1611,7 +1602,7 @@ $$
|
||||
&= \lim_{h\rightarrow 0} \frac{f(g(1) + g'(1)h)-f(g(1))}{g'(1)h} \cdot g'(1)\\
|
||||
&= \lim_{h\rightarrow 0} (f\circ g)'(1) \cdot g'(1).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
What limit law, described below assuming all limits exist. allows the last equals sign?
|
||||
|
||||
|
BIN
quarto/derivatives/figures/fcarc-may2016-fig35-350.png
Normal file
BIN
quarto/derivatives/figures/fcarc-may2016-fig35-350.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 137 KiB |
BIN
quarto/derivatives/figures/fcarc-may2016-fig40-300.png
Normal file
BIN
quarto/derivatives/figures/fcarc-may2016-fig40-300.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 115 KiB |
BIN
quarto/derivatives/figures/fcarc-may2016-fig43-250.png
Normal file
BIN
quarto/derivatives/figures/fcarc-may2016-fig43-250.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 106 KiB |
@ -1016,7 +1016,7 @@ This accurately summarizes how the term is used outside of math books. Does it a
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true, echo
|
||||
#| echo: false
|
||||
choices = ["Yes. Same words, same meaning",
|
||||
"""No, but it is close. An inflection point is when the *acceleration* changes from positive to negative, so if "results" are about how a company's rate of change is changing, then it is in the ballpark."""]
|
||||
radioq(choices, 2)
|
||||
|
@ -902,9 +902,12 @@ imgfile = "figures/fcarc-may2016-fig35-350.gif"
|
||||
caption = """
|
||||
Image number 35 from L'Hospitals calculus book (the first). Given a description of the curve, identify the point ``E`` which maximizes the height.
|
||||
"""
|
||||
ImageFile(:derivatives, imgfile, caption)
|
||||
#ImageFile(:derivatives, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
The figure above shows a problem appearing in L'Hospital's first calculus book. Given a function defined implicitly by $x^3 + y^3 = axy$ (with $AP=x$, $AM=y$ and $AB=a$) find the point $E$ that maximizes the height. In the [AMS feature column](http://www.ams.org/samplings/feature-column/fc-2016-05) this problem is illustrated and solved in the historical manner, with the comment that the concept of implicit differentiation wouldn't have occurred to L'Hospital.
|
||||
|
||||
|
||||
|
@ -307,24 +307,24 @@ L'Hospital's rule generalizes to other indeterminate forms, in particular the in
|
||||
The value $c$ in the limit can also be infinite. Consider this case with $c=\infty$:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\lim_{x \rightarrow \infty} \frac{f(x)}{g(x)} &=
|
||||
\lim_{x \rightarrow 0} \frac{f(1/x)}{g(1/x)}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
L'Hospital's limit applies as $x \rightarrow 0$, so we differentiate to get:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\lim_{x \rightarrow 0} \frac{[f(1/x)]'}{[g(1/x)]'}
|
||||
&= \lim_{x \rightarrow 0} \frac{f'(1/x)\cdot(-1/x^2)}{g'(1/x)\cdot(-1/x^2)}\\
|
||||
&= \lim_{x \rightarrow 0} \frac{f'(1/x)}{g'(1/x)}\\
|
||||
&= \lim_{x \rightarrow \infty} \frac{f'(x)}{g'(x)},
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
*assuming* the latter limit exists, L'Hospital's rule assures the equality
|
||||
|
||||
@ -414,12 +414,12 @@ Be just saw that $\lim_{x \rightarrow 0+}\log(x)/(1/x) = 0$. So by the rules for
|
||||
A limit $\lim_{x \rightarrow c} f(x) - g(x)$ of indeterminate form $\infty - \infty$ can be reexpressed to be of the from $0/0$ through the transformation:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
f(x) - g(x) &= f(x)g(x) \cdot (\frac{1}{g(x)} - \frac{1}{f(x)}) \\
|
||||
&= \frac{\frac{1}{g(x)} - \frac{1}{f(x)}}{\frac{1}{f(x)g(x)}}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Applying this to
|
||||
|
||||
|
@ -505,22 +505,22 @@ $$
|
||||
Suppose $f(x)$ and $g(x)$ are represented by their tangent lines about $c$, respectively:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
f(x) &= f(c) + f'(c)(x-c) + \mathcal{O}((x-c)^2), \\
|
||||
g(x) &= g(c) + g'(c)(x-c) + \mathcal{O}((x-c)^2).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Consider the sum, after rearranging we have:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
f(x) + g(x) &= \left(f(c) + f'(c)(x-c) + \mathcal{O}((x-c)^2)\right) + \left(g(c) + g'(c)(x-c) + \mathcal{O}((x-c)^2)\right)\\
|
||||
&= \left(f(c) + g(c)\right) + \left(f'(c)+g'(c)\right)(x-c) + \mathcal{O}((x-c)^2).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The two big "Oh" terms become just one as the sum of a constant times $(x-c)^2$ plus a constant time $(x-c)^2$ is just some other constant times $(x-c)^2$. What we can read off from this is the term multiplying $(x-c)$ is just the derivative of $f(x) + g(x)$ (from the sum rule), so this too is a tangent line approximation.
|
||||
|
||||
@ -528,7 +528,7 @@ The two big "Oh" terms become just one as the sum of a constant times $(x-c)^2$
|
||||
Is it a coincidence that a basic algebraic operation with tangent lines approximations produces a tangent line approximation? Let's try multiplication:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
f(x) \cdot g(x) &= [f(c) + f'(c)(x-c) + \mathcal{O}((x-c)^2)] \cdot [g(c) + g'(c)(x-c) + \mathcal{O}((x-c)^2)]\\
|
||||
&=[(f(c) + f'(c)(x-c)] \cdot [g(c) + g'(c)(x-c)] + (f(c) + f'(c)(x-c) \cdot \mathcal{O}((x-c)^2)) + g(c) + g'(c)(x-c) \cdot \mathcal{O}((x-c)^2)) + [\mathcal{O}((x-c)^2))]^2\\
|
||||
@ -536,7 +536,7 @@ f(x) \cdot g(x) &= [f(c) + f'(c)(x-c) + \mathcal{O}((x-c)^2)] \cdot [g(c) + g'(
|
||||
&= f(c) \cdot g(c) + [f'(c)\cdot g(c) + f(c)\cdot g'(c)] \cdot (x-c) + [f'(c)\cdot g'(c) \cdot (x-c)^2 + \mathcal{O}((x-c)^2)] \\
|
||||
&= f(c) \cdot g(c) + [f'(c)\cdot g(c) + f(c)\cdot g'(c)] \cdot (x-c) + \mathcal{O}((x-c)^2)
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The big "oh" notation just sweeps up many things including any products of it *and* the term $f'(c)\cdot g'(c) \cdot (x-c)^2$. Again, we see from the product rule that this is just a tangent line approximation for $f(x) \cdot g(x)$.
|
||||
|
||||
@ -612,7 +612,7 @@ Automatic differentiation (forward mode) essentially uses this technique. A "dua
|
||||
Dual(0, 1)
|
||||
```
|
||||
|
||||
Then what is $\(x)$? It should reflect both $(\sin(0), \cos(0))$ the latter being the derivative of $\sin$. We can see this is *almost* what is computed behind the scenes through:
|
||||
Then what is $x$? It should reflect both $(\sin(0), \cos(0))$ the latter being the derivative of $\sin$. We can see this is *almost* what is computed behind the scenes through:
|
||||
|
||||
|
||||
```{julia}
|
||||
@ -798,14 +798,14 @@ numericq(abs(answ))
|
||||
The [Birthday problem](https://en.wikipedia.org/wiki/Birthday_problem) computes the probability that in a group of $n$ people, under some assumptions, that no two share a birthday. Without trying to spoil the problem, we focus on the calculus specific part of the problem below:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
p
|
||||
&= \frac{365 \cdot 364 \cdot \cdots (365-n+1)}{365^n} \\
|
||||
&= \frac{365(1 - 0/365) \cdot 365(1 - 1/365) \cdot 365(1-2/365) \cdot \cdots \cdot 365(1-(n-1)/365)}{365^n}\\
|
||||
&= (1 - \frac{0}{365})\cdot(1 -\frac{1}{365})\cdot \cdots \cdot (1-\frac{n-1}{365}).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Taking logarithms, we have $\log(p)$ is
|
||||
|
||||
|
@ -161,9 +161,15 @@ at a relative minimum, the tangent line is parallel to the
|
||||
$x$-axis. This of course is true when the tangent line is well defined
|
||||
by Fermat's observation.
|
||||
"""
|
||||
ImageFile(:derivatives, imgfile, caption)
|
||||
# ImageFile(:derivatives, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Numeric derivatives
|
||||
|
||||
|
||||
@ -247,10 +253,10 @@ Here the maximum occurs at an endpoint. The critical point $c=0.67\dots$ does no
|
||||
:::{.callout-note}
|
||||
## Note
|
||||
|
||||
:::
|
||||
|
||||
**Absolute minimum** We haven't discussed the parallel problem of absolute minima over a closed interval. By considering the function $h(x) = - f(x)$, we see that the any thing true for an absolute maximum should hold in a related manner for an absolute minimum, in particular an absolute minimum on a closed interval will only occur at a critical point or an end point.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
## Rolle's theorem
|
||||
|
||||
|
@ -127,13 +127,13 @@ Though the derivative is related to the slope of the secant line, that is in the
|
||||
Let $\epsilon_{n+1} = x_{n+1}-\alpha$, where $\alpha$ is assumed to be the *simple* zero of $f(x)$ that the secant method converges to. A [calculation](https://math.okstate.edu/people/binegar/4513-F98/4513-l08.pdf) shows that
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\epsilon_{n+1} &\approx \frac{x_n-x_{n-1}}{f(x_n)-f(x_{n-1})} \frac{(1/2)f''(\alpha)(e_n-e_{n-1})}{x_n-x_{n-1}} \epsilon_n \epsilon_{n-1}\\
|
||||
& \approx \frac{f''(\alpha)}{2f'(\alpha)} \epsilon_n \epsilon_{n-1}\\
|
||||
&= C \epsilon_n \epsilon_{n-1}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The constant `C` is similar to that for Newton's method, and reveals potential troubles for the secant method similar to those of Newton's method: a poor initial guess (the initial error is too big), the second derivative is too large, the first derivative too flat near the answer.
|
||||
|
||||
|
@ -684,7 +684,7 @@ $$
|
||||
For this value, we have
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
x_{i+1} - \alpha
|
||||
&= \left(x_i - \frac{f(x_i)}{f'(x_i)}\right) - \alpha\\
|
||||
@ -694,7 +694,7 @@ x_{i+1} - \alpha
|
||||
\right)\\
|
||||
&= \frac{1}{2}\frac{f''(\xi)}{f'(x_i)} \cdot(x_i - \alpha)^2.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
That is
|
||||
|
||||
|
@ -534,9 +534,20 @@ http://www.ams.org/samplings/feature-column/fc-2016-05.)
|
||||
|
||||
|
||||
"""
|
||||
ImageFile(:derivatives, imgfile, caption)
|
||||
#ImageFile(:derivatives, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
The last example is a modern day illustration of a problem of calculus dating back to l'Hospital. His parameterization is a bit different. Let's change his by taking two points $(0, a)$ and $(L,-b)$, with $a,b,L$ positive values. Above the $x$ axis travel happens at rate $r_0$, and below, travel happens at rate $r_1$, again, both positive. What value $x$ in $[0,L]$ will minimize the total travel time?
|
||||
|
||||
|
||||
@ -1227,9 +1238,13 @@ caption = L"""
|
||||
Image number $40$ from l'Hospital's calculus book (the first calculus book). Among all the cones that can be inscribed in a sphere, determine which one has the largest lateral area. (From http://www.ams.org/samplings/feature-column/fc-2016-05)
|
||||
|
||||
"""
|
||||
ImageFile(:derivatives, imgfile, caption)
|
||||
#ImageFile(:derivatives, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||
).](./figures/fcarc-may2016-fig40-300.png)
|
||||
|
||||
|
||||
The figure above poses a problem about cones in spheres, which can be reduced to a two-dimensional problem. Take a sphere of radius $r=1$, and imagine a secant line of length $l$ connecting $(-r, 0)$ to another point $(x,y)$ with $y>0$. Rotating that line around the $x$ axis produces a cone and its lateral surface is given by $SA=\pi \cdot y \cdot l$. Write $SA$ as a function of $x$ and solve.
|
||||
|
||||
|
||||
@ -1345,12 +1360,12 @@ solve(x/b ~ (x+a)/(b + b*p), x)
|
||||
With $x = a/p$ we get by Pythagorean's theorem that
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
c^2 &= (a + a/p)^2 + (b + bp)^2 \\
|
||||
&= a^2(1 + \frac{1}{p})^2 + b^2(1+p)^2.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The ladder problem minimizes $c$ or equivalently $c^2$.
|
||||
|
||||
|
@ -247,549 +247,7 @@ Often, this problem is presented with $db/dt$ having a constant rate. In this ca
|
||||
caption = "A man and woman walk towards the light."
|
||||
|
||||
imgfile = "figures/long-shadow-noir.png"
|
||||
ImageFile(:derivatives, imgfile, caption)
|
||||
```
|
||||
|
||||
Shadows are a staple of film noir. In the photo, suppose a man and a woman walk towards a street light. As they approach the light the length of their shadow changes.
|
||||
|
||||
|
||||
Suppose, we focus on the $5$ foot tall woman. Her shadow comes from a streetlight $15$ feet high. She is walking at $3$ feet per second towards the light. What is the rate of change of her shadow?
|
||||
|
||||
|
||||
The setup for this problem involves drawing a right triangle with height $12$ and base given by the distance $x$ from the light the woman is *plus* the length $l$ of the shadow. There is a similar triangle formed by the woman's height with length $l$. Equating the ratios of the sided gives:
|
||||
|
||||
|
||||
$$
|
||||
\frac{5}{l} = \frac{12}{x + l}
|
||||
$$
|
||||
|
||||
As we need to take derivatives, we work with the reciprocal relationship:
|
||||
|
||||
|
||||
$$
|
||||
\frac{l}{5} = \frac{x + l}{12}
|
||||
$$
|
||||
|
||||
Differentiating in $t$ gives:
|
||||
|
||||
|
||||
$$
|
||||
\frac{l'}{5} = \frac{x' + l'}{12}
|
||||
$$
|
||||
|
||||
Or
|
||||
|
||||
|
||||
$$
|
||||
l' \cdot (\frac{1}{5} - \frac{1}{12}) = \frac{x'}{12}
|
||||
$$
|
||||
|
||||
Solving for $l'$ gives an answer in terms of $x'$ the rate the woman is walking. In this description $x$ is getting shorter, so $x'$ would be $-3$ feet per second and the shadow length would be decreasing at a rate proportional to the walking speed.
|
||||
|
||||
|
||||
##### Example
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
p = plot(; axis=nothing, border=:none, legend=false, aspect_ratio=:equal)
|
||||
scatter!(p, [0],[50], color=:yellow, markersize=50)
|
||||
plot!(p, [0, 50], [0,0], linestyle=:dash)
|
||||
plot!(p, [0,50], [50,0], linestyle=:dot)
|
||||
plot!(p, [25,25],[25,0], linewidth=5, color=:black)
|
||||
plot!(p, [25,50], [0,0], linewidth=2, color=:black)
|
||||
```
|
||||
|
||||
The sun is setting at the rate of $1/20$ radian/min, and appears to be dropping perpendicular to the horizon, as depicted in the figure. How fast is the shadow of a $25$ meter wall lengthening at the moment when the shadow is $25$ meters long?
|
||||
|
||||
|
||||
Let the shadow length be labeled $x$, as it appears on the $x$ axis above. Then we have by right-angle trigonometry:
|
||||
|
||||
|
||||
$$
|
||||
\tan(\theta) = \frac{25}{x}
|
||||
$$
|
||||
|
||||
of $x\tan(\theta) = 25$.
|
||||
|
||||
|
||||
As $t$ evolves, we know $d\theta/dt$ but what is $dx/dt$? Using implicit differentiation yields:
|
||||
|
||||
|
||||
$$
|
||||
\frac{dx}{dt} \cdot \tan(\theta) + x \cdot (\sec^2(\theta)\cdot \frac{d\theta}{dt}) = 0
|
||||
$$
|
||||
|
||||
Substituting known values and identifying $\theta=\pi/4$ when the shadow length, $x$, is $25$ gives:
|
||||
|
||||
|
||||
$$
|
||||
\frac{dx}{dt} \cdot \tan(\pi/4) + 25 \cdot((4/2) \cdot \frac{-1}{20} = 0
|
||||
$$
|
||||
|
||||
This can be solved for the unknown: $dx/dt = 50/20$.
|
||||
|
||||
|
||||
##### Example
|
||||
|
||||
|
||||
A batter hits a ball toward third base at $75$ ft/sec and runs toward first base at a rate of $24$ ft/sec. At what rate does the distance between the ball and the batter change when $2$ seconds have passed?
|
||||
|
||||
|
||||
We will answer this with `SymPy`. First we create some symbols for the movement of the ball towardsthird base, `b(t)`, the runner toward first base, `r(t)`, and the two velocities. We use symbolic functions for the movements, as we will be differentiating them in time:
|
||||
|
||||
|
||||
```{julia}
|
||||
@syms b() r() v_b v_r
|
||||
d = sqrt(b(t)^2 + r(t)^2)
|
||||
```
|
||||
|
||||
The distance formula applies to give $d$. As the ball and runner are moving in a perpendicular direction, the formula is easy to apply.
|
||||
|
||||
|
||||
We can differentiate `d` in terms of `t` and in process we also find the derivatives of `b` and `r`:
|
||||
|
||||
|
||||
```{julia}
|
||||
db, dr = diff(b(t),t), diff(r(t),t) # b(t), r(t) -- symbolic functions
|
||||
dd = diff(d,t) # d -- not d(t) -- an expression
|
||||
```
|
||||
|
||||
The slight difference in the commands is due to `b` and `r` being symbolic functions, whereas `d` is a symbolic expression. Now we begin substituting. First, from the problem `db` is just the velocity in the ball's direction, or `v_b`. Similarly for `v_r`:
|
||||
|
||||
|
||||
```{julia}
|
||||
ddt = subs(dd, db => v_b, dr => v_r)
|
||||
```
|
||||
|
||||
Now, we can substitute in for `b(t)`, as it is `v_b*t`, etc.:
|
||||
|
||||
|
||||
```{julia}
|
||||
ddt₁ = subs(ddt, b(t) => v_b * t, r(t) => v_r * t)
|
||||
```
|
||||
|
||||
This finds the rate of change of time for any `t` with symbolic values of the velocities. (And shows how the answer doesn't actually depend on $t$.) The problem's answer comes from a last substitution:
|
||||
|
||||
|
||||
```{julia}
|
||||
ddt₁(t => 2, v_b => 75, v_r => 24)
|
||||
```
|
||||
|
||||
Were this done by "hand," it would be better to work with distance squared to avoid the expansion of complexity from the square root. That is, using implicit differentiation:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
d^2 &= b^2 + r^2\\
|
||||
2d\cdot d' &= 2b\cdot b' + 2r\cdot r'\\
|
||||
d' &= (b\cdot b' + r \cdot r')/d\\
|
||||
d' &= (tb'\cdot b' + tr' \cdot r')/d\\
|
||||
d' &= \left((b')^2 + (r')^2\right) \cdot \frac{t}{d}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
##### Example
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
#| cache: true
|
||||
###{{{baseball_been_berry_good}}}
|
||||
## Secant line approaches tangent line...
|
||||
function baseball_been_berry_good_graph(n)
|
||||
|
||||
v0 = 15
|
||||
x = (t) -> 50t
|
||||
y = (t) -> v0*t - 5 * t^2
|
||||
|
||||
|
||||
ns = range(.25, stop=3, length=8)
|
||||
|
||||
t = ns[n]
|
||||
ts = range(0, stop=t, length=50)
|
||||
xs = map(x, ts)
|
||||
ys = map(y, ts)
|
||||
|
||||
degrees = atand(y(t)/(100-x(t)))
|
||||
degrees = degrees < 0 ? 180 + degrees : degrees
|
||||
|
||||
plt = plot(xs, ys, legend=false, size=fig_size, xlim=(0,150), ylim=(0,15))
|
||||
plot!(plt, [x(t), 100], [y(t), 0.0], color=:orange)
|
||||
annotate!(plt, [(55, 4,"θ = $(round(Int, degrees)) degrees"),
|
||||
(x(t), y(t), "($(round(Int, x(t))), $(round(Int, y(t))))")])
|
||||
|
||||
end
|
||||
caption = L"""
|
||||
|
||||
The flight of the ball as being tracked by a stationary outfielder. This ball will go over the head of the player. What can the player tell from the quantity $d\theta/dt$?
|
||||
|
||||
"""
|
||||
n = 8
|
||||
|
||||
|
||||
anim = @animate for i=1:n
|
||||
baseball_been_berry_good_graph(i)
|
||||
end
|
||||
|
||||
|
||||
imgfile = tempname() * ".gif"
|
||||
gif(anim, imgfile, fps = 1)
|
||||
|
||||
ImageFile(imgfile, caption)
|
||||
```
|
||||
|
||||
A baseball player stands $100$ meters from home base. A batter hits the ball directly at the player so that the distance from home plate is $x(t)$ and the height is $y(t)$.
|
||||
|
||||
|
||||
The player tracks the flight of the ball in terms of the angle $\theta$ made between the ball and the player. This will satisfy:
|
||||
|
||||
|
||||
$$
|
||||
\tan(\theta) = \frac{y(t)}{100 - x(t)}.
|
||||
$$
|
||||
|
||||
What is the rate of change of $\theta$ with respect to $t$ in terms of that of $x$ and $y$?
|
||||
|
||||
|
||||
We have by the chain rule and quotient rule:
|
||||
|
||||
|
||||
$$
|
||||
\sec^2(\theta) \theta'(t) = \frac{y'(t) \cdot (100 - x(t)) - y(t) \cdot (-x'(t))}{(100 - x(t))^2}.
|
||||
$$
|
||||
|
||||
If we have $x(t) = 50t$ and $y(t)=v_{0y} t - 5 t^2$ when is the rate of change of the angle happening most quickly?
|
||||
|
||||
|
||||
The formula for $\theta'(t)$ is
|
||||
|
||||
|
||||
$$
|
||||
\theta'(t) = \cos^2(\theta) \cdot \frac{y'(t) \cdot (100 - x(t)) - y(t) \cdot (-x'(t))}{(100 - x(t))^2}.
|
||||
$$
|
||||
|
||||
This question requires us to differentiate *again* in $t$. Since we have fairly explicit function for $x$ and $y$, we will use `SymPy` to do this.
|
||||
|
||||
|
||||
```{julia}
|
||||
@syms theta()
|
||||
|
||||
v0 = 5
|
||||
x(t) = 50t
|
||||
y(t) = v0*t - 5 * t^2
|
||||
eqn = tan(theta(t)) - y(t) / (100 - x(t))
|
||||
```
|
||||
|
||||
```{julia}
|
||||
thetap = diff(theta(t),t)
|
||||
dtheta = solve(diff(eqn, t), thetap)[1]
|
||||
```
|
||||
|
||||
We could proceed directly by evaluating:
|
||||
|
||||
|
||||
```{julia}
|
||||
d2theta = diff(dtheta, t)(thetap => dtheta)
|
||||
```
|
||||
|
||||
That is not so tractable, however.
|
||||
|
||||
|
||||
It helps to simplify $\cos^2(\theta(t))$ using basic right-triangle trigonometry. Recall, $\theta$ comes from a right triangle with height $y(t)$ and length $(100 - x(t))$. The cosine of this angle will be $100 - x(t)$ divided by the length of the hypotenuse. So we can substitute:
|
||||
|
||||
|
||||
```{julia}
|
||||
dtheta₁ = dtheta(cos(theta(t))^2 => (100 -x(t))^2/(y(t)^2 + (100-x(t))^2))
|
||||
```
|
||||
|
||||
Plotting reveals some interesting things. For $v_{0y} < 10$ we have graphs that look like:
|
||||
|
||||
|
||||
```{julia}
|
||||
plot(dtheta₁, 0, v0/5)
|
||||
```
|
||||
|
||||
The ball will drop in front of the player, and the change in $d\theta/dt$ is monotonic.
|
||||
|
||||
|
||||
But let's rerun the code with $v_{0y} > 10$:
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
v0 = 15
|
||||
x(t) = 50t
|
||||
y(t) = v0*t - 5 * t^2
|
||||
eqn = tan(theta(t)) - y(t) / (100 - x(t))
|
||||
thetap = diff(theta(t),t)
|
||||
dtheta = solve(diff(eqn, t), thetap)[1]
|
||||
dtheta₁ = subs(dtheta, cos(theta(t))^2, (100 - x(t))^2/(y(t)^2 + (100 - x(t))^2))
|
||||
plot(dtheta₁, 0, v0/5)
|
||||
```
|
||||
|
||||
In the second case we have a different shape. The graph is not monotonic, and before the peak there is an inflection point. Without thinking too hard, we can see that the greatest change in the angle is when it is just above the head ($t=2$ has $x(t)=100$).
|
||||
|
||||
|
||||
That these two graphs differ so, means that the player may be able to read if the ball is going to go over his or her head by paying attention to the how the ball is being tracked.
|
||||
|
||||
|
||||
##### Example
|
||||
|
||||
|
||||
Hipster pour-over coffee is made with a conical coffee filter. The cone is actually a [frustum](http://en.wikipedia.org/wiki/Frustum) of a cone with small diameter, say $r_0$, chopped off. We will parameterize our cone by a value $h \geq 0$ on the $y$ axis and an angle $\theta$ formed by a side and the $y$ axis. Then the coffee filter is the part of the cone between some $h_0$ (related $r_0=h_0 \tan(\theta)$) and $h$.
|
||||
|
||||
|
||||
The volume of a cone of height $h$ is $V(h) = \pi/3 h \cdot R^2$. From the geometry, $R = h\tan(\theta)$. The volume of the filter then is:
|
||||
|
||||
|
||||
$$
|
||||
V = V(h) - V(h_0).
|
||||
$$
|
||||
|
||||
What is $dV/dh$ in terms of $dR/dh$?
|
||||
|
||||
|
||||
Differentiating implicitly gives:
|
||||
|
||||
|
||||
$$
|
||||
\frac{dV}{dh} = \frac{\pi}{3} ( R(h)^2 + h \cdot 2 R \frac{dR}{dh}).
|
||||
$$
|
||||
|
||||
We see that it depends on $R$ and the change in $R$ with respect to $h$. However, we visualize $h$ - the height - so it is better to re-express. Clearly, $dR/dh = \tan\theta$ and using $R(h) = h \tan(\theta)$ we get:
|
||||
|
||||
|
||||
$$
|
||||
\frac{dV}{dh} = \pi h^2 \tan^2(\theta).
|
||||
$$
|
||||
|
||||
The rate of change goes down as $h$ gets smaller ($h \geq h_0$) and gets bigger for bigger $\theta$.
|
||||
|
||||
|
||||
How do the quantities vary in time?
|
||||
|
||||
|
||||
For an incompressible fluid, by balancing the volume leaving with how it leaves we will have $dh/dt$ is the ratio of the cross-sectional area at bottom over that at the height of the fluid $(\pi \cdot (h_0\tan(\theta))^2) / (\pi \cdot ((h\tan\theta))^2)$ times the outward velocity of the fluid.
|
||||
|
||||
|
||||
That is $dh/dt = (h_0/h)^2 \cdot v$. Which makes sense - larger openings ($h_0$) mean more fluid lost per unit time so the height change follows, higher levels ($h$) means the change in height is slower, as the cross-sections have more volume.
|
||||
|
||||
|
||||
By [Torricelli's](http://en.wikipedia.org/wiki/Torricelli's_law) law, the out velocity follows the law $v = \sqrt{2g(h-h_0)}$. This gives:
|
||||
|
||||
|
||||
$$
|
||||
\frac{dh}{dt} = \frac{h_0^2}{h^2} \cdot v = \frac{h_0^2}{h^2} \sqrt{2g(h-h_0)}.
|
||||
$$
|
||||
|
||||
If $h >> h_0$, then $\sqrt{h-h_0} = \sqrt{h}\sqrt(1 - h_0/h) \approx \sqrt{h}(1 - (1/2)(h_0/h)) \approx \sqrt{h}$. So the rate of change of height in time is like $1/h^{3/2}$.
|
||||
|
||||
|
||||
Now, by the chain rule, we have then the rate of change of volume with respect to time, $dV/dt$, is:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
\frac{dV}{dt} &=
|
||||
\frac{dV}{dh} \cdot \frac{dh}{dt}\\
|
||||
&= \pi h^2 \tan^2(\theta) \cdot \frac{h_0^2}{h^2} \sqrt{2g(h-h_0)} \\
|
||||
&= \pi \sqrt{2g} \cdot (r_0)^2 \cdot \sqrt{h-h_0} \\
|
||||
&\approx \pi \sqrt{2g} \cdot r_0^2 \cdot \sqrt{h}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
This rate depends on the square of the size of the opening ($r_0^2$) and the square root of the height ($h$), but not the angle of the cone.
|
||||
|
||||
|
||||
## Questions
|
||||
|
||||
|
||||
###### Question
|
||||
|
||||
|
||||
Supply and demand. Suppose demand for product $XYZ$ is $d(x)$ and supply is $s(x)$. The excess demand is $d(x) - s(x)$. Suppose this is positive. How does this influence price? Guess the "law" of economics that applies:
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = [
|
||||
"The rate of change of price will be ``0``",
|
||||
"The rate of change of price will increase",
|
||||
"The rate of change of price will be positive and will depend on the rate of change of excess demand."
|
||||
]
|
||||
answ = 3
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
(Theoretically, when demand exceeds supply, prices increase.)
|
||||
|
||||
|
||||
###### Question
|
||||
|
||||
|
||||
Which makes more sense from an economic viewpoint?
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = [
|
||||
"If the rate of change of unemployment is negative, the rate of change of wages will be negative.",
|
||||
"If the rate of change of unemployment is negative, the rate of change of wages will be positive."
|
||||
]
|
||||
answ = 2
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
(Colloquially, "the rate of change of unemployment is negative" means the unemployment rate is going down, so there are fewer workers available to fill new jobs.)
|
||||
|
||||
|
||||
###### Question
|
||||
|
||||
|
||||
In chemistry there is a fundamental relationship between pressure ($P$), temperature ($T)$ and volume ($V$) given by $PV=cT$ where $c$ is a constant. Which of the following would be true with respect to time?
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = [
|
||||
L"The rate of change of pressure is always increasing by $c$",
|
||||
"If volume is constant, the rate of change of pressure is proportional to the temperature",
|
||||
"If volume is constant, the rate of change of pressure is proportional to the rate of change of temperature",
|
||||
"If pressure is held constant, the rate of change of pressure is proportional to the rate of change of temperature"]
|
||||
answ = 3
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
###### Question
|
||||
|
||||
|
||||
A pebble is thrown into a lake causing ripples to form expanding circles. Suppose one of the circles expands at a rate of $1$ foot per second and the radius of the circle is $10$ feet, what is the rate of change of the area enclosed by the circle?
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
# a = pi*r^2
|
||||
# da/dt = pi * 2r * drdt
|
||||
r = 10; drdt = 1
|
||||
val = pi * 2r * drdt
|
||||
numericq(val, units=L"feet$^2$/second")
|
||||
```
|
||||
|
||||
###### Question
|
||||
|
||||
|
||||
A pizza maker tosses some dough in the air. The dough is formed in a circle with radius $10$. As it rotates, its area increases at a rate of $1$ inch$^2$ per second. What is the rate of change of the radius?
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
# a = pi*r^2
|
||||
# da/dt = pi * 2r * drdt
|
||||
r = 10; dadt = 1
|
||||
val = dadt /( pi * 2r)
|
||||
numericq(val, units="inches/second")
|
||||
```
|
||||
|
||||
###### Question
|
||||
|
||||
|
||||
An FBI agent with a powerful spyglass is located in a boat anchored 400 meters offshore. A gangster under surveillance is driving along the shore. Assume the shoreline is straight and that the gangster is 1 km from the point on the shore nearest to the boat. If the spyglasses must rotate at a rate of $\pi/4$ radians per minute to track the gangster, how fast is the gangster moving? (In kilometers per minute.) [Source.](http://oregonstate.edu/instruct/mth251/cq/Stage9/Practice/ratesProblems.html)
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
## tan(theta) = x/y
|
||||
## sec^2(theta) dtheta/dt = 1/y dx/dt (y is constant)
|
||||
## dxdt = y sec^2(theta) dtheta/dt
|
||||
dthetadt = pi/4
|
||||
y0 = .4; x0 = 1.0
|
||||
theta = atan(x0/y0)
|
||||
val = y0 * sec(theta)^2 * dthetadt
|
||||
numericq(val, units="kilometers/minute")
|
||||
```
|
||||
|
||||
###### Question
|
||||
|
||||
|
||||
A flood lamp is installed on the ground 200 feet from a vertical wall. A six foot tall man is walking towards the wall at the rate of 4 feet per second. How fast is the tip of his shadow moving down the wall when he is 50 feet from the wall? [Source.](http://oregonstate.edu/instruct/mth251/cq/Stage9/Practice/ratesProblems.html) (As the question is written the answer should be positive.)
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
## y/200 = 6/x
|
||||
## dydt = 200 * 6 * -1/x^2 dxdt
|
||||
x0 = 200 - 50
|
||||
dxdt = 4
|
||||
val = 200 * 6 * (1/x0^2) * dxdt
|
||||
numericq(val, units="feet/second")
|
||||
```
|
||||
|
||||
###### Question
|
||||
|
||||
|
||||
Consider the hyperbola $y = 1/x$ and think of it as a slide. A particle slides along the hyperbola so that its x-coordinate is increasing at a rate of $f(x)$ units/sec. If its $y$-coordinate is decreasing at a constant rate of $1$ unit/sec, what is $f(x)$? [Source.](http://oregonstate.edu/instruct/mth251/cq/Stage9/Practice/ratesProblems.html)
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = [
|
||||
"``f(x) = 1/x``",
|
||||
"``f(x) = x^0``",
|
||||
"``f(x) = x``",
|
||||
"``f(x) = x^2``"
|
||||
]
|
||||
answ = 4
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
###### Question
|
||||
|
||||
|
||||
A balloon is in the shape of a sphere, fortunately, as this gives a known formula, $V=4/3 \pi r^3$, for the volume. If the balloon is being filled with a rate of change of volume per unit time is $2$ and the radius is $3$, what is rate of change of radius per unit time?
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
r, dVdt = 3, 2
|
||||
drdt = dVdt / (4 * pi * r^2)
|
||||
numericq(drdt, units="units per unit time")
|
||||
```
|
||||
|
||||
###### Question
|
||||
|
||||
|
||||
Consider the curve $f(x) = x^2 - \log(x)$. For a given $x$, the tangent line intersects the $y$ axis. Where?
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = [
|
||||
"``y = 1 - x^2 - \\log(x)``",
|
||||
"``y = 1 - x^2``",
|
||||
"``y = 1 - \\log(x)``",
|
||||
"``y = x(2x - 1/x)``"
|
||||
]
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
If $dx/dt = -1$, what is $dy/dt$?
|
||||
|
||||
|
||||
```{julia}
|
||||
#ImageFile(:der
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = [
|
||||
|
@ -113,7 +113,7 @@ The term "best" is deserved, as any other straight line will differ at least in
|
||||
(This is a consequence of Cauchy's mean value theorem with $F(c) = f(c) - f'(c)\cdot(c-x)$ and $G(c) = (c-x)^2$
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\frac{F'(\xi)}{G'(\xi)} &=
|
||||
\frac{f'(\xi) - f''(\xi)(\xi-x) - f(\xi)\cdot 1}{2(\xi-x)} \\
|
||||
@ -122,7 +122,7 @@ $$
|
||||
&= \frac{f(c) - f'(c)(c-x) - (f(x) - f'(x)(x-x))}{(c-x)^2 - (x-x)^2} \\
|
||||
&= \frac{f(c) + f'(c)(x-c) - f(x)}{(x-c)^2}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
That is, $f(x) = f(c) + f'(c)(x-c) + f''(\xi)/2\cdot(x-c)^2$, or $f(x)-tl(x)$ is as described.)
|
||||
|
||||
@ -153,14 +153,12 @@ As in the linear case, there is flexibility in the exact points chosen for the i
|
||||
Now, we take a small detour to define some notation. Instead of writing our two points as $c$ and $c+h,$ we use $x_0$ and $x_1$. For any set of points $x_0, x_1, \dots, x_n$, define the **divided differences** of $f$ inductively, as follows:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
\begin{align*}
|
||||
f[x_0] &= f(x_0) \\
|
||||
f[x_0, x_1] &= \frac{f[x_1] - f[x_0]}{x_1 - x_0}\\
|
||||
\cdots &\\
|
||||
f[x_0, x_1, x_2, \dots, x_n] &= \frac{f[x_1, \dots, x_n] - f[x_0, x_1, x_2, \dots, x_{n-1}]}{x_n - x_0}.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
We see the first two values look familiar, and to generate more we just take certain ratios akin to those formed when finding a secant line.
|
||||
|
||||
@ -252,12 +250,12 @@ A proof based on Rolle's theorem appears in the appendix.
|
||||
Why the fuss? The answer comes from a result of Newton on *interpolating* polynomials. Consider a function $f$ and $n+1$ points $x_0$, $x_1, \dots, x_n$. Then an interpolating polynomial is a polynomial of least degree that goes through each point $(x_i, f(x_i))$. The [Newton form](https://en.wikipedia.org/wiki/Newton_polynomial) of such a polynomial can be written as:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
f[x_0] &+ f[x_0,x_1] \cdot (x-x_0) + f[x_0, x_1, x_2] \cdot (x-x_0) \cdot (x-x_1) + \\
|
||||
& \cdots + f[x_0, x_1, \dots, x_n] \cdot (x-x_0)\cdot \cdots \cdot (x-x_{n-1}).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The case $n=0$ gives the value $f[x_0] = f(c)$, which can be interpreted as the slope-$0$ line that goes through the point $(c,f(c))$.
|
||||
|
||||
@ -485,12 +483,12 @@ On inspection, it is seen that this is Newton's method applied to $f'(x)$. This
|
||||
Starting with the Newton form of the interpolating polynomial of smallest degree:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
f[x_0] &+ f[x_0,x_1] \cdot (x - x_0) + f[x_0, x_1, x_2] \cdot (x - x_0)\cdot(x-x_1) + \\
|
||||
& \cdots + f[x_0, x_1, \dots, x_n] \cdot (x-x_0) \cdot \cdots \cdot (x-x_{n-1}).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
and taking $x_i = c + i\cdot h$, for a given $n$, we have in the limit as $h > 0$ goes to zero that coefficients of this polynomial converge to the coefficients of the *Taylor Polynomial of degree n*:
|
||||
|
||||
@ -850,24 +848,24 @@ The actual code is different, as the Taylor polynomial isn't used. The Taylor p
|
||||
For notational purposes, let $g(x)$ be the inverse function for $f(x)$. Assume *both* functions have a Taylor polynomial expansion:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
f(x_0 + \Delta_x) &= f(x_0) + a_1 \Delta_x + a_2 (\Delta_x)^2 + \cdots a_n + (\Delta_x)^n + \dots\\
|
||||
g(y_0 + \Delta_y) &= g(y_0) + b_1 \Delta_y + b_2 (\Delta_y)^2 + \cdots b_n + (\Delta_y)^n + \dots
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Then using $x = g(f(x))$, we have expanding the terms and using $\approx$ to drop the $\dots$:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
x_0 + \Delta_x &= g(f(x_0 + \Delta_x)) \\
|
||||
&\approx g(f(x_0) + \sum_{j=1}^n a_j (\Delta_x)^j) \\
|
||||
&\approx g(f(x_0)) + \sum_{i=1}^n b_i \left(\sum_{j=1}^n a_j (\Delta_x)^j \right)^i \\
|
||||
&\approx x_0 + \sum_{i=1}^{n-1} b_i \left(\sum_{j=1}^n a_j (\Delta_x)^j\right)^i + b_n \left(\sum_{j=1}^n a_j (\Delta_x)^j\right)^n
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
That is:
|
||||
|
||||
@ -1207,7 +1205,7 @@ $$
|
||||
These two polynomials are of degree $n$ or less and have $u(x) = h(x)-g(x)=0$, by uniqueness. So the coefficients of $u(x)$ are $0$. We have that the coefficient of $x^n$ must be $a_n-b_n$ so $a_n=b_n$. Our goal is to express $a_n$ in terms of $a_{n-1}$ and $b_{n-1}$. Focusing on the $x^{n-1}$ term, we have:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
b_n(x-x_n)(x-x_{n-1})\cdot\cdots\cdot(x-x_1)
|
||||
&- a_n\cdot(x-x_0)\cdot\cdots\cdot(x-x_{n-1}) \\
|
||||
@ -1215,7 +1213,7 @@ b_n(x-x_n)(x-x_{n-1})\cdot\cdots\cdot(x-x_1)
|
||||
a_n [(x-x_1)\cdot\cdots\cdot(x-x_{n-1})] [(x- x_n)-(x-x_0)] \\
|
||||
&= -a_n \cdot(x_n - x_0) x^{n-1} + p_{n-2},
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
where $p_{n-2}$ is a polynomial of at most degree $n-2$. (The expansion of $(x-x_1)\cdot\cdots\cdot(x-x_{n-1}))$ leaves $x^{n-1}$ plus some lower degree polynomial.) Similarly, we have $a_{n-1}(x-x_0)\cdot\cdots\cdot(x-x_{n-2}) = a_{n-1}x^{n-1} + q_{n-2}$ and $b_{n-1}(x-x_n)\cdot\cdots\cdot(x-x_2) = b_{n-1}x^{n-1}+r_{n-2}$. Combining, we get that the $x^{n-1}$ term of $u(x)$ is
|
||||
|
||||
|
@ -409,27 +409,24 @@ The answer is the difference:
|
||||
The length of the arc traced by a polar graph can also be expressed using an integral. Again, we partition the interval $[a,b]$ and consider the wedge from $(r(t_{i-1}), t_{i-1})$ to $(r(t_i), t_i)$. The curve this wedge approximates will have its arc length approximated by the line segment connecting the points. Expressing the points in Cartesian coordinates and simplifying gives the distance squared as:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
\begin{align*}
|
||||
d_i^2 &= (r(t_i) \cos(t_i) - r(t_{i-1})\cos(t_{i-1}))^2 + (r(t_i) \sin(t_i) - r(t_{i-1})\sin(t_{i-1}))^2\\
|
||||
&= r(t_i)^2 - 2r(t_i)r(t_{i-1}) \cos(t_i - t_{i-1}) + r(t_{i-1})^2 \\
|
||||
&\approx r(t_i)^2 - 2r(t_i)r(t_{i-1}) (1 - \frac{(t_i - t_{i-1})^2}{2})+ r(t_{i-1})^2 \quad(\text{as} \cos(x) \approx 1 - x^2/2)\\
|
||||
&= (r(t_i) - r(t_{i-1}))^2 + r(t_i)r(t_{i-1}) (t_i - t_{i-1})^2.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
As was done with arc length we multiply $d_i$ by $(t_i - t_{i-1})/(t_i - t_{i-1})$ and move the bottom factor under the square root:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
\begin{align*}
|
||||
d_i
|
||||
&= d_i \frac{t_i - t_{i-1}}{t_i - t_{i-1}} \\
|
||||
&\approx \sqrt{\frac{(r(t_i) - r(t_{i-1}))^2}{(t_i - t_{i-1})^2} +
|
||||
\frac{r(t_i)r(t_{i-1}) (t_i - t_{i-1})^2}{(t_i - t_{i-1})^2}} \cdot (t_i - t_{i-1})\\
|
||||
&= \sqrt{(r'(\xi_i))^2 + r(t_i)r(t_{i-1})} \cdot (t_i - t_{i-1}).\quad(\text{the mean value theorem})
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
Adding the approximations to the $d_i$ looks like a Riemann sum approximation to the integral $\int_a^b \sqrt{(r'(\theta)^2) + r(\theta)^2} d\theta$ (with the extension to the Riemann sum formula needed to derive the arc length for a parameterized curve). That is:
|
||||
|
||||
|
@ -36,13 +36,11 @@ nothing
|
||||
Consider a function $f: R^n \rightarrow R$. It has multiple arguments for its input (an $x_1, x_2, \dots, x_n$) and only one, *scalar*, value for an output. Some simple examples might be:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
\begin{align*}
|
||||
f(x,y) &= x^2 + y^2\\
|
||||
g(x,y) &= x \cdot y\\
|
||||
h(x,y) &= \sin(x) \cdot \sin(y)
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
For two examples from real life consider the elevation Point Query Service (of the [USGS](https://nationalmap.gov/epqs/)) returns the elevation in international feet or meters for a specific latitude/longitude within the United States. The longitude can be associated to an $x$ coordinate, the latitude to a $y$ coordinate, and the elevation a $z$ coordinate, and as long as the region is small enough, the $x$-$y$ coordinates can be thought to lie on a plane. (A flat earth assumption.)
|
||||
|
||||
@ -468,9 +466,12 @@ imgfile = "figures/daily-map.jpg"
|
||||
caption = """
|
||||
Image from [weather.gov](https://www.weather.gov/unr/1943-01-22) of a contour map showing atmospheric pressures from January 22, 1943 in Rapid City, South Dakota.
|
||||
"""
|
||||
ImageFile(:differentiable_vector_calculus, imgfile, caption)
|
||||
# ImageFile(:differentiable_vector_calculus, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||
 of a contour map showing atmospheric pressures from January 22, 1943 in Rapid City, South Dakota.](./figures/daily-map.jpg)
|
||||
|
||||
This day is highlighted as "The most notable temperature fluctuations occurred on January 22, 1943 when temperatures rose and fell almost 50 degrees in a few minutes. This phenomenon was caused when a frontal boundary separating extremely cold Arctic air from warmer Pacific air rolled like an ocean tide along the northern and eastern slopes of the Black Hills."
|
||||
|
||||
|
||||
@ -490,9 +491,18 @@ imgfile = "figures/australia.png"
|
||||
caption = """
|
||||
Image from [IRI](https://iridl.ldeo.columbia.edu/maproom/Global/Ocean_Temp/Monthly_Temp.html) shows mean sea surface temperature near Australia in January 1982. IRI has zoomable graphs for this measurement from 1981 to the present. The contour lines are in 2 degree Celsius increments.
|
||||
"""
|
||||
ImageFile(:differentiable_vector_calculus, imgfile, caption)
|
||||
#ImageFile(:differentiable_vector_calculus, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
shows mean sea surface temperature near Australia in January 1982. IRI
|
||||
has zoomable graphs for this measurement from 1981 to the present. The
|
||||
contour lines are in 2 degree Celsius
|
||||
increments.](./figures/australia.png)
|
||||
|
||||
|
||||
##### Example
|
||||
|
||||
|
||||
@ -621,26 +631,23 @@ Before answering this, we discuss *directional* derivatives along the simplified
|
||||
If we compose $f \circ \vec\gamma_x$, we can visualize this as a curve on the surface from $f$ that moves in the $x$-$y$ plane along the line $y=c$. The derivative of this curve will satisfy:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
\begin{align*}
|
||||
(f \circ \vec\gamma_x)'(x) &=
|
||||
\lim_{t \rightarrow x} \frac{(f\circ\vec\gamma_x)(t) - (f\circ\vec\gamma_x)(x)}{t-x}\\
|
||||
&= \lim_{t\rightarrow x} \frac{f(t, c) - f(x,c)}{t-x}\\
|
||||
&= \lim_{h \rightarrow 0} \frac{f(x+h, c) - f(x, c)}{h}.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
The latter expresses this to be the derivative of the function that holds the $y$ value fixed, but lets the $x$ value vary. It is the rate of change in the $x$ direction. There is special notation for this:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
\begin{align*}
|
||||
\frac{\partial f(x,y)}{\partial x} &=
|
||||
\lim_{h \rightarrow 0} \frac{f(x+h, y) - f(x, y)}{h},\quad\text{and analogously}\\
|
||||
\frac{\partial f(x,y)}{\partial y} &=
|
||||
\lim_{h \rightarrow 0} \frac{f(x, y+h) - f(x, y)}{h}.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
These are called the *partial* derivatives of $f$. The symbol $\partial$, read as "partial", is reminiscent of "$d$", but indicates the derivative is only in a given direction. Other notations exist for this:
|
||||
|
||||
@ -678,12 +685,10 @@ Let $f(x,y) = x^2 - 2xy$, then to compute the partials, we just treat the other
|
||||
Then
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
\begin{align*}
|
||||
\frac{\partial (x^2 - 2xy)}{\partial x} &= 2x - 2y\\
|
||||
\frac{\partial (x^2 - 2xy)}{\partial y} &= 0 - 2x = -2x.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
Combining, gives $\nabla{f} = \langle 2x -2y, -2x \rangle$.
|
||||
|
||||
@ -691,13 +696,12 @@ Combining, gives $\nabla{f} = \langle 2x -2y, -2x \rangle$.
|
||||
If $g(x,y,z) = \sin(x) + z\cos(y)$, then
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\frac{\partial g }{\partial x} &= \cos(x) + 0 = \cos(x),\\
|
||||
\frac{\partial g }{\partial y} &= 0 + z(-\sin(y)) = -z\sin(y),\\
|
||||
\frac{\partial g }{\partial z} &= 0 + \cos(y) = \cos(y).
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
Combining, gives $\nabla{g} = \langle \cos(x), -z\sin(y), \cos(y) \rangle$.
|
||||
|
||||
@ -1379,16 +1383,14 @@ $$
|
||||
|
||||
The last expression is a suggestion, as it is an abuse of previously used notation: the dot product isn't between vectors of the same type, as the rightmost vector is representing a vector of vectors. The [Jacobian](https://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant) matrix combines these vectors into a rectangular array, though with the vectors written as *row* vectors. If $G: R^m \rightarrow R^n$, then the Jacobian is the $n \times m$ matrix with $(i,j)$ entry given by $\partial G_i, \partial u_j$:
|
||||
|
||||
|
||||
$$
|
||||
J = \left[
|
||||
\begin{align}
|
||||
J =
|
||||
\begin{bmatrix}
|
||||
\frac{\partial G_1}{\partial u_1} & \frac{\partial G_1}{\partial u_2} & \dots \frac{\partial G_1}{\partial u_m}\\
|
||||
\frac{\partial G_2}{\partial u_1} & \frac{\partial G_2}{\partial u_2} & \dots \frac{\partial G_2}{\partial u_m}\\
|
||||
& \vdots & \\
|
||||
\frac{\partial G_n}{\partial u_1} & \frac{\partial G_n}{\partial u_2} & \dots \frac{\partial G_n}{\partial u_m}
|
||||
\end{align}
|
||||
\right].
|
||||
\end{bmatrix}
|
||||
$$
|
||||
|
||||
With this notation, and matrix multiplication we have $(\nabla(f\circ G))^t = \nabla(f)^t J$.
|
||||
@ -1406,20 +1408,17 @@ Let $f(x,y) = x^2 + y^2$ be a scalar function. We have if $G(r, \theta) = \langl
|
||||
Were this computed through the chain rule, we have:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
\begin{align*}
|
||||
\nabla G_1 &= \langle \frac{\partial r\cos(\theta)}{\partial r}, \frac{\partial r\cos(\theta)}{\partial \theta} \rangle=
|
||||
\langle \cos(\theta), -r \sin(\theta) \rangle,\\
|
||||
\nabla G_2 &= \langle \frac{\partial r\sin(\theta)}{\partial r}, \frac{\partial r\sin(\theta)}{\partial \theta} \rangle=
|
||||
\langle \sin(\theta), r \cos(\theta) \rangle.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
We have $\partial f/\partial x = 2x$ and $\partial f/\partial y = 2y$, which at $G$ are $2r\cos(\theta)$ and $2r\sin(\theta)$, so by the chain rule, we should have
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
\begin{align*}
|
||||
\frac{\partial (f\circ G)}{\partial r} &=
|
||||
\frac{\partial{f}}{\partial{x}}\frac{\partial G_1}{\partial r} +
|
||||
\frac{\partial{f}}{\partial{y}}\frac{\partial G_2}{\partial r} =
|
||||
@ -1429,8 +1428,8 @@ $$
|
||||
\frac{\partial f}{\partial x}\frac{\partial G_1}{\partial \theta} +
|
||||
\frac{\partial f}{\partial y}\frac{\partial G_2}{\partial \theta} =
|
||||
2r\cos(\theta)(-r\sin(\theta)) + 2r\sin(\theta)(r\cos(\theta)) = 0.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
## Higher order partial derivatives
|
||||
|
||||
@ -1487,14 +1486,11 @@ is uniquely defined. That is, which order the partial derivatives are taken is u
|
||||
|
||||
The [Hessian](https://en.wikipedia.org/wiki/Hessian_matrix) matrix is the matrix of mixed partials defined (for $n=2$) by:
|
||||
|
||||
|
||||
$$
|
||||
H = \left[
|
||||
\begin{align}
|
||||
H = \begin{bmatrix}
|
||||
\frac{\partial^2 f}{\partial x \partial x} & \frac{\partial^2 f}{\partial x \partial y}\\
|
||||
\frac{\partial^2 f}{\partial y \partial x} & \frac{\partial^2 f}{\partial y \partial y}
|
||||
\end{align}
|
||||
\right].
|
||||
\end{bmatrix}.
|
||||
$$
|
||||
|
||||
For symbolic expressions, the Hessian may be computed directly in `SymPy` with its `hessian` function:
|
||||
@ -1673,9 +1669,12 @@ The figure (taken from [openstreetmap.org](https://www.openstreetmap.org/way/537
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
ImageFile(:differentiable_vector_calculus, "figures/stelvio-pass.png", "Stelvio Pass")
|
||||
#ImageFile(:differentiable_vector_calculus, "figures/stelvio-pass.png", "Stelvio Pass")
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
The road through the pass (on the right) makes a series of switch backs.
|
||||
|
||||
|
||||
@ -1903,9 +1902,12 @@ The figure shows climbers on their way to summit Mt. Everest:
|
||||
#| echo: false
|
||||
imgfile = "figures/everest.png"
|
||||
caption = "Climbers en route to the summit of Mt. Everest"
|
||||
ImageFile(:differentiable_vector_calculus, imgfile, caption)
|
||||
#ImageFile(:differentiable_vector_calculus, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
If the surface of the mountain is given by a function $z=f(x,y)$ then the climbers move along a single path parameterized, say, by $\vec{\gamma}(t) = \langle x(t), y(t)\rangle$, as set up by the Sherpas.
|
||||
|
||||
|
||||
|
@ -340,12 +340,12 @@ The level curve $f(x,y)=0$ and the level curve $g(x,y)=0$ may intersect. Solving
|
||||
To elaborate, consider two linear equations written in a general form:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
ax + by &= u\\
|
||||
cx + dy &= v
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
A method to solve this by hand would be to solve for $y$ from one equation, replace this expression into the second equation and then solve for $x$. From there, $y$ can be found. A more advanced method expresses the problem in a matrix formulation of the form $Mx=b$ and solves that equation. This form of solving is implemented in `Julia`, through the "backslash" operator. Here is the general solution:
|
||||
|
||||
@ -421,22 +421,22 @@ We look to find the intersection point near $(1,1)$ using Newton's method
|
||||
We have by linearization:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
f(x,y) &\approx f(x_n, y_n) + \frac{\partial f}{\partial x}\Delta x + \frac{\partial f}{\partial y}\Delta y \\
|
||||
g(x,y) &\approx g(x_n, y_n) + \frac{\partial g}{\partial x}\Delta x + \frac{\partial g}{\partial y}\Delta y,
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
where $\Delta x = x- x_n$ and $\Delta y = y-y_n$. Setting $f(x,y)=0$ and $g(x,y)=0$, leaves these two linear equations in $\Delta x$ and $\Delta y$:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\frac{\partial f}{\partial x} \Delta x + \frac{\partial f}{\partial y} \Delta y &= -f(x_n, y_n)\\
|
||||
\frac{\partial g}{\partial x} \Delta x + \frac{\partial g}{\partial y} \Delta y &= -g(x_n, y_n).
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
One step of Newton's method defines $(x_{n+1}, y_{n+1})$ to be the values $(x,y)$ that make the linearized functions about $(x_n, y_n)$ both equal to $\vec{0}$.
|
||||
|
||||
@ -855,12 +855,11 @@ The gradient is easily found: $\nabla{f} = \langle 2x - 1, 6y \rangle$, and is $
|
||||
|
||||
|
||||
$$
|
||||
H = \left[
|
||||
\begin{array}{}
|
||||
H =
|
||||
\begin{bmatrix}
|
||||
2 & 0\\
|
||||
0 & 6
|
||||
\end{array}
|
||||
\right].
|
||||
\end{bmatrix}.
|
||||
$$
|
||||
|
||||
At $\vec{a}$ this has positive determinant and $f_{xx} > 0$, so $\vec{a}$ corresponds to a *local* minimum with values $f(\vec{a}) = (1/2)^2 + 3(0) - 1/2 = -1/4$. The absolute maximum and minimum may occur here (well, not the maximum) or on the boundary, so that must be considered. In this case we can easily parameterize the boundary and turn this into the univariate case:
|
||||
@ -1069,12 +1068,10 @@ $$
|
||||
Another might be the vertical squared distance to the line:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
d2(\alpha, \beta) &= (y_1 - l(x_1))^2 + (y_2 - l(x_2))^2 + (y_3 - l(x_3))^2 \\
|
||||
&= (y1 - (\alpha + \beta x_1))^2 + (y3 - (\alpha + \beta x_3))^2 + (y3 - (\alpha + \beta x_3))^2
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Another might be the *shortest* distance to the line:
|
||||
|
||||
@ -1411,12 +1408,12 @@ We can still identify the tangent and normal directions. What is different about
|
||||
|
||||
> *The method of Lagrange multipliers*: To optimize $f(x,y)$ subject to a constraint $g(x,y) = k$ we solve for all *simultaneous* solutions to
|
||||
>
|
||||
> $$
|
||||
> \begin{align}
|
||||
>
|
||||
> \begin{align*}
|
||||
> \nabla{f}(x,y) &= \lambda \nabla{g}(x,y), \text{and}\\
|
||||
> g(x,y) &= k.
|
||||
> \end{align}
|
||||
> $$
|
||||
> \end{align*}
|
||||
>
|
||||
>
|
||||
> These *possible* points are evaluated to see if they are maxima or minima.
|
||||
|
||||
@ -1473,13 +1470,13 @@ $$
|
||||
The we have
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\frac{\partial L}{\partial{x}} &= \frac{\partial{f}}{\partial{x}} - \lambda \frac{\partial{g}}{\partial{x}}\\
|
||||
\frac{\partial L}{\partial{y}} &= \frac{\partial{f}}{\partial{y}} - \lambda \frac{\partial{g}}{\partial{y}}\\
|
||||
\frac{\partial L}{\partial{\lambda}} &= 0 + (g(x,y) - k).
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
But if the Lagrange condition holds, each term is $0$, so Lagrange's method can be seen as solving for point $\nabla{L} = \vec{0}$. The optimization problem in two variables with a constraint becomes a problem of finding and classifying zeros of a function with *three* variables.
|
||||
|
||||
@ -1557,14 +1554,14 @@ The starting point is a *perturbation*: $\hat{y}(x) = y(x) + \epsilon_1 \eta_1(x
|
||||
With this notation, and fixing $y$ we can re-express the equations in terms ot $\epsilon_1$ and $\epsilon_2$:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
F(\epsilon_1, \epsilon_2) &= \int f(x, \hat{y}, \hat{y}') dx =
|
||||
\int f(x, y + \epsilon_1 \eta_1 + \epsilon_2 \eta_2, y' + \epsilon_1 \eta_1' + \epsilon_2 \eta_2') dx,\\
|
||||
G(\epsilon_1, \epsilon_2) &= \int g(x, \hat{y}, \hat{y}') dx =
|
||||
\int g(x, y + \epsilon_1 \eta_1 + \epsilon_2 \eta_2, y' + \epsilon_1 \eta_1' + \epsilon_2 \eta_2') dx.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
Then our problem is restated as:
|
||||
|
||||
@ -1591,18 +1588,19 @@ $$
|
||||
Computing just the first one, we have using the chain rule and assuming interchanging the derivative and integral is possible:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\frac{\partial{F}}{\partial{\epsilon_1}}
|
||||
&= \int \frac{\partial}{\partial{\epsilon_1}}(
|
||||
f(x, y + \epsilon_1 \eta_1 + \epsilon_2 \eta_2, y' + \epsilon_1 \eta_1' + \epsilon_2 \eta_2')) dx\\
|
||||
&= \int \left(\frac{\partial{f}}{\partial{y}} \eta_1 + \frac{\partial{f}}{\partial{y'}} \eta_1'\right) dx\quad\quad(\text{from }\nabla{f} \cdot \langle 0, \eta_1, \eta_1'\rangle)\\
|
||||
&=\int \eta_1 \left(\frac{\partial{f}}{\partial{y}} - \frac{d}{dx}\frac{\partial{f}}{\partial{y'}}\right) dx.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
The last line by integration by parts: $\int u'(x) v(x) dx = (u \cdot v)(x)\mid_{x_0}^{x_1} - \int u(x) \frac{d}{dx} v(x) dx = - \int u(x) \frac{d}{dx} v(x) dx $. The last lines, as $\eta_1 = 0$ at $x_0$ and $x_1$ by assumption. We get:
|
||||
|
||||
The last line by integration by parts:
|
||||
$\int u'(x) v(x) dx = (u \cdot v)(x)\mid_{x_0}^{x_1} - \int u(x) \frac{d}{dx} v(x) dx = - \int u(x) \frac{d}{dx} v(x) dx$.
|
||||
The last lines, as $\eta_1 = 0$ at $x_0$ and $x_1$ by assumption. We get:
|
||||
|
||||
$$
|
||||
0 = \int \eta_1\left(\frac{\partial{f}}{\partial{y}} - \frac{d}{dx}\frac{\partial{f}}{\partial{y'}}\right).
|
||||
@ -1664,12 +1662,12 @@ ex2 = Eq(ex1.lhs()^2 - 1, simplify(ex1.rhs()^2) - 1)
|
||||
Now $y'$ can be integrated using the substitution $y + C = \lambda \cos\theta$ to give: $-\lambda\int\cos\theta d\theta = x + D$, $D$ some constant. That is:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
x + D &= - \lambda \sin\theta\\
|
||||
y + C &= \lambda\cos\theta.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
Squaring gives the equation of a circle: $(x +D)^2 + (y+C)^2 = \lambda^2$.
|
||||
|
||||
@ -1680,12 +1678,12 @@ We center and *rescale* the problem so that $x_0 = -1, x_1 = 1$. Then $L > 2$ as
|
||||
We have $y=0$ at $x=1$ and $-1$ giving:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
(-1 + D)^2 + (0 + C)^2 &= \lambda^2\\
|
||||
(+1 + D)^2 + (0 + C)^2 &= \lambda^2.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
Squaring out and solving gives $D=0$, $1 + C^2 = \lambda^2$. That is, an arc of circle with radius $1+C^2$ and centered at $(0, -C)$.
|
||||
|
||||
@ -1776,15 +1774,15 @@ where $R_k(x) = f^{k+1}(\xi)/(k+1)!(x-a)^{k+1}$ for some $\xi$ between $a$ and $
|
||||
This theorem can be generalized to scalar functions, but the notation can be cumbersome. Following [Folland](https://sites.math.washington.edu/~folland/Math425/taylor2.pdf) we use *multi-index* notation. Suppose $f:R^n \rightarrow R$, and let $\alpha=(\alpha_1, \alpha_2, \dots, \alpha_n)$. Then define the following notation:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
|\alpha| &= \alpha_1 + \cdots + \alpha_n, \\
|
||||
\alpha! &= \alpha_1!\alpha_2!\cdot\cdots\cdot\alpha_n!, \\
|
||||
\vec{x}^\alpha &= x_1^{\alpha_1}x_2^{\alpha_2}\cdots x_n^{\alpha^n}, \\
|
||||
\partial^\alpha f &= \partial_1^{\alpha_1}\partial_2^{\alpha_2}\cdots \partial_n^{\alpha_n} f \\
|
||||
& = \frac{\partial^{|\alpha|}f}{\partial x_1^{\alpha_1} \partial x_2^{\alpha_2} \cdots \partial x_n^{\alpha_n}}.
|
||||
\endalign*}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
This notation makes many formulas from one dimension carry over to higher dimensions. For example, the binomial theorem says:
|
||||
|
||||
@ -1819,13 +1817,11 @@ where $R_{\vec{a},k} = \sum_{|\alpha|=k+1}\partial^\alpha \frac{f(\vec{a} + c\ve
|
||||
The elegant notation masks what can be complicated expressions. Consider the simple case $f:R^2 \rightarrow R$ and $k=2$. Then this says:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
f(x + dx, y+dy) &= f(x, y) + \frac{\partial f}{\partial x} dx + \frac{\partial f}{\partial y} dy \\
|
||||
&+ \frac{\partial^2 f}{\partial x^2} \frac{dx^2}{2} + 2\frac{\partial^2 f}{\partial x\partial y} \frac{dx dy}{2}\\
|
||||
&+ \frac{\partial^2 f}{\partial y^2} \frac{dy^2}{2} + R_{\langle x, y \rangle, k}(\langle dx, dy \rangle).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
Using $\nabla$ and $H$ for the Hessian and $\vec{x} = \langle x, y \rangle$ and $d\vec{x} = \langle dx, dy \rangle$, this can be expressed as:
|
||||
|
||||
@ -2211,12 +2207,10 @@ Is this the Hessian of $f$?
|
||||
|
||||
|
||||
$$
|
||||
\left[
|
||||
\begin{array}{}
|
||||
\begin{bmatrix}
|
||||
2a & 2b\\
|
||||
2b & 2c
|
||||
\end{array}
|
||||
\right]
|
||||
\end{bmatrix}
|
||||
$$
|
||||
|
||||
```{julia}
|
||||
@ -2229,12 +2223,10 @@ Or is this the Hessian of $f$?
|
||||
|
||||
|
||||
$$
|
||||
\left[
|
||||
\begin{array}{}
|
||||
\begin{bmatrix}
|
||||
2ax & by\\
|
||||
bx & 2cy
|
||||
\end{array}
|
||||
\right]
|
||||
\end{bmatrix}
|
||||
$$
|
||||
|
||||
```{julia}
|
||||
|
@ -61,9 +61,14 @@ caption = """
|
||||
Illustration of the magnetic field of the earth using field lines to indicate the field. From
|
||||
[Wikipedia](https://en.wikipedia.org/wiki/Magnetic_field).
|
||||
"""
|
||||
ImageFile(:differentiable_vector_calculus, imgfile, caption)
|
||||
# ImageFile(:differentiable_vector_calculus, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||
.
|
||||
](./figures/magnetic-field.png)
|
||||
|
||||
---
|
||||
|
||||
|
||||
@ -192,12 +197,12 @@ surface(unzip(Phi.(thetas, phis'))...)
|
||||
The partial derivatives of each component, $\partial{\Phi}/\partial{\theta}$ and $\partial{\Phi}/\partial{\phi}$, can be computed directly:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\partial{\Phi}/\partial{\theta} &= \langle -\sin(\phi)\sin(\theta), \sin(\phi)\cos(\theta),0 \rangle,\\
|
||||
\partial{\Phi}/\partial{\phi} &= \langle \cos(\phi)\cos(\theta), \cos(\phi)\sin(\theta), -\sin(\phi) \rangle.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Using `SymPy`, we can compute through:
|
||||
|
||||
@ -257,28 +262,27 @@ For a multivariable function $F:R^n \rightarrow R^m$, we may express the functio
|
||||
|
||||
|
||||
$$
|
||||
J = \left[
|
||||
\begin{align*}
|
||||
J =
|
||||
\begin{bmatrix}
|
||||
\frac{\partial f_1}{\partial x_1} &\quad \frac{\partial f_1}{\partial x_2} &\dots&\quad\frac{\partial f_1}{\partial x_n}\\
|
||||
\frac{\partial f_2}{\partial x_1} &\quad \frac{\partial f_2}{\partial x_2} &\dots&\quad\frac{\partial f_2}{\partial x_n}\\
|
||||
&&\vdots&\\
|
||||
\frac{\partial f_m}{\partial x_1} &\quad \frac{\partial f_m}{\partial x_2} &\dots&\quad\frac{\partial f_m}{\partial x_n}
|
||||
\end{align*}
|
||||
\right].
|
||||
\end{bmatrix}.
|
||||
$$
|
||||
|
||||
This may also be viewed as:
|
||||
|
||||
|
||||
$$
|
||||
J = \left[
|
||||
\begin{align*}
|
||||
J =
|
||||
\begin{bmatrix}
|
||||
&\nabla{f_1}'\\
|
||||
&\nabla{f_2}'\\
|
||||
&\quad\vdots\\
|
||||
&\nabla{f_m}'
|
||||
\end{align*}
|
||||
\right] =
|
||||
\end{bmatrix}
|
||||
=
|
||||
\left[
|
||||
\frac{\partial{F}}{\partial{x_1}}\quad
|
||||
\frac{\partial{F}}{\partial{x_2}} \cdots
|
||||
@ -312,24 +316,21 @@ $$
|
||||
|
||||
$$
|
||||
\text{Hessian} =
|
||||
\left[
|
||||
\begin{align*}
|
||||
\begin{bmatrix}
|
||||
\frac{\partial^2 f}{\partial x^2} &\quad \frac{\partial^2 f}{\partial x \partial y}\\
|
||||
\frac{\partial^2 f}{\partial y \partial x} &\quad \frac{\partial^2 f}{\partial y \partial y}
|
||||
\end{align*}
|
||||
\right]
|
||||
\end{bmatrix}
|
||||
$$
|
||||
|
||||
This is equivalent to:
|
||||
|
||||
|
||||
$$
|
||||
\left[
|
||||
\begin{align*}
|
||||
\begin{bmatrix}
|
||||
\frac{\partial \frac{\partial f}{\partial x}}{\partial x} &\quad \frac{\partial \frac{\partial f}{\partial x}}{\partial y}\\
|
||||
\frac{\partial \frac{\partial f}{\partial y}}{\partial x} &\quad \frac{\partial \frac{\partial f}{\partial y}}{\partial y}\\
|
||||
\end{align*}
|
||||
\right].
|
||||
\end{bmatrix}
|
||||
.
|
||||
$$
|
||||
|
||||
As such, the total derivative is a generalization of what we have previously discussed.
|
||||
@ -338,12 +339,11 @@ As such, the total derivative is a generalization of what we have previously dis
|
||||
## The chain rule
|
||||
|
||||
|
||||
If $G:R^k \rightarrow R^n$ and $F:R^n \rightarrow R^m$, then the composition $F\circ G$ takes $R^k \rightarrow R^m$. If all three functions are totally differentiable, then a chain rule will hold (total derivative of $F\circ G$ at point $a$):
|
||||
If $G:R^k \rightarrow R^n$ and $F:R^n \rightarrow R^m$, then the composition $F\circ G$ takes $R^k \rightarrow R^m.$ If all three functions are totally differentiable, then a chain rule will hold (total derivative of $F\circ G$ at point $a$):
|
||||
|
||||
|
||||
$$
|
||||
d(F\circ G)_a = dF_{G(a)} \cdot dG_a
|
||||
|
||||
$$
|
||||
|
||||
If correct, this has the same formulation as the chain rule for the univariate case: derivative of outer at the inner *times* the derivative of the inner.
|
||||
@ -365,7 +365,7 @@ where $\epsilon(h) \rightarrow \vec{0}$ as $h \rightarrow \vec{0}$.
|
||||
We have, using this for *both* $F$ and $G$:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
F(G(a + \vec{h})) - F(G(a)) &=
|
||||
F(G(a) + (dG_a \cdot \vec{h} + \epsilon_G \vec{h})) - F(G(a))\\
|
||||
@ -373,19 +373,19 @@ F(G(a) + (dG_a \cdot \vec{h} + \epsilon_G \vec{h})) - F(G(a))\\
|
||||
&+ \quad\epsilon_F (dG_a \cdot \vec{h} + \epsilon_G \vec{h}) - F(G(a))\\
|
||||
&= dF_{G(a)} \cdot (dG_a \cdot \vec{h}) + dF_{G(a)} \cdot (\epsilon_G \vec{h}) + \epsilon_F (dG_a \cdot \vec{h}) + (\epsilon_F \cdot \epsilon_G\vec{h})
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The last line uses the linearity of $dF$ to isolate $dF_{G(a)} \cdot (dG_a \cdot \vec{h})$. Factoring out $\vec{h}$ and taking norms gives:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\frac{\| F(G(a+\vec{h})) - F(G(a)) - dF_{G(a)}dG_a \cdot \vec{h} \|}{\| \vec{h} \|} &=
|
||||
\frac{\| dF_{G(a)}\cdot(\epsilon_G\vec{h}) + \epsilon_F (dG_a\cdot \vec{h}) + (\epsilon_F\cdot\epsilon_G\vec{h}) \|}{\| \vec{h} \|} \\
|
||||
&\leq \| dF_{G(a)}\cdot\epsilon_G + \epsilon_F (dG_a) + \epsilon_F\cdot\epsilon_G \|\frac{\|\vec{h}\|}{\| \vec{h} \|}\\
|
||||
&\rightarrow 0.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
@ -666,17 +666,17 @@ det(A1), 1/det(A2)
|
||||
The technique of *implicit differentiation* is a useful one, as it allows derivatives of more complicated expressions to be found. The main idea, expressed here with three variables is if an equation may be viewed as $F(x,y,z) = c$, $c$ a constant, then $z=\phi(x,y)$ may be viewed as a function of $x$ and $y$. Hence, we can use the chain rule to find: $\partial z / \partial x$ and $\partial z /\partial x$. Let $G(x,y) = \langle x, y, \phi(x,y) \rangle$ and then differentiation $(F \circ G)(x,y) = c$:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
0 &= dF_{G(x,y)} \circ dG_{\langle x, y\rangle}\\
|
||||
&= [\frac{\partial F}{\partial x}\quad \frac{\partial F}{\partial y}\quad \frac{\partial F}{\partial z}](G(x,y)) \cdot
|
||||
\left[\begin{array}{}
|
||||
\begin{bmatrix}
|
||||
1 & 0\\
|
||||
0 & 1\\
|
||||
\frac{\partial \phi}{\partial x} & \frac{\partial \phi}{\partial y}
|
||||
\end{array}\right].
|
||||
\end{bmatrix}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Solving yields
|
||||
|
||||
@ -903,12 +903,11 @@ The transformation $F(x, y) = \langle 2x + 3y + 1, 4x + y + 2\rangle$ is an exam
|
||||
|
||||
|
||||
$$
|
||||
J = \left[
|
||||
\begin{array}{}
|
||||
J =
|
||||
\begin{bmatrix}
|
||||
2 & 4\\
|
||||
3 & 1
|
||||
\end{array}
|
||||
\right].
|
||||
\end{bmatrix}.
|
||||
$$
|
||||
|
||||
```{julia}
|
||||
@ -929,12 +928,11 @@ Does the transformation $F(u,v) = \langle u^2 - v^2, u^2 + v^2 \rangle$ have Jac
|
||||
|
||||
|
||||
$$
|
||||
J = \left[
|
||||
\begin{array}{}
|
||||
J =
|
||||
\begin{bmatrix}
|
||||
2u & -2v\\
|
||||
2u & 2v
|
||||
\end{array}
|
||||
\right]?
|
||||
\end{bmatrix}?
|
||||
$$
|
||||
|
||||
```{julia}
|
||||
|
@ -793,7 +793,7 @@ Vector-valued functions do not have multiplication or division defined for them,
|
||||
For the dot product, the combination $\vec{f}(t) \cdot \vec{g}(t)$ we have a univariate function of $t$, so we know a derivative is well defined. Can it be represented in terms of the vector-valued functions? In terms of the component functions, we have this calculation specific to $n=2$, but that which can be generalized:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\frac{d}{dt}(\vec{f}(t) \cdot \vec{g}(t)) &=
|
||||
\frac{d}{dt}(f_1(t) g_1(t) + f_2(t) g_2(t))\\
|
||||
@ -801,7 +801,7 @@ $$
|
||||
&= f_1'(t) g_1(t) + f_2'(t) g_2(t) + f_1(t) g_1'(t) + f_2(t) g_2'(t)\\
|
||||
&= \vec{f}'(t)\cdot \vec{g}(t) + \vec{f}(t) \cdot \vec{g}'(t).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Suggesting the that a product rule like formula applies for dot products.
|
||||
|
||||
@ -832,12 +832,12 @@ diff.(uₛ × vₛ, tₛ) - (diff.(uₛ, tₛ) × vₛ + uₛ × diff.(vₛ, t
|
||||
In summary, these two derivative formulas hold for vector-valued functions $R \rightarrow R^n$:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
(\vec{u} \cdot \vec{v})' &= \vec{u}' \cdot \vec{v} + \vec{u} \cdot \vec{v}',\\
|
||||
(\vec{u} \times \vec{v})' &= \vec{u}' \times \vec{v} + \vec{u} \times \vec{v}'.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
##### Application. Circular motion and the tangent vector.
|
||||
|
||||
@ -889,12 +889,12 @@ Combining, Newton states $\vec{a} = -(GM/r^2) \hat{x}$.
|
||||
Now to show the first law. Consider $\vec{x} \times \vec{v}$. It is constant, as:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
(\vec{x} \times \vec{v})' &= \vec{x}' \times \vec{v} + \vec{x} \times \vec{v}'\\
|
||||
&= \vec{v} \times \vec{v} + \vec{x} \times \vec{a}.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
Both terms are $\vec{0}$, as $\vec{a}$ is parallel to $\vec{x}$ by the above, and clearly $\vec{v}$ is parallel to itself.
|
||||
|
||||
@ -905,35 +905,35 @@ This says, $\vec{x} \times \vec{v} = \vec{c}$ is a constant vector, meaning, the
|
||||
Now, by differentiating $\vec{x} = r \hat{x}$ we have:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\vec{v} &= \vec{x}'\\
|
||||
&= (r\hat{x})'\\
|
||||
&= r' \hat{x} + r \hat{x}',
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
and so
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\vec{c} &= \vec{x} \times \vec{v}\\
|
||||
&= (r\hat{x}) \times (r'\hat{x} + r \hat{x}')\\
|
||||
&= r^2 (\hat{x} \times \hat{x}').
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
From this, we can compute $\vec{a} \times \vec{c}$:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\vec{a} \times \vec{c} &= (-\frac{GM}{r^2})\hat{x} \times r^2(\hat{x} \times \hat{x}')\\
|
||||
&= -GM \hat{x} \times (\hat{x} \times \hat{x}') \\
|
||||
&= GM (\hat{x} \times \hat{x}')\times \hat{x}.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
The last line by anti-commutativity.
|
||||
|
||||
@ -941,23 +941,23 @@ The last line by anti-commutativity.
|
||||
But, the triple cross product can be simplified through the identify $(\vec{u}\times\vec{v})\times\vec{w} = (\vec{u}\cdot\vec{w})\vec{v} - (\vec{v}\cdot\vec{w})\vec{u}$. So, the above becomes:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\vec{a} \times \vec{c} &= GM ((\hat{x}\cdot\hat{x})\hat{x}' - (\hat{x} \cdot \hat{x}')\hat{x})\\
|
||||
&= GM (1 \hat{x}' - 0 \hat{x}).
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
Now, since $\vec{c}$ is constant, we have:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
(\vec{v} \times \vec{c})' &= (\vec{a} \times \vec{c})\\
|
||||
&= GM \hat{x}'\\
|
||||
&= (GM\hat{x})'.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
The two sides have the same derivative, hence differ by a constant:
|
||||
|
||||
@ -972,8 +972,8 @@ As $\vec{u}$ and $\vec{v}\times\vec{c}$ lie in the same plane - orthogonal to $\
|
||||
Now
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
c^2 &= \|\vec{c}\|^2 \\
|
||||
&= \vec{c} \cdot \vec{c}\\
|
||||
&= (\vec{x} \times \vec{v}) \cdot \vec{c}\\
|
||||
@ -981,8 +981,8 @@ c^2 &= \|\vec{c}\|^2 \\
|
||||
&= r\hat{x} \cdot (GM\hat{x} + \vec{d})\\
|
||||
&= GMr + r \hat{x} \cdot \vec{d}\\
|
||||
&= GMr + rd \cos(\theta).
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
Solving, this gives the first law. That is, the radial distance is in the form of an ellipse:
|
||||
|
||||
@ -1502,13 +1502,13 @@ $$
|
||||
As before, but further, we have if $\kappa$ is the curvature and $\tau$ the torsion, these relationships expressing the derivatives with respect to $s$ in terms of the components in the frame:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\hat{T}'(s) &= &\kappa \hat{N}(s) &\\
|
||||
\hat{N}'(s) &= -\kappa \hat{T}(s) & &+ \tau \hat{B}(s)\\
|
||||
\hat{B}'(s) &= &-\tau \hat{N}(s) &
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
These are the [Frenet-Serret](https://en.wikipedia.org/wiki/Frenet%E2%80%93Serret_formulas) formulas.
|
||||
|
||||
@ -1619,13 +1619,13 @@ end
|
||||
Levi and Tabachnikov prove in their Proposition 2.4:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\kappa(u) &= \frac{d\alpha(u)}{du} + \frac{\sin(\alpha(u))}{a},\\
|
||||
|\frac{du}{dv}| &= |\cos(\alpha)|, \quad \text{and}\\
|
||||
k &= \frac{\tan(\alpha)}{a}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The first equation relates the steering angle with the curvature. If the steering angle is not changed ($d\alpha/du=0$) then the curvature is constant and the motion is circular. It will be greater for larger angles (up to $\pi/2$). As the curvature is the reciprocal of the radius, this means the radius of the circular trajectory will be smaller. For the same constant steering angle, the curvature will be smaller for longer wheelbases, meaning the circular trajectory will have a larger radius. For cars, which have similar dynamics, this means longer wheelbase cars will take more room to make a U-turn.
|
||||
|
||||
@ -1639,14 +1639,14 @@ The last equation, relates the curvature of the back wheel track to the steering
|
||||
To derive the first one, we have previously noted that when a curve is parameterized by arc length, the curvature is more directly computed: it is the magnitude of the derivative of the tangent vector. The tangent vector is of unit length, when parametrized by arc length. This implies its derivative will be orthogonal. If $\vec{r}(t)$ is a parameterization by arc length, then the curvature formula simplifies as:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\kappa(s) &= \frac{\| \vec{r}'(s) \times \vec{r}''(s) \|}{\|\vec{r}'(s)\|^3} \\
|
||||
&= \frac{\| \vec{r}'(s) \times \vec{r}''(s) \|}{1} \\
|
||||
&= \| \vec{r}'(s) \| \| \vec{r}''(s) \| \sin(\theta) \\
|
||||
&= 1 \| \vec{r}''(s) \| 1 = \| \vec{r}''(s) \|.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
So in the above, the curvature is $\kappa = \| \vec{F}''(u) \|$ and $k = \|\vec{B}''(v)\|$.
|
||||
|
||||
@ -1673,8 +1673,8 @@ $$
|
||||
It must be that the tangent line of $\vec{B}$ is parallel to $\vec{U} \cos(\alpha) + \vec{V} \sin(\alpha)$. To utilize this, we differentiate $\vec{B}$ using the facts that $\vec{U}' = \kappa \vec{V}$ and $\vec{V}' = -\kappa \vec{U}$. These coming from $\vec{U} = \vec{F}'$ and so it's derivative in $u$ has magnitude yielding the curvature, $\kappa$, and direction orthogonal to $\vec{U}$.
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\vec{B}'(u) &= \vec{F}'(u)
|
||||
-a \vec{U}' \cos(\alpha) -a \vec{U} (-\sin(\alpha)) \alpha'
|
||||
+a \vec{V}' \sin(\alpha) + a \vec{V} \cos(\alpha) \alpha'\\
|
||||
@ -1684,14 +1684,14 @@ a (-\kappa) \vec{U} \sin(\alpha) + a \vec{V} \cos(\alpha) \alpha' \\
|
||||
&= \vec{U}
|
||||
+ a(\alpha' - \kappa) \sin(\alpha) \vec{U}
|
||||
+ a(\alpha' - \kappa) \cos(\alpha)\vec{V}.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
Extend the $2$-dimensional vectors to $3$ dimensions, by adding a zero $z$ component, then:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\vec{0} &= (\vec{U}
|
||||
+ a(\alpha' - \kappa) \sin(\alpha) \vec{U}
|
||||
+ a(\alpha' - \kappa) \cos(\alpha)\vec{V}) \times
|
||||
@ -1702,8 +1702,8 @@ a(\alpha' - \kappa) \cos(\alpha)\vec{V} \times \vec{U} \cos(\alpha) \\
|
||||
&= (\sin(\alpha) + a(\alpha'-\kappa) \sin^2(\alpha) +
|
||||
a(\alpha'-\kappa) \cos^2(\alpha)) \vec{U} \times \vec{V} \\
|
||||
&= (\sin(\alpha) + a (\alpha' - \kappa)) \vec{U} \times \vec{V}.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
The terms $\vec{U} \times\vec{U}$ and $\vec{V}\times\vec{V}$ being $\vec{0}$, due to properties of the cross product. This says the scalar part must be $0$, or
|
||||
|
||||
@ -1715,39 +1715,20 @@ $$
|
||||
As for the second equation, from the expression for $\vec{B}'(u)$, after setting $a(\alpha'-\kappa) = -\sin(\alpha)$:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\|\vec{B}'(u)\|^2
|
||||
&= \| (1 -\sin(\alpha)\sin(\alpha)) \vec{U} -\sin(\alpha)\cos(\alpha) \vec{V} \|^2\\
|
||||
&= \| \cos^2(\alpha) \vec{U} -\sin(\alpha)\cos(\alpha) \vec{V} \|^2\\
|
||||
&= (\cos^2(\alpha))^2 + (\sin(\alpha)\cos(\alpha))^2\quad\text{using } \vec{U}\cdot\vec{V}=0\\
|
||||
&= \cos^2(\alpha)(\cos^2(\alpha) + \sin^2(\alpha))\\
|
||||
&= \cos^2(\alpha).
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
From this $\|\vec{B}(u)\| = |\cos(\alpha)\|$. But $1 = \|d\vec{B}/dv\| = \|d\vec{B}/du \| \cdot |du/dv|$ and $|dv/du|=|\cos(\alpha)|$ follows.
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
#How to compute the curvature k?
|
||||
#```math
|
||||
#\begin{align}
|
||||
#\frac{d^2\hat{B}}{dv}
|
||||
#&= \frac{d^2\hat{B}}{du^2} \cdot (\frac{dv}{du})^2 + \frac{d^2v}{du^2} \cdot \hat{B}'(u)\\
|
||||
#&= \cos^2(\alpha) \cdot (-2\sin(\alpha)\cos(\alpha}\alpha'\vec{U} + \cos^2(\alpha) \kappa \vec{V} - (\cos^2(\alph#a)-\sin^2(\alpha))\alpha'\vec{V} + \sin(\alpha)\cos(\alpha)\kappa \vec{U}) + \frac{\sin(\alpha)}{\cos^2(\alpha) \#cdot (\cos^2(\alpha)\vec{U} - \sin(\alpha)\cos(\alpha) \vec{V})\\
|
||||
#&=
|
||||
#
|
||||
#
|
||||
#&= \| (1 -\sin(alpha)\sin(\alpha) \vec{U} -\sin(\alpha)\cos(\alpha) \vec{V} \|^2\\
|
||||
#&= \| \cos^2(\alpha) \vec{U} -\sin(\alpha)\cos(\alpha) \vec{V} \|^2\\
|
||||
#&= ((\cos^2(alpha))^2 + (\sin(\alpha)\cos(\alpha))^2\quad\text{using } \vec{U}\cdot\vec{V}=0\\
|
||||
#&= \cos(\alpha)^2.
|
||||
#\end{align}
|
||||
#```
|
||||
nothing
|
||||
```
|
||||
|
||||
## Evolutes and involutes
|
||||
|
||||
@ -1779,12 +1760,12 @@ Consider a parameterization of a curve by arc-length, $\vec\gamma(s) = \langle u
|
||||
Consider two nearby points $t$ and $t+\epsilon$ and the intersection of $l_t$ and $l_{t+\epsilon}$. That is, we need points $a$ and $b$ with: $l_t(a) = l_{t+\epsilon}(b)$. Setting the components equal, this is:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
u(t) - av'(t) &= u(t+\epsilon) - bv'(t+\epsilon) \\
|
||||
v(t) - au'(t) &= v(t+\epsilon) - bu'(t+\epsilon).
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
This is a linear equation in two unknowns ($a$ and $b$) which can be solved. Here is the value for `a`:
|
||||
|
||||
@ -1802,25 +1783,25 @@ out[a]
|
||||
Letting $\epsilon \rightarrow 0$ we get an expression for $a$ that will describe the evolute at time $t$ in terms of the function $\gamma$. Looking at the expression above, we can see that dividing the *numerator* by $\epsilon$ and taking a limit will yield $u'(t)^2 + v'(t)^2$. If the *denominator* has a limit after dividing by $\epsilon$, then we can find the description sought. Pursuing this leads to:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\frac{u'(t) v'(t+\epsilon) - v'(t) u'(t+\epsilon)}{\epsilon}
|
||||
&= \frac{u'(t) v'(t+\epsilon) -u'(t)v'(t) + u'(t)v'(t)- v'(t) u'(t+\epsilon)}{\epsilon} \\
|
||||
&= \frac{u'(t)(v'(t+\epsilon) -v'(t))}{\epsilon} + \frac{(u'(t)- u'(t+\epsilon))v'(t)}{\epsilon},
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
which in the limit will give $u'(t)v''(t) - u''(t) v'(t)$. All told, in the limit as $\epsilon \rightarrow 0$ we get
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
a &= \frac{u'(t)^2 + v'(t)^2}{u'(t)v''(t) - v'(t) u''(t)} \\
|
||||
&= 1/(\|\vec\gamma'\|\kappa) \\
|
||||
&= 1/(\|\hat{T}\|\kappa) \\
|
||||
&= 1/\kappa,
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
with $\kappa$ being the curvature of the planar curve. That is, the evolute of $\vec\gamma$ is described by:
|
||||
|
||||
@ -1845,14 +1826,14 @@ plot_parametric!(0..2pi, t -> (rₑ₃(t) + Normal(rₑ₃, t)/curvature(rₑ₃
|
||||
We computed the above illustration using $3$ dimensions (hence the use of `[1:2]...`) as the curvature formula is easier to express. Recall, the curvature also appears in the [Frenet-Serret](https://en.wikipedia.org/wiki/Frenet%E2%80%93Serret_formulas) formulas: $d\hat{T}/ds = \kappa \hat{N}$ and $d\hat{N}/ds = -\kappa \hat{T}+ \tau \hat{B}$. In a planar curve, as under consideration, the binormal is $\vec{0}$. This allows the computation of $\vec\beta(s)'$:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\vec{\beta}' &= \frac{d(\vec\gamma + (1/k) \hat{N})}{dt}\\
|
||||
&= \hat{T} + (-\frac{k'}{k^2}\hat{N} + \frac{1}{k} \hat{N}')\\
|
||||
&= \hat{T} - \frac{k'}{k^2}\hat{N} + \frac{1}{k} (-\kappa \hat{T})\\
|
||||
&= - \frac{k'}{k^2}\hat{N}.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
We see $\vec\beta'$ is zero (the curve is non-regular) when $\kappa'(s) = 0$. The curvature changes from increasing to decreasing, or vice versa at each of the $4$ crossings of the major and minor axes - there are $4$ non-regular points, and we see $4$ cusps in the evolute.
|
||||
|
||||
@ -1916,12 +1897,12 @@ $$
|
||||
If $\vec\gamma(s)$ is parameterized by arc length, then this simplifies quite a bit, as the unit tangent is just $\vec\gamma'(s)$ and the remaining arc length just $(s-a)$:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\vec\beta_a(s) &= \vec\gamma(s) - \vec\gamma'(s) (s-a) \\
|
||||
&=\vec\gamma(s) - \hat{T}_{\vec\gamma}(s)(s-a).\quad (a \text{ is the arc-length parameter})
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
With this characterization, we see several properties:
|
||||
|
||||
@ -1941,12 +1922,12 @@ $$
|
||||
In the following we show that:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\kappa_{\vec\beta_a}(s) &= 1/(s-a),\\
|
||||
\hat{N}_{\vec\beta_a}(s) &= \hat{T}_{\vec\beta_a}'(s)/\|\hat{T}_{\vec\beta_a}'(s)\| = -\hat{T}_{\vec\gamma}(s).
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
The first shows in a different way that when $s=a$ the curve is not regular, as the curvature fails to exists. In the above figure, when the involute touches $\vec\gamma$, there will be a cusp.
|
||||
|
||||
@ -1954,7 +1935,7 @@ The first shows in a different way that when $s=a$ the curve is not regular, as
|
||||
With these two identifications and using $\vec\gamma'(s) = \hat{T}_{\vec\gamma(s)}$, we have the evolute simplifies to
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\vec\beta_a(s) + \frac{1}{\kappa_{\vec\beta_a}(s)}\hat{N}_{\vec\beta_a}(s)
|
||||
&=
|
||||
@ -1963,7 +1944,7 @@ $$
|
||||
\vec\gamma(s) + \hat{T}_{\vec\gamma}(s)(s-a) + \frac{1}{1/(s-a)} (-\hat{T}_{\vec\gamma}(s)) \\
|
||||
&= \vec\gamma(s).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
That is the evolute of an involute of $\vec\gamma(s)$ is $\vec\gamma(s)$.
|
||||
|
||||
@ -1971,13 +1952,13 @@ That is the evolute of an involute of $\vec\gamma(s)$ is $\vec\gamma(s)$.
|
||||
We have:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\beta_a(s) &= \vec\gamma - \vec\gamma'(s)(s-a)\\
|
||||
\beta_a'(s) &= -\kappa_{\vec\gamma}(s)(s-a)\hat{N}_{\vec\gamma}(s)\\
|
||||
\beta_a''(s) &= (-\kappa_{\vec\gamma}(s)(s-a))' \hat{N}_{\vec\gamma}(s) + (-\kappa_{\vec\gamma}(s)(s-a))(-\kappa_{\vec\gamma}\hat{T}_{\vec\gamma}(s)),
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
the last line by the Frenet-Serret formula for *planar* curves which show $\hat{T}'(s) = \kappa(s) \hat{N}$ and $\hat{N}'(s) = -\kappa(s)\hat{T}(s)$.
|
||||
|
||||
@ -1985,12 +1966,12 @@ the last line by the Frenet-Serret formula for *planar* curves which show $\hat
|
||||
To compute the curvature of $\vec\beta_a$, we need to compute both:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\| \vec\beta' \|^3 &= |\kappa^3 (s-a)^3|\\
|
||||
\| \vec\beta' \times \vec\beta'' \| &= |\kappa(s)^3 (s-a)^2|,
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
the last line using both $\hat{N}\times\hat{N} = \vec{0}$ and $\|\hat{N}\times\hat{T}\| = 1$. The curvature then is $\kappa_{\vec\beta_a}(s) = 1/(s-a)$.
|
||||
|
||||
@ -2673,14 +2654,14 @@ radioq(choices, answ)
|
||||
The evolute comes from the formula $\vec\gamma(T) - (1/\kappa(t)) \hat{N}(t)$. For hand computation, this formula can be explicitly given by two components $\langle X(t), Y(t) \rangle$ through:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
r(t) &= x'(t)^2 + y'(t)^2\\
|
||||
k(t) &= x'(t)y''(t) - x''(t) y'(t)\\
|
||||
X(t) &= x(t) - y'(t) r(t)/k(t)\\
|
||||
Y(t) &= x(t) + x'(t) r(t)/k(t)
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
Let $\vec\gamma(t) = \langle t, t^2 \rangle = \langle x(t), y(t)\rangle$ be a parameterization of a parabola.
|
||||
|
||||
|
@ -444,25 +444,22 @@ $$
|
||||
The left hand sides are in the form of a dot product, in this case $\langle a,b \rangle \cdot \langle x, y\rangle$ and $\langle a,b,c \rangle \cdot \langle x, y, z\rangle$ respectively. When there is a system of equations, something like:
|
||||
|
||||
|
||||
$$
|
||||
\begin{array}{}
|
||||
3x &+& 4y &- &5z &= 10\\
|
||||
3x &-& 5y &+ &7z &= 11\\
|
||||
-3x &+& 6y &+ &9z &= 12,
|
||||
\end{array}
|
||||
$$
|
||||
\begin{align*}
|
||||
3x &+ 4y &- 5z &= 10\\
|
||||
3x &- 5y &+ 7z &= 11\\
|
||||
-3x &+ 6y &+ 9z &= 12,
|
||||
\end{align*}
|
||||
|
||||
Then we might think of $3$ vectors $\langle 3,4,-5\rangle$, $\langle 3,-5,7\rangle$, and $\langle -3,6,9\rangle$ being dotted with $\langle x,y,z\rangle$. Mathematically, matrices and their associated algebra are used to represent this. In this example, the system of equations above would be represented by a matrix and two vectors:
|
||||
|
||||
|
||||
$$
|
||||
M = \left[
|
||||
\begin{array}{}
|
||||
M =
|
||||
\begin{bmatrix}
|
||||
3 & 4 & -5\\
|
||||
5 &-5 & 7\\
|
||||
-3& 6 & 9
|
||||
\end{array}
|
||||
\right],\quad
|
||||
\end{bmatrix},\quad
|
||||
\vec{x} = \langle x, y , z\rangle,\quad
|
||||
\vec{b} = \langle 10, 11, 12\rangle,
|
||||
$$
|
||||
@ -512,38 +509,33 @@ Matrices have other operations defined on them. We mention three here:
|
||||
|
||||
|
||||
$$
|
||||
\left|
|
||||
\begin{array}{}
|
||||
\begin{vmatrix}
|
||||
a&b\\
|
||||
c&d
|
||||
\end{array}
|
||||
\right| =
|
||||
\end{vmatrix}
|
||||
=
|
||||
ad - bc, \quad
|
||||
\left|
|
||||
\begin{array}{}
|
||||
\begin{vmatrix}
|
||||
a&b&c\\
|
||||
d&e&f\\
|
||||
g&h&i
|
||||
\end{array}
|
||||
\right| =
|
||||
a \left|
|
||||
\begin{array}{}
|
||||
\end{vmatrix}
|
||||
=
|
||||
a
|
||||
\begin{vmatrix}
|
||||
e&f\\
|
||||
h&i
|
||||
\end{array}
|
||||
\right|
|
||||
- b \left|
|
||||
\begin{array}{}
|
||||
\end{vmatrix}
|
||||
- b
|
||||
\begin{vmatrix}
|
||||
d&f\\
|
||||
g&i
|
||||
\end{array}
|
||||
\right|
|
||||
+c \left|
|
||||
\begin{array}{}
|
||||
\end{vmatrix}
|
||||
+c
|
||||
\begin{vmatrix}
|
||||
d&e\\
|
||||
g&h
|
||||
\end{array}
|
||||
\right|.
|
||||
\end{vmatrix}
|
||||
$$
|
||||
|
||||
The $3\times 3$ case shows how determinants may be [computed recursively](https://en.wikipedia.org/wiki/Determinant#Definition), using "cofactor" expansion.
|
||||
@ -776,13 +768,11 @@ There is a matrix notation that can simplify this computation. If we *formally*
|
||||
|
||||
|
||||
$$
|
||||
\left[
|
||||
\begin{array}{}
|
||||
\begin{bmatrix}
|
||||
\hat{i} & \hat{j} & \hat{k}\\
|
||||
u_1 & u_2 & u_3\\
|
||||
v_1 & v_2 & v_3
|
||||
\end{array}
|
||||
\right]
|
||||
\end{bmatrix}
|
||||
$$
|
||||
|
||||
From the $\sin(\theta)$ term in the definition, we see that $\vec{u}\times\vec{u}=0$. In fact, the cross product is $0$ only if the two vectors involved are parallel or there is a zero vector.
|
||||
|
@ -68,12 +68,9 @@ and loads some useful packages that will be used repeatedly.
|
||||
These notes are presented as a Quarto book. To learn more about Quarto
|
||||
books visit <https://quarto.org/docs/books>.
|
||||
|
||||
These notes may also be compiled into `Pluto` notebooks. As such, to
|
||||
accommodate `Pluto`'s design of only one global variable definition
|
||||
being allowed per notebook, there is frequent use of
|
||||
[Unicode](./misc/unicode.html) symbols for variable names.
|
||||
These notes may be compiled into a `pdf` file through Quarto. As the result is rather large, we do not provide that file for download. For the interested reader, downloading the repository, instantiating the environment, and running `quarto` to render to `pdf` in the `quarto` subdirectory should produce that file (after some time).
|
||||
|
||||
To contribute -- say by suggesting addition topics, correcting a
|
||||
To *contribute* -- say by suggesting addition topics, correcting a
|
||||
mistake, or fixing a typo -- click the "Edit this page" link and join the list of [contributors](https://github.com/jverzani/CalculusWithJuliaNotes.jl/graphs/contributors).
|
||||
|
||||
----
|
||||
|
@ -216,8 +216,8 @@ annotate!([
|
||||
Let $F=\langle F_x, F_y\rangle$. For small enough values of $\Delta{x}$ and $\Delta{y}$ the line integral, $\oint_C F\cdot d\vec{r}$ can be *approximated* by $4$ terms:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\left(F(x,y) \cdot \hat{i}\right)\Delta{x} &+
|
||||
\left(F(x+\Delta{x},y) \cdot \hat{j}\right)\Delta{y} +
|
||||
\left(F(x,y+\Delta{y}) \cdot (-\hat{i})\right)\Delta{x} +
|
||||
@ -228,8 +228,8 @@ F_x(x, y+\Delta{y}) (-\Delta{x}) + F_y(x,y) (-\Delta{y})\\
|
||||
&=
|
||||
(F_y(x + \Delta{x}, y) - F_y(x, y))\Delta{y} -
|
||||
(F_x(x, y+\Delta{y})-F_x(x,y))\Delta{x}.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
The Riemann approximation allows a choice of evaluation point for Riemann integrable functions, and the choice here lends itself to further analysis. Were the above divided by $\Delta{x}\Delta{y}$, the area of the box, and a limit taken, partial derivatives appear to suggest this formula:
|
||||
|
||||
@ -325,18 +325,18 @@ p
|
||||
Now we compute the *line integral*. Consider the top face, $S_1$, connecting $(x,y,z+\Delta z), (x + \Delta x, y, z + \Delta z), (x + \Delta x, y + \Delta y, z + \Delta z), (x, y + \Delta y, z + \Delta z)$, Using the *right hand rule*, parameterize the boundary curve, $C_1$, in a counter clockwise direction so the right hand rule yields the outward pointing normal ($\hat{k}$). Then the integral $\oint_{C_1} F\cdot \hat{T} ds$ is *approximated* by the following Riemann sum of $4$ terms:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
F(x,y, z+\Delta{z}) \cdot \hat{i}\Delta{x} &+ F(x+\Delta x, y, z+\Delta{z}) \cdot \hat{j} \Delta y \\
|
||||
&+ F(x, y+\Delta y, z+\Delta{z}) \cdot (-\hat{i}) \Delta{x} \\
|
||||
&+ F(x, y, z+\Delta{z}) \cdot (-\hat{j}) \Delta{y}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
(The points $c_i$ are chosen from the endpoints of the line segments.)
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\oint_{C_1} F\cdot \hat{T} ds
|
||||
&\approx (F_y(x+\Delta x, y, z+\Delta{z}) \\
|
||||
@ -344,18 +344,18 @@ $$
|
||||
&- (F_x(x,y + \Delta{y}, z+\Delta{z}) \\
|
||||
&- F_x(x, y, z+\Delta{z})) \Delta{x}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
As before, were this divided by the *area* of the surface, we have after rearranging and cancellation:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\frac{1}{\Delta{S_1}} \oint_{C_1} F \cdot \hat{T} ds &\approx
|
||||
\frac{F_y(x+\Delta x, y, z+\Delta{z}) - F_y(x, y, z+\Delta{z})}{\Delta{x}}\\
|
||||
&- \frac{F_x(x, y+\Delta y, z+\Delta{z}) - F_x(x, y, z+\Delta{z})}{\Delta{y}}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
In the limit, as $\Delta{S} \rightarrow 0$, this will converge to $\partial{F_y}/\partial{x}-\partial{F_x}/\partial{y}$.
|
||||
|
||||
@ -366,7 +366,7 @@ Had the bottom of the box been used, a similar result would be found, up to a mi
|
||||
Unlike the two dimensional case, there are other directions to consider and here the other sides will yield different answers. Consider now the face connecting $(x,y,z), (x+\Delta{x}, y, z), (x+\Delta{x}, y, z + \Delta{z})$, and $ (x,y,z+\Delta{z})$ with outward pointing normal $-\hat{j}$. Let $S_2$ denote this face and $C_2$ describe its boundary. Orient this curve so that the right hand rule points in the $-\hat{j}$ direction (the outward pointing normal). Then, as before, we can approximate:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\oint_{C_2} F \cdot \hat{T} ds
|
||||
&\approx
|
||||
@ -377,7 +377,7 @@ F(x,y,z) \cdot \hat{i} \Delta{x} \\
|
||||
&= (F_z(x+\Delta{x},y,z) - F_z(x, y, z))\Delta{z} -
|
||||
(F_x(x,y,z+\Delta{z}) - F(x,y,z)) \Delta{x}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Dividing by $\Delta{S}=\Delta{x}\Delta{z}$ and taking a limit will give:
|
||||
|
||||
@ -423,13 +423,12 @@ The curl has a formal representation in terms of a $3\times 3$ determinant, simi
|
||||
|
||||
|
||||
$$
|
||||
\text{curl}(F) = \det\left[
|
||||
\begin{array}{}
|
||||
\text{curl}(F) = \det
|
||||
\begin{bmatrix}
|
||||
\hat{i} & \hat{j} & \hat{k}\\
|
||||
\frac{\partial}{\partial{x}} & \frac{\partial}{\partial{y}} & \frac{\partial}{\partial{z}}\\
|
||||
F_x & F_y & F_z
|
||||
\end{array}
|
||||
\right]
|
||||
\end{bmatrix}
|
||||
$$
|
||||
|
||||
---
|
||||
@ -474,7 +473,7 @@ The divergence, gradient, and curl all involve partial derivatives. There is a n
|
||||
This is a *vector differential operator* that acts on functions and vector fields through the typical notation to yield the three operations:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\nabla{f} &= \langle
|
||||
\frac{\partial{f}}{\partial{x}},
|
||||
@ -502,17 +501,17 @@ $$
|
||||
\frac{\partial}{\partial{y}},
|
||||
\frac{\partial}{\partial{z}}
|
||||
\rangle \times F =
|
||||
\det\left[
|
||||
\begin{array}{}
|
||||
\det
|
||||
\begin{bmatrix}
|
||||
\hat{i} & \hat{j} & \hat{k} \\
|
||||
\frac{\partial}{\partial{x}}&
|
||||
\frac{\partial}{\partial{y}}&
|
||||
\frac{\partial}{\partial{z}}\\
|
||||
F_x & F_y & F_z
|
||||
\end{array}
|
||||
\right],\quad\text{the curl}.
|
||||
\end{bmatrix}
|
||||
,\quad\text{the curl}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
:::{.callout-note}
|
||||
## Note
|
||||
@ -842,13 +841,13 @@ Let $f$ and $g$ denote scalar functions, $R^3 \rightarrow R$ and $F$ and $G$ be
|
||||
As with the sum rule of univariate derivatives, these operations satisfy:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\nabla(f + g) &= \nabla{f} + \nabla{g}\\
|
||||
\nabla\cdot(F+G) &= \nabla\cdot{F} + \nabla\cdot{G}\\
|
||||
\nabla\times(F+G) &= \nabla\times{F} + \nabla\times{G}.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
### Product rule
|
||||
|
||||
@ -856,13 +855,13 @@ $$
|
||||
The product rule $(uv)' = u'v + uv'$ has related formulas:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\nabla{(fg)} &= (\nabla{f}) g + f\nabla{g} = g\nabla{f} + f\nabla{g}\\
|
||||
\nabla\cdot{fF} &= (\nabla{f})\cdot{F} + f(\nabla\cdot{F})\\
|
||||
\nabla\times{fF} &= (\nabla{f})\times{F} + f(\nabla\times{F}).
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
### Rules over cross products
|
||||
|
||||
@ -870,13 +869,13 @@ $$
|
||||
The cross product of two vector fields is a vector field for which the divergence and curl may be taken. There are formulas to relate to the individual terms:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\nabla\cdot(F \times G) &= (\nabla\times{F})\cdot G - F \cdot (\nabla\times{G})\\
|
||||
\nabla\times(F \times G) &= F(\nabla\cdot{G}) - G(\nabla\cdot{F} + (G\cdot\nabla)F-(F\cdot\nabla)G\\
|
||||
&= \nabla\cdot(BA^t - AB^t).
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
The curl formula is more involved.
|
||||
|
||||
@ -921,7 +920,7 @@ Second,
|
||||
This is not as clear, but can be seen algebraically as terms cancel. First:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\nabla\cdot(\nabla\times{F}) &=
|
||||
\langle
|
||||
@ -938,7 +937,7 @@ $$
|
||||
\left(\frac{\partial^2{F_x}}{\partial{z}\partial{y}} - \frac{\partial^2{F_z}}{\partial{x}\partial{y}}\right) +
|
||||
\left(\frac{\partial^2{F_y}}{\partial{x}\partial{z}} - \frac{\partial^2{F_x}}{\partial{y}\partial{z}}\right)
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Focusing on one component function, $F_z$ say, we see this contribution:
|
||||
|
||||
@ -1014,7 +1013,7 @@ This is because of how the line integrals are oriented so that the right-hand ru
|
||||
The [invariance of charge](https://en.wikipedia.org/wiki/Maxwell%27s_equations#Charge_conservation) can be derived as a corollary of Maxwell's equation. The divergence of the curl of the magnetic field is $0$, leading to:
|
||||
|
||||
|
||||
```{mat}
|
||||
|
||||
\begin{align*}
|
||||
0 &= \nabla\cdot(\nabla\times{B}) \\
|
||||
&=
|
||||
@ -1024,7 +1023,7 @@ The [invariance of charge](https://en.wikipedia.org/wiki/Maxwell%27s_equations#C
|
||||
&=
|
||||
\mu_0(\nabla\cdot{J} + \frac{\partial{\rho}}{\partial{t}}).
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
|
||||
That is $\nabla\cdot{J} = -\partial{\rho}/\partial{t}$. This says any change in the charge density in time ($\partial{\rho}/\partial{t}$) is balanced off by a divergence in the electric current density ($\nabla\cdot{J}$). That is, charge can't be created or destroyed in an isolated system.
|
||||
|
||||
@ -1048,25 +1047,25 @@ $$
|
||||
Without explaining why, these values can be computed using volume and surface integrals:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\phi(\vec{r}') &=
|
||||
\frac{1}{4\pi} \int_V \frac{\nabla \cdot F(\vec{r})}{\|\vec{r}'-\vec{r} \|} dV -
|
||||
\frac{1}{4\pi} \oint_S \frac{F(\vec{r})}{\|\vec{r}'-\vec{r} \|} \cdot \hat{N} dS\\
|
||||
A(\vec{r}') &= \frac{1}{4\pi} \int_V \frac{\nabla \times F(\vec{r})}{\|\vec{r}'-\vec{r} \|} dV +
|
||||
\frac{1}{4\pi} \oint_S \frac{F(\vec{r})}{\|\vec{r}'-\vec{r} \|} \times \hat{N} dS.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
If $V = R^3$, an unbounded domain, *but* $F$ *vanishes* faster than $1/r$, then the theorem still holds with just the volume integrals:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\phi(\vec{r}') &=\frac{1}{4\pi} \int_V \frac{\nabla \cdot F(\vec{r})}{\|\vec{r}'-\vec{r} \|} dV\\
|
||||
A(\vec{r}') &= \frac{1}{4\pi} \int_V \frac{\nabla \times F(\vec{r})}{\|\vec{r}'-\vec{r}\|} dV.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
## Change of variable
|
||||
|
||||
@ -1080,8 +1079,8 @@ Some details are [here](https://en.wikipedia.org/wiki/Curvilinear_coordinates),
|
||||
We restrict to $n=3$ and use $(x,y,z)$ for Cartesian coordinates and $(u,v,w)$ for an *orthogonal* curvilinear coordinate system, such as spherical or cylindrical. If $\vec{r} = \langle x,y,z\rangle$, then
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
d\vec{r} &= \langle dx,dy,dz \rangle = J \langle du,dv,dw\rangle\\
|
||||
&=
|
||||
\left[ \frac{\partial{\vec{r}}}{\partial{u}} \vdots
|
||||
@ -1090,8 +1089,8 @@ d\vec{r} &= \langle dx,dy,dz \rangle = J \langle du,dv,dw\rangle\\
|
||||
&= \frac{\partial{\vec{r}}}{\partial{u}} du +
|
||||
\frac{\partial{\vec{r}}}{\partial{v}} dv
|
||||
\frac{\partial{\vec{r}}}{\partial{w}} dw.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
The term ${\partial{\vec{r}}}/{\partial{u}}$ is tangent to the curve formed by *assuming* $v$ and $w$ are constant and letting $u$ vary. Similarly for the other partial derivatives. Orthogonality assumes that at every point, these tangent vectors are orthogonal.
|
||||
|
||||
@ -1138,7 +1137,7 @@ This uses orthogonality, so $\hat{e}_v \times \hat{e}_w$ is parallel to $\hat{e}
|
||||
The volume element is found by *projecting* $d\vec{r}$ onto the $\hat{e}_u$, $\hat{e}_v$, $\hat{e}_w$ coordinate system through $(d\vec{r} \cdot\hat{e}_u) \hat{e}_u$, $(d\vec{r} \cdot\hat{e}_v) \hat{e}_v$, and $(d\vec{r} \cdot\hat{e}_w) \hat{e}_w$. Then forming the triple scalar product to compute the volume of the parallelepiped:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\left[(d\vec{r} \cdot\hat{e}_u) \hat{e}_u\right] \cdot
|
||||
\left(
|
||||
@ -1149,7 +1148,7 @@ $$
|
||||
&=
|
||||
h_u h_v h_w du dv dw,
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
as the unit vectors are orthonormal, their triple scalar product is $1$ and $d\vec{r}\cdot\hat{e}_u = h_u du$, etc.
|
||||
|
||||
@ -1214,21 +1213,21 @@ p
|
||||
The tangent vectors found from the partial derivatives of $\vec{r}$:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\frac{\partial{\vec{r}}}{\partial{r}} &=
|
||||
\langle \cos(\theta) \cdot \sin(\phi), \sin(\theta) \cdot \sin(\phi), \cos(\phi)\rangle,\\
|
||||
\frac{\partial{\vec{r}}}{\partial{\theta}} &=
|
||||
\langle -r\cdot\sin(\theta)\cdot\sin(\phi), r\cdot\cos(\theta)\cdot\sin(\phi), 0\rangle,\\
|
||||
\frac{\partial{\vec{r}}}{\partial{\phi}} &=
|
||||
\langle r\cdot\cos(\theta)\cdot\cos(\phi), r\cdot\sin(\theta)\cdot\cos(\phi), -r\cdot\sin(\phi) \rangle.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
With this, we have $h_r=1$, $h_\theta=r\sin(\phi)$, and $h_\phi = r$. So that
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
dl &= \sqrt{dr^2 + (r\sin(\phi)d\theta^2) + (rd\phi)^2},\\
|
||||
dS_r &= r^2\sin(\phi)d\theta d\phi,\\
|
||||
@ -1236,7 +1235,7 @@ dS_\theta &= rdr d\phi,\\
|
||||
dS_\phi &= r\sin(\phi)dr d\theta, \quad\text{and}\\
|
||||
dV &= r^2\sin(\phi) drd\theta d\phi.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The following visualizes the volume and the surface elements.
|
||||
|
||||
@ -1292,7 +1291,7 @@ p
|
||||
If $f$ is a scalar function then $df = \nabla{f} \cdot d\vec{r}$ by the chain rule. Using the curvilinear coordinates:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
df &=
|
||||
\frac{\partial{f}}{\partial{u}} du +
|
||||
@ -1303,7 +1302,7 @@ df &=
|
||||
\frac{1}{h_v}\frac{\partial{f}}{\partial{v}} h_vdv +
|
||||
\frac{1}{h_w}\frac{\partial{f}}{\partial{w}} h_wdw.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
But, as was used above, $d\vec{r} \cdot \hat{e}_u = h_u du$, etc. so $df$ can be re-expressed as:
|
||||
|
||||
@ -1379,13 +1378,12 @@ where $S$ is a surface perpendicular to $\hat{N}$ with boundary $C$. For a small
|
||||
|
||||
|
||||
$$
|
||||
\nabla\times{F} = \det \left[
|
||||
\begin{array}{}
|
||||
\nabla\times{F} = \det
|
||||
\begin{bmatrix}
|
||||
h_u\hat{e}_u & h_v\hat{e}_v & h_w\hat{e}_w \\
|
||||
\frac{\partial}{\partial{u}} & \frac{\partial}{\partial{v}} & \frac{\partial}{\partial{w}} \\
|
||||
h_uF_u & h_v F_v & h_w F_w
|
||||
\end{array}
|
||||
\right].
|
||||
\end{bmatrix}.
|
||||
$$
|
||||
|
||||
---
|
||||
@ -1395,32 +1393,30 @@ For example, in cylindrical coordinates, the curl is:
|
||||
|
||||
|
||||
$$
|
||||
\det\left[
|
||||
\begin{array}{}
|
||||
\det
|
||||
\begin{bmatrix}
|
||||
\hat{r} & r\hat{\theta} & \hat{k} \\
|
||||
\frac{\partial}{\partial{r}} & \frac{\partial}{\partial{\theta}} & \frac{\partial}{\partial{z}} \\
|
||||
F_r & rF_\theta & F_z
|
||||
\end{array}
|
||||
\right]
|
||||
\end{bmatrix}
|
||||
$$
|
||||
|
||||
Applying this to the function $F(r,\theta, z) = \hat{\theta}$ we get:
|
||||
|
||||
|
||||
$$
|
||||
\text{curl}(F) = \det\left[
|
||||
\begin{array}{}
|
||||
\text{curl}(F) = \det
|
||||
\begin{bmatrix}
|
||||
\hat{r} & r\hat{\theta} & \hat{k} \\
|
||||
\frac{\partial}{\partial{r}} & \frac{\partial}{\partial{\theta}} & \frac{\partial}{\partial{z}} \\
|
||||
0 & r & 0
|
||||
\end{array}
|
||||
\right] =
|
||||
\hat{k} \det\left[
|
||||
\begin{array}{}
|
||||
\end{bmatrix}
|
||||
=
|
||||
\hat{k} \det
|
||||
\begin{bmatrix}
|
||||
\frac{\partial}{\partial{r}} & \frac{\partial}{\partial{\theta}}\\
|
||||
0 & r
|
||||
\end{array}
|
||||
\right] =
|
||||
\end{bmatrix} =
|
||||
\hat{k}.
|
||||
$$
|
||||
|
||||
@ -1646,13 +1642,12 @@ The curl then will then be
|
||||
|
||||
|
||||
$$
|
||||
\nabla\times{F} = \det \left[
|
||||
\begin{array}{}
|
||||
\nabla\times{F} = \det
|
||||
\begin{bmatrix}
|
||||
\hat{e}_r & r\sin\phi\hat{e}_\theta & r\hat{e}_\phi \\
|
||||
\frac{\partial}{\partial{r}} & \frac{\partial}{\partial{\theta}} & \frac{\partial}{\partial{phi}} \\
|
||||
F_r & r\sin\phi F_\theta & r F_\phi
|
||||
\end{array}
|
||||
\right].
|
||||
\end{bmatrix}.
|
||||
$$
|
||||
|
||||
For a *radial* function $F = h(r)e_r$. (That is $F_r = h(r)$, $F_\theta=0$, and $F_\phi=0$. What is the curl of $F$?
|
||||
|
@ -46,9 +46,12 @@ The multidimensional case will prove to be similar where a Riemann sum is used t
|
||||
#| echo: false
|
||||
imgfile = "figures/chrysler-building-in-new-york.jpg"
|
||||
caption = """How to estimate the volume contained within the Chrysler Building? One way might be to break the building up into tall vertical blocks based on its skyline; compute the volume of each block using the formula of volume as area of the base times the height; and, finally, adding up the computed volumes This is the basic idea of finding volumes under surfaces using Riemann integration."""
|
||||
ImageFile(:integral_vector_calculus, imgfile, caption)
|
||||
#ImageFile(:integral_vector_calculus, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
@ -57,9 +60,14 @@ caption = """
|
||||
Computing the volume of a nano-block construction of the Chrysler building is easier than trying to find an actual tree at the Chrysler building, as we can easily compute the volume of columns of equal-sized blocks. Riemann sums are similar.
|
||||
"""
|
||||
|
||||
ImageFile(:integral_vector_calculus, imgfile, caption)
|
||||
#ImageFile(:integral_vector_calculus, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
The definition of the multi-dimensional integral is more involved then the one-dimensional case due to the possibly increased complexity of the region. This will require additional [steps](https://math.okstate.edu/people/lebl/osu4153-s16/chapter10-ver1.pdf). The basic approach is as follows.
|
||||
|
||||
|
||||
@ -410,9 +418,12 @@ In [Ferzola](https://doi.org/10.2307/2687130) we can read a summary of Euler's t
|
||||
imgfile ="figures/strang-slicing.png"
|
||||
caption = L"""Figure 14.2 of Strang illustrating the slice when either $x$ is fixed or $y$ is fixed. The inner integral computes the shared area, the outer integral adds the areas up to compute volume."""
|
||||
|
||||
ImageFile(:integral_vector_calculus, imgfile, caption)
|
||||
# ImageFile(:integral_vector_calculus, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
In [Volumes](../integrals/volumes_slice.html) the formula for a volume with a known cross-sectional area is given by $V = \int_a^b CA(x) dx$. The inner integral, $\int_{R_x} f(x,y) dy$ is a function depending on $x$ that yields the area of the slice (where $R_x$ is the region sliced by the line of constant $x$ value). This is consistent with Euler's view of the iterated integral.
|
||||
|
||||
|
||||
@ -925,12 +936,12 @@ In [Katz](http://www.jstor.org/stable/2689856) a review of the history of "chang
|
||||
We view $R$ in two coordinate systems $(x,y)$ and $(u,v)$. We have that
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
dx &= A du + B dv\\
|
||||
dy &= C du + D dv,
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
where $A = \partial{x}/\partial{u}$, $B = \partial{x}/\partial{v}$, $C= \partial{y}/\partial{u}$, and $D = \partial{y}/\partial{v}$. Lagrange, following Euler, first sets $x$ to be constant (as is done in iterated integration). Hence, $dx = 0$ and so $du = -C(B/A) dv$ and, after substitution, $dy = (D-C(B/A))dv$. Then Lagrange set $y$ to be a constant, so $dy = 0$ and hence $dv=0$ so $dx = Adu$. The area "element" $dx dy = A du \cdot (D - (B/A)) dv = (AD - BC) du dv$. Since areas and volumes are non-negative, the absolute value is used. With this, we have "$dxdy = |AD-BC|du dv$" as the analog of $dx = g'(u) du$.
|
||||
|
||||
@ -938,12 +949,11 @@ where $A = \partial{x}/\partial{u}$, $B = \partial{x}/\partial{v}$, $C= \partial
|
||||
The expression $AD - BC$ was also derived by Euler, by related means. Lagrange extended the analysis to 3 dimensions. Before doing so, it is helpful to understand the problem from a geometric perspective. Euler was attempting to understand the effects of the following change of variable:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
x &= a + mt + \sqrt{1-m^2} v\\
|
||||
y & = b + \sqrt{1-m^2}t -mv
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
Euler knew this to be a clockwise *rotation* by an angle $\theta$ with $\cos(\theta) = m$, a *reflection* through the $x$ axis, and a translation by $\langle a, b\rangle$. All these *should* preserve the area represented by $dx dy$, so he was *expecting* $dx dy = dt dv$.
|
||||
|
||||
@ -953,9 +963,12 @@ Euler knew this to be a clockwise *rotation* by an angle $\theta$ with $\cos(\th
|
||||
#| echo: false
|
||||
imgfile ="figures/euler-rotation.png"
|
||||
caption = "Figure from Katz showing rotation of Euler."
|
||||
ImageFile(:integral_vector_calculus, imgfile, caption)
|
||||
# ImageFile(:integral_vector_calculus, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
The figure, taken from Katz, shows the translation, and rotation that should preserve area on a differential scale.
|
||||
|
||||
|
||||
@ -1047,28 +1060,25 @@ The arrows are the images of the standard unit vectors. We see some transformati
|
||||
|
||||
|
||||
$$
|
||||
\| \det\left(\left[
|
||||
\begin{array}{}
|
||||
\| \det\left(
|
||||
\begin{bmatrix}
|
||||
\hat{i} & \hat{j} & \hat{k}\\
|
||||
u_1 & u_2 & 0\\
|
||||
v_1 & v_2 & 0
|
||||
\end{array}
|
||||
\right]
|
||||
\end{bmatrix}
|
||||
\right) \|
|
||||
=
|
||||
\| \hat{k} \det\left(\left[
|
||||
\begin{array}{}
|
||||
\| \hat{k} \det\left(
|
||||
\begin{bmatrix}
|
||||
u_1 & u_2\\
|
||||
v_1 & v_2
|
||||
\end{array}
|
||||
\right]
|
||||
\end{bmatrix}
|
||||
\right) \|
|
||||
= | \det\left(\left[
|
||||
\begin{array}{}
|
||||
= | \det\left(
|
||||
\begin{bmatrix}
|
||||
u_1 & u_2\\
|
||||
v_1 & v_2
|
||||
\end{array}
|
||||
\right]
|
||||
\end{bmatrix}
|
||||
\right)|.
|
||||
$$
|
||||
|
||||
@ -1108,12 +1118,11 @@ We have [seen](../differentiable_vector_calculus/polar_coordinates.html) how to
|
||||
|
||||
|
||||
$$
|
||||
J_G = \left[
|
||||
\begin{array}{}
|
||||
J_G =
|
||||
\begin{bmatrix}
|
||||
\cos(\theta) & - r\sin(\theta)\\
|
||||
\sin(\theta) & r\cos(\theta)
|
||||
\end{array}
|
||||
\right],
|
||||
\end{bmatrix},
|
||||
$$
|
||||
|
||||
with determinant $r$.
|
||||
@ -1156,24 +1165,20 @@ Some [transformations](https://en.wikipedia.org/wiki/Transformation_matrix#Examp
|
||||
|
||||
|
||||
$$
|
||||
\left[
|
||||
\begin{array}{}
|
||||
\begin{bmatrix}
|
||||
x\\
|
||||
y
|
||||
\end{array}
|
||||
\right] =
|
||||
\left[
|
||||
\begin{array}{}
|
||||
\end{bmatrix}
|
||||
=
|
||||
\begin{bmatrix}
|
||||
a & b\\
|
||||
c & d
|
||||
\end{array}
|
||||
\right]
|
||||
\left[
|
||||
\begin{array}{}
|
||||
\end{bmatrix}
|
||||
\begin{bmatrix}
|
||||
u\\
|
||||
v
|
||||
\end{array}
|
||||
\right],
|
||||
\end{bmatrix}
|
||||
,
|
||||
$$
|
||||
|
||||
or $G(u,v) = \langle au+bv, cu+dv\rangle$. The Jacobian of this *linear* transformation is the matrix itself.
|
||||
@ -1219,12 +1224,10 @@ showG(G)
|
||||
|
||||
$$
|
||||
\frac{1}{\| \vec{l} \|^2}
|
||||
\left[
|
||||
\begin{array}{}
|
||||
\begin{bmatrix}
|
||||
l_x^2 - l_y^2 & 2 l_x l_y\\
|
||||
2l_x l_y & l_y^2 - l_x^2
|
||||
\end{array}
|
||||
\right]
|
||||
\end{bmatrix}
|
||||
$$
|
||||
|
||||
For some simple cases: $\langle l_x, l_y \rangle = \langle 1, 1\rangle$, the diagonal, this is $G(u,v) = (1/2) \langle 2v, 2u \rangle$; $\langle l_x, l_y \rangle = \langle 0, 1\rangle$ (the $y$-axis) this is $G(u,v) = \langle -u, v\rangle$.
|
||||
@ -1268,12 +1271,10 @@ The determinant of the Jacobian is
|
||||
|
||||
$$
|
||||
\det(J_G) = \det\left(
|
||||
\left[
|
||||
\begin{array}{}
|
||||
\begin{bmatrix}
|
||||
1 & 0\\
|
||||
v & u
|
||||
\end{array}
|
||||
\right]
|
||||
\end{bmatrix}
|
||||
\right) = u.
|
||||
$$
|
||||
|
||||
@ -1304,13 +1305,13 @@ What about other triangles, say the triangle bounded by $x=0$, $y=0$ and $y-x=1$
|
||||
This can be seen as a reflection through the line $x=1/2$ of the triangle above. If $G_1$ represents the mapping from $U [0,1]\times[0,1]$ into the triangle of the last problem, and $G_2$ represents the reflection through the line $x=1/2$, then the transformation $G_2 \circ G_1$ will map the box $U$ into the desired region. By the chain rule, we have:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int_{(G_2\circ G_1)(U))} f dx &= \int_U (f\circ G_2 \circ G_1) |\det(J_{G_2 \circ G_1}| du \\
|
||||
&=
|
||||
\int_U (f\circ G_2 \circ G_1) |\det(J_{G_2}(G_1(u))||\det J_{G_1}(u)| du.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
(In [Katz](http://www.jstor.org/stable/2689856) it is mentioned that Jacobi showed this in 1841.)
|
||||
|
||||
@ -1449,7 +1450,7 @@ $$
|
||||
\int_{r=0}^1 r^2 dr \int_{\theta=0}^{\pi}\sin(\theta) = \frac{1}{3} \cdot 2.
|
||||
$$
|
||||
|
||||
The third equals sign uses separability. The answer for $\bar{ is this value divided by the area, or $2/(3\pi)$.
|
||||
The third equals sign uses separability. The answer for $\bar{y}$ is this value divided by the area, or $2/(3\pi)$.
|
||||
|
||||
|
||||
##### Example: Moment of inertia
|
||||
@ -1656,9 +1657,12 @@ $$
|
||||
imgfile = "figures/spherical-coordinates.png"
|
||||
caption = "Figure showing the parameterization by spherical coordinates. (Wikipedia)"
|
||||
|
||||
ImageFile(:integral_vector_calculus, imgfile, caption)
|
||||
# ImageFile(:integral_vector_calculus, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
The Jacobian can be computed to be $\rho^2\sin(\phi)$.
|
||||
|
||||
|
||||
|
@ -611,9 +611,13 @@ imgfile = "figures/kapoor-cloud-gate.jpg"
|
||||
caption = """
|
||||
The Anish Kapoor sculpture Cloud Gate maps the Cartesian grid formed by its concrete resting pad onto a curved surface showing the local distortions. Knowing the areas of the reflected grid after distortion would allow the computation of the surface area of the sculpture through addition. (Wikipedia)
|
||||
"""
|
||||
ImageFile(:integral_vector_calculus, imgfile, caption)
|
||||
#ImageFile(:integral_vector_calculus, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
We next turn attention to a generalization of line integrals to surface integrals. Surfaces were described in one of three ways: directly through a function as $z=f(x,y)$, as a level curve through $f(x,y,z) = c$, and parameterized through a function $\Phi: R^2 \rightarrow R^3$. The level curve description is locally a function description, and the function description leads to a parameterization ($\Phi(u,v) = \langle u,v,f(u,v)\rangle$) so we restrict to the parameterized case.
|
||||
|
||||
|
||||
|
@ -98,13 +98,13 @@ In dimension $m=3$, the **binormal** vector, $\hat{B}$, is the unit vector $\hat
|
||||
The [Frenet-Serret]() formulas define the **curvature**, $\kappa$, and the **torsion**, $\tau$, by
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\frac{d\hat{T}}{ds} &= & \kappa \hat{N} &\\
|
||||
\frac{d\hat{N}}{ds} &= -\kappa\hat{T} & & + \tau\hat{B}\\
|
||||
\frac{d\hat{B}}{ds} &= & -\tau\hat{N}&
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
These formulas apply in dimension $m=2$ with $\hat{B}=\vec{0}$.
|
||||
|
||||
@ -121,14 +121,14 @@ The chain rule says $(\vec{r}(g(t))' = \vec{r}'(g(t)) g'(t)$.
|
||||
A scalar function, $f:R^n\rightarrow R$, $n > 1$ has a **partial derivative** defined. For $n=2$, these are:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\frac{\partial{f}}{\partial{x}}(x,y) &=
|
||||
\lim_{h\rightarrow 0} \frac{f(x+h,y)-f(x,y)}{h}\\
|
||||
\frac{\partial{f}}{\partial{y}}(x,y) &=
|
||||
\lim_{h\rightarrow 0} \frac{f(x,y+h)-f(x,y)}{h}.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
The generalization to $n>2$ is clear - the partial derivative in $x_i$ is the derivative of $f$ when the *other* $x_j$ are held constant.
|
||||
|
||||
@ -198,14 +198,13 @@ For $F=\langle f_1, f_2, \dots, f_m\rangle$ the total derivative is the **Jacob
|
||||
|
||||
|
||||
$$
|
||||
J_f = \left[
|
||||
\begin{align}{}
|
||||
J_f =
|
||||
\begin{bmatrix}
|
||||
\frac{\partial f_1}{\partial x_1} &\quad \frac{\partial f_1}{\partial x_2} &\dots&\quad\frac{\partial f_1}{\partial x_n}\\
|
||||
\frac{\partial f_2}{\partial x_1} &\quad \frac{\partial f_2}{\partial x_2} &\dots&\quad\frac{\partial f_2}{\partial x_n}\\
|
||||
&&\vdots&\\
|
||||
\frac{\partial f_m}{\partial x_1} &\quad \frac{\partial f_m}{\partial x_2} &\dots&\quad\frac{\partial f_m}{\partial x_n}
|
||||
\end{align}
|
||||
\right].
|
||||
\end{bmatrix}.
|
||||
$$
|
||||
|
||||
This can be viewed as being comprised of row vectors, each being the individual gradients; or as column vectors each being the vector of partial derivatives for a given variable.
|
||||
@ -225,7 +224,7 @@ A scalar function $f:R^n \rightarrow R$ and a parameterized curve $\vec{r}:R\rig
|
||||
|
||||
|
||||
$$
|
||||
d_f(\vec{r}) d_\vec{r} = \nabla{f}(\vec{r}(t))' \vec{r}'(t) =
|
||||
d_f(\vec{r}) d\vec{r} = \nabla{f}(\vec{r}(t))' \vec{r}'(t) =
|
||||
\nabla{f}(\vec{r}(t)) \cdot \vec{r}'(t),
|
||||
$$
|
||||
|
||||
@ -356,29 +355,29 @@ $$
|
||||
In two dimensions, we have the following interpretations:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\iint_R dA &= \text{area of } R\\
|
||||
\iint_R \rho dA &= \text{mass with constant density }\rho\\
|
||||
\iint_R \rho(x,y) dA &= \text{mass of region with density }\rho\\
|
||||
\frac{1}{\text{area}}\iint_R x \rho(x,y)dA &= \text{centroid of region in } x \text{ direction}\\
|
||||
\frac{1}{\text{area}}\iint_R y \rho(x,y)dA &= \text{centroid of region in } y \text{ direction}
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
In three dimensions, we have the following interpretations:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\iint_VdV &= \text{volume of } V\\
|
||||
\iint_V \rho dV &= \text{mass with constant density }\rho\\
|
||||
\iint_V \rho(x,y) dV &= \text{mass of volume with density }\rho\\
|
||||
\frac{1}{\text{volume}}\iint_V x \rho(x,y)dV &= \text{centroid of volume in } x \text{ direction}\\
|
||||
\frac{1}{\text{volume}}\iint_V y \rho(x,y)dV &= \text{centroid of volume in } y \text{ direction}\\
|
||||
\frac{1}{\text{volume}}\iint_V z \rho(x,y)dV &= \text{centroid of volume in } z \text{ direction}
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
To compute integrals over non-box-like regions, Fubini's theorem may be utilized. Alternatively, a **transformation** of variables
|
||||
|
||||
|
@ -270,12 +270,12 @@ r(t) = [a*cos(t),b*sin(t)]
|
||||
To compute the area of the triangle with vertices $(0,0)$, $(a,0)$ and $(0,b)$ we can orient the boundary counter clockwise. Let $A$ be the line segment from $(0,b)$ to $(0,0)$, $B$ be the line segment from $(0,0)$ to $(a,0)$, and $C$ be the other. Then
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\frac{1}{2} \int_A F\cdot\hat{T} ds &=\frac{1}{2} \int_A -ydx = 0\\
|
||||
\frac{1}{2} \int_B F\cdot\hat{T} ds &=\frac{1}{2} \int_B xdy = 0,
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
as on $A$, $y=0$ and $dy=0$ and on $B$, $x=0$ and $dx=0$.
|
||||
|
||||
@ -310,7 +310,7 @@ For the two dimensional case the curl is a scalar. *If* $F = \langle F_x, F_y\ra
|
||||
Now assume $\partial{F_y}/\partial{x} - \partial{F_x}/\partial{y} = 0$. Let $P$ and $Q$ be two points in the plane. Take any path, $C_1$ from $P$ to $Q$ and any return path, $C_2$, from $Q$ to $P$ that do not cross and such that $C$, the concatenation of the two paths, satisfies Green's theorem. Then, as $F$ is continuous on an open interval containing $D$, we have:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
0 &= \iint_D 0 dA \\
|
||||
&=
|
||||
@ -320,7 +320,7 @@ $$
|
||||
&=
|
||||
\int_{C_1} F \cdot \hat{T} ds + \int_{C_2}F \cdot \hat{T} ds.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Reversing $C_2$ to go from $P$ to $Q$, we see the two work integrals are identical, that is the field is conservative.
|
||||
|
||||
@ -338,14 +338,14 @@ For example, let $F(x,y) = \langle \sin(xy), \cos(xy) \rangle$. Is this a conser
|
||||
We can check by taking partial derivatives. Those of interest are:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\frac{\partial{F_y}}{\partial{x}} &= \frac{\partial{(\cos(xy))}}{\partial{x}} =
|
||||
-\sin(xy) y,\\
|
||||
\frac{\partial{F_x}}{\partial{y}} &= \frac{\partial{(\sin(xy))}}{\partial{y}} =
|
||||
\cos(xy)x.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
It is not the case that $\partial{F_y}/\partial{x} - \partial{F_x}/\partial{y}=0$, so this vector field is *not* conservative.
|
||||
|
||||
@ -416,25 +416,25 @@ p
|
||||
Let $A$ label the red line, $B$ the green curve, $C$ the blue line, and $D$ the black line. Then the area is given from Green's theorem by considering half of the the line integral of $F(x,y) = \langle -y, x\rangle$ or $\oint_C (xdy - ydx)$. To that matter we have:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\int_A (xdy - ydx) &= a f(a)\\
|
||||
\int_C (xdy - ydx) &= b(-f(b))\\
|
||||
\int_D (xdy - ydx) &= 0\\
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
Finally the integral over $B$, using integration by parts:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\int_B F(\vec{r}(t))\cdot \frac{d\vec{r}(t)}{dt} dt &=
|
||||
\int_b^a \langle -f(t),t)\rangle\cdot\langle 1, f'(t)\rangle dt\\
|
||||
&= \int_a^b f(t)dt - \int_a^b tf'(t)dt\\
|
||||
&= \int_a^b f(t)dt - \left(tf(t)\mid_a^b - \int_a^b f(t) dt\right).
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
Combining, we have after cancellation $\oint (xdy - ydx) = 2\int_a^b f(t) dt$, or after dividing by $2$ the signed area under the curve.
|
||||
|
||||
@ -469,16 +469,16 @@ The cut leads to a counter-clockwise orientation on the outer ring and a clockw
|
||||
To see that the area integral of $F(x,y) = (1/2)\langle -y, x\rangle$ produces the area for this orientation we have, using $C_1$ as the outer ring, and $C_2$ as the inner ring:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\oint_{C_1} F \cdot \hat{T} ds &=
|
||||
\int_0^{2\pi} (1/2)(2)\langle -\sin(t), \cos(t)\rangle \cdot (2)\langle-\sin(t), \cos(t)\rangle dt \\
|
||||
&= (1/2) (2\pi) 4 = 4\pi\\
|
||||
\oint_{C_2} F \cdot \hat{T} ds &=
|
||||
\int_{0}^{2\pi} (1/2) \langle \sin(t), \cos(t)\rangle \cdot \langle-\sin(t), -\cos(t)\rangle dt\\
|
||||
&= -(1/2)(2\pi) = -\pi.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
(Using $\vec{r}(t) = 2\langle \cos(t), \sin(t)\rangle$ for the outer ring and $\vec{r}(t) = 1\langle \cos(t), -\sin(t)\rangle$ for the inner ring.)
|
||||
|
||||
@ -716,9 +716,13 @@ imgfile ="figures/jiffy-pop.png"
|
||||
caption ="""
|
||||
The Jiffy Pop popcorn design has a top surface that is designed to expand to accommodate the popped popcorn. Viewed as a surface, the surface area grows, but the boundary - where the surface meets the pan - stays the same. This is an example that many different surfaces can have the same bounding curve. Stokes' theorem will relate a surface integral over the surface to a line integral about the bounding curve.
|
||||
"""
|
||||
ImageFile(:integral_vector_calculus, imgfile, caption)
|
||||
# ImageFile(:integral_vector_calculus, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
Were the figure of Jiffy Pop popcorn animated, the surface of foil would slowly expand due to pressure of popping popcorn until the popcorn was ready. However, the boundary would remain the same. Many different surfaces can have the same boundary. Take for instance the upper half unit sphere in $R^3$ it having the curve $x^2 + y^2 = 1$ as a boundary curve. This is the same curve as the surface of the cone $z = 1 - (x^2 + y^2)$ that lies above the $x-y$ plane. This would also be the same curve as the surface formed by a Mickey Mouse glove if the collar were scaled and positioned onto the unit circle.
|
||||
|
||||
|
||||
@ -736,7 +740,7 @@ $$
|
||||
This gives the series of approximations:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\oint_C F\cdot\hat{T} ds &=
|
||||
\sum \oint_{C_i} F\cdot\hat{T} ds \\
|
||||
@ -747,7 +751,7 @@ $$
|
||||
&\approx
|
||||
\iint_S \nabla\times{F}\cdot\hat{N} dS.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
In terms of our expanding popcorn, the boundary integral - after accounting for cancellations, as in Green's theorem - can be seen as a microscopic sum of boundary integrals each of which is approximated by a term $\nabla\times{F}\cdot\hat{N} \Delta{S}$ which is viewed as a Riemann sum approximation for the the integral of the curl over the surface. The cancellation depends on a proper choice of orientation, but with that we have:
|
||||
|
||||
@ -1127,13 +1131,13 @@ The divergence theorem provides two means to compute a value, the point here is
|
||||
Following Schey, we now consider a continuous analog to the crowd counting problem through a flow with a non-uniform density that may vary in time. Let $\rho(x,y,z;t)$ be the time-varying density and $v(x,y,z;t)$ be a vector field indicating the direction of flow. Consider some three-dimensional volume, $V$, with boundary $S$ (though two-dimensional would also be applicable). Then these integrals have interpretations:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\iiint_V \rho dV &&\quad\text{Amount contained within }V\\
|
||||
\frac{\partial}{\partial{t}} \iiint_V \rho dV &=
|
||||
\iiint_V \frac{\partial{\rho}}{\partial{t}} dV &\quad\text{Change in time of amount contained within }V
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
Moving the derivative inside the integral requires an assumption of continuity. Assume the material is *conserved*, meaning that if the amount in the volume $V$ changes it must flow in and out through the boundary. The flow out through $S$, the boundary of $V$, is
|
||||
|
||||
|
@ -26,9 +26,13 @@ caption = """
|
||||
A kids' jump rope by Lifeline is comprised of little plastic segments of uniform length around a cord. The length of the rope can be computed by adding up the lengths of each segment, regardless of how the rope is arranged.
|
||||
|
||||
"""
|
||||
ImageFile(:integrals, imgfile, caption)
|
||||
# ImageFile(:integrals, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
The length of the jump rope in the picture can be computed by either looking at the packaging it came in, or measuring the length of each plastic segment and multiplying by the number of segments. The former is easier, the latter provides the intuition as to how we can find the length of curves in the $x-y$ plane. The idea is old, [Archimedes](http://www.maa.org/external_archive/joma/Volume7/Aktumen/Polygon.html) used fixed length segments of polygons to approximate $\pi$ using the circumference of circle producing the bounds $3~\frac{1}{7} > \pi > 3~\frac{10}{71}$.
|
||||
|
||||
|
||||
@ -64,7 +68,6 @@ To see why, any partition of the interval $[a,b]$ by $a = t_0 < t_1 < \cdots < t
|
||||
```{julia}
|
||||
#| hold: false
|
||||
#| echo: false
|
||||
#| cache: true
|
||||
## {{{arclength_graph}}}
|
||||
function make_arclength_graph(n)
|
||||
|
||||
@ -120,7 +123,7 @@ $$
|
||||
But looking at each term, we can push the denominator into the square root as:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
d_i &= d_i \cdot \frac{t_i - t_{i-1}}{t_i - t_{i-1}}
|
||||
\\
|
||||
@ -128,7 +131,7 @@ d_i &= d_i \cdot \frac{t_i - t_{i-1}}{t_i - t_{i-1}}
|
||||
\left(\frac{f(t_i)-f(t_{i-1})}{t_i-t_{i-1}}\right)^2} \cdot (t_i - t_{i-1}) \\
|
||||
&= \sqrt{ g'(\xi_i)^2 + f'(\psi_i)^2} \cdot (t_i - t_{i-1}).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The values $\xi_i$ and $\psi_i$ are guaranteed by the mean value theorem and must be in $[t_{i-1}, t_i]$.
|
||||
|
||||
@ -257,9 +260,12 @@ This picture of Jasper John's [Near the Lagoon](http://www.artic.edu/aic/collect
|
||||
#| echo: false
|
||||
imgfile = "figures/johns-catenary.jpg"
|
||||
caption = "One of Jasper Johns' Catenary series. Art Institute of Chicago."
|
||||
ImageFile(:integrals, imgfile, caption)
|
||||
# ImageFile(:integrals, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
The museum notes have
|
||||
|
||||
|
||||
@ -342,9 +348,12 @@ imgfile="figures/verrazzano-unloaded.jpg"
|
||||
caption = """
|
||||
The Verrazzano-Narrows Bridge during construction. The unloaded suspension cables form a catenary.
|
||||
"""
|
||||
ImageFile(:integrals, imgfile, caption)
|
||||
# ImageFile(:integrals, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
@ -352,21 +361,25 @@ imgfile="figures/verrazzano-loaded.jpg"
|
||||
caption = """
|
||||
A rendering of the Verrazzano-Narrows Bridge after construction (cf. [nycgovparks.org](https://www.nycgovparks.org/highlights/verrazano-bridge)). The uniformly loaded suspension cables would form a parabola, presumably a fact the artist of this rendering knew. (The spelling in the link is not the official spelling, which carries two zs.)
|
||||
"""
|
||||
ImageFile(:integrals, imgfile, caption)
|
||||
# ImageFile(:integrals, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||
). The uniformly loaded suspension cables would form a parabola, presumably a fact the artist of this rendering knew. (The spelling in the link is not the official spelling, which carries two zs.)
|
||||
](./figures/verrazzano-loaded.jpg)
|
||||
|
||||
##### Example
|
||||
|
||||
|
||||
The [nephroid](http://www-history.mcs.st-and.ac.uk/Curves/Nephroid.html) is a curve that can be described parametrically by
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
g(t) &= a(3\cos(t) - \cos(3t)), \\
|
||||
f(t) &= a(3\sin(t) - \sin(3t)).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Taking $a=1$ we have this graph:
|
||||
|
||||
@ -391,7 +404,7 @@ quadgk(t -> sqrt(𝒈'(t)^2 + 𝒇'(t)^2), 0, 2pi)[1]
|
||||
The answer seems like a floating point approximation of $24$, which suggests that this integral is tractable. Pursuing this, the integrand simplifies:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\sqrt{g'(t)^2 + f'(t)^2}
|
||||
&= \sqrt{(-3\sin(t) + 3\sin(3t))^2 + (3\cos(t) - 3\cos(3t))^2} \\
|
||||
@ -401,7 +414,7 @@ $$
|
||||
&= 3\sqrt{2}\sqrt{1 - \cos(2t)}\\
|
||||
&= 3\sqrt{2}\sqrt{2\sin(t)^2}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The second to last line comes from a double angle formula expansion of $\cos(3t - t)$ and the last line from the half angle formula for $\cos$.
|
||||
|
||||
@ -423,6 +436,7 @@ The following link shows how the perimeter of a complex figure relates to the pe
|
||||
tweet = """
|
||||
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">How cookie cutters are made <a href="https://t.co/eumfwH4Ixl">pic.twitter.com/eumfwH4Ixl</a></p>— How Things Are Manufactured (@fastworkers6) <a href="https://twitter.com/fastworkers6/status/1556214840909111296?ref_src=twsrc%5Etfw">August 7, 2022</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
|
||||
"""
|
||||
|
||||
HTMLoutput(tweet)
|
||||
```
|
||||
|
||||
@ -435,14 +449,14 @@ A teacher of small children assigns his students the task of computing the lengt
|
||||
Mathematically, suppose a curve is described parametrically by $(g(t), f(t))$ for $a \leq t \leq b$. A new parameterization is provided by $\gamma(t)$. Suppose $\gamma$ is strictly increasing, so that an inverse function exists. (This assumption is implicitly made by the teacher, as it implies the student won't start counting in the wrong direction.) Then the same curve is described by composition through $(g(\gamma(u)), f(\gamma(u)))$, $\gamma^{-1}(a) \leq u \leq \gamma^{-1}(b)$. That the arc length is the same follows from substitution:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int_{\gamma^{-1}(a)}^{\gamma^{-1}(b)} \sqrt{([g(\gamma(t))]')^2 + ([f(\gamma(t))]')^2} dt
|
||||
&=\int_{\gamma^{-1}(a)}^{\gamma^{-1}(b)} \sqrt{(g'(\gamma(t) )\gamma'(t))^2 + (f'(\gamma(t) )\gamma'(t))^2 } dt \\
|
||||
&=\int_{\gamma^{-1}(a)}^{\gamma^{-1}(b)} \sqrt{g'(\gamma(t))^2 + f'(\gamma(t))^2} \gamma'(t) dt\\
|
||||
&=\int_a^b \sqrt{g'(u)^2 + f'(u)^2} du = L
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
(Using $u=\gamma(t)$ for the substitution.)
|
||||
|
||||
@ -466,13 +480,13 @@ For a simple example, we have $g(t) = R\cos(t)$ and $f(t)=R\sin(t)$ parameterizi
|
||||
What looks at first glance to be just a slightly more complicated equation is that of an ellipse, with $g(t) = a\cos(t)$ and $f(t) = b\sin(t)$. Taking $a=1$ and $b = a + c$, for $c > 0$ we get the equation for the arc length as a function of $t$ is just
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
s(u) &= \int_0^u \sqrt{(-\sin(t))^2 + b\cos(t)^2} dt\\
|
||||
&= \int_0^u \sqrt{\sin(t))^2 + \cos(t)^2 + c\cos(t)^2} dt \\
|
||||
&=\int_0^u \sqrt{1 + c\cos(t)^2} dt.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
But, despite it not looking too daunting, this integral is not tractable through our techniques and has an answer involving elliptic integrals. We can work numerically though. Letting $a=1$ and $b=2$, we have the arc length is given by:
|
||||
|
||||
@ -571,12 +585,12 @@ $$
|
||||
So
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int_0^1 (tf'(u) + (1-t)f'(v)) dt &< \int_0^1 f'(tu + (1-t)v) dt, \text{or}\\
|
||||
\frac{f'(u) + f'(v)}{2} &< \frac{1}{v-u}\int_u^v f'(w) dw,
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
by the substitution $w = tu + (1-t)v$. Using the fundamental theorem of calculus to compute the mean value of the integral of $f'$ over $[u,v]$ gives the following as a consequence of strict concavity of $f'$:
|
||||
|
||||
@ -667,25 +681,25 @@ which holds by the strict concavity of $f'$, as found previously.
|
||||
Using the substitution $x = f_i^{-1}(u)$ as needed to see:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int_a^u f(x) dx &= \int_0^{f(u)} u [f_1^{-1}]'(u) du \\
|
||||
&> -\int_0^h u [f_2^{-1}]'(u) du \\
|
||||
&= \int_h^0 u [f_2^{-1}]'(u) du \\
|
||||
&= \int_v^b f(x) dx.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
For the latter claim, integrating in the $y$ variable gives
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int_u^c (f(x)-h) dx &= \int_h^m (c - f_1^{-1}(y)) dy\\
|
||||
&> \int_h^m (c - f_2^{-1}(y)) dy\\
|
||||
&= \int_c^v (f(x)-h) dx
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Now, the area under $h$ over $[u,c]$ is greater than that over $[c,v]$ as $(u+v)/2 < c$ or $v-c < c-u$. That means the area under $f$ over $[u,c]$ is greater than that over $[c,v]$.
|
||||
|
||||
@ -707,7 +721,7 @@ or $\phi'(z) < 0$. Moreover, we have by the first assertion that $f'(z) < -f'(\p
|
||||
Using the substitution $x = \phi(z)$ gives:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int_v^b \sqrt{1 + f'(x)^2} dx &=
|
||||
\int_u^a \sqrt{1 + f'(\phi(z))^2} \phi'(z) dz\\
|
||||
@ -716,7 +730,7 @@ $$
|
||||
&= \int_a^u \sqrt{\phi'(z)^2 + f'(z)^2} dz\\
|
||||
&< \int_a^u \sqrt{1 + f'(z)^2} dz
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Letting $h=f(u) \rightarrow c$ we get the *inequality*
|
||||
|
||||
@ -765,12 +779,12 @@ $$
|
||||
with the case above corresponding to $W = -m(k/m)$. The set of equations then satisfy:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
x''(t) &= - W(t,x(t), x'(t), y(t), y'(t)) \cdot x'(t)\\
|
||||
y''(t) &= -g - W(t,x(t), x'(t), y(t), y'(t)) \cdot y'(t)\\
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
with initial conditions: $x(0) = y(0) = 0$ and $x'(0) = v_0 \cos(\theta), y'(0) = v_0 \sin(\theta)$.
|
||||
|
||||
@ -778,28 +792,28 @@ with initial conditions: $x(0) = y(0) = 0$ and $x'(0) = v_0 \cos(\theta), y'(0)
|
||||
Only with certain drag forces, can this set of equations be be solved exactly, though it can be approximated numerically for admissible $W$, but if $W$ is strictly positive then it can be shown $x(t)$ is increasing on $[0, x_\infty)$ and so invertible, and $f(u) = y(x^{-1}(u))$ is three times differentiable with both $f$ and $f'$ being strictly concave, as it can be shown that (say $x(v) = u$ so $dv/du = 1/x'(v) > 0$):
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
f''(u) &= -\frac{g}{x'(v)^2} < 0\\
|
||||
f'''(u) &= \frac{2gx''(v)}{x'(v)^3} \\
|
||||
&= -\frac{2gW}{x'(v)^2} \cdot \frac{dv}{du} < 0
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The latter by differentiating, the former a consequence of the following formulas for derivatives of inverse functions
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
[x^{-1}]'(u) &= 1 / x'(v) \\
|
||||
[x^{-1}]''(u) &= -x''(v)/(x'(v))^3
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
For then
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
f(u) &= y(x^{-1}(u)) \\
|
||||
f'(u) &= y'(x^{-1}(u)) \cdot {x^{-1}}'(u) \\
|
||||
@ -808,7 +822,7 @@ f''(u) &= y''(x^{-1}(u))\cdot[x^{-1}]'(u)^2 + y'(x^{-1}(u)) \cdot [x^{-1}]''(u)
|
||||
&= -g/(x'(v))^2 - W y'/(x'(v))^2 - y'(v) \cdot (- W \cdot x'(v)) / x'(v)^3\\
|
||||
&= -g/x'(v)^2.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
## Questions
|
||||
|
||||
|
@ -74,7 +74,6 @@ In a previous section, we saw this animation:
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
#| cache: true
|
||||
## {{{archimedes_parabola}}}
|
||||
|
||||
|
||||
@ -154,10 +153,16 @@ approximations by geometric figures with known area is the basis of
|
||||
Riemann sums.
|
||||
|
||||
"""
|
||||
ImageFile(:integrals, imgfile, caption)
|
||||
#ImageFile(:integrals, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
Beeckman actually did more than find the area. He generalized the relationship of rate $\times$ time $=$ distance. The line was interpreting a velocity, the "squares", then, provided an approximate distance traveled when the velocity is taken as a constant on the small time interval. Then the distance traveled can be approximated by a smaller quantity - just add the area of the rectangles squarely within the desired area ($6+16+6$) - and a larger quantity - by including all rectangles that have a portion of their area within the desired area ($10 + 16 + 10$). Beeckman argued that the error vanishes as the rectangles get smaller.
|
||||
|
||||
|
||||
@ -222,7 +227,7 @@ To successfully compute a good approximation for the area, we would need to choo
|
||||
For Archimedes' problem - finding the area under $f(x)=x^2$ between $0$ and $1$ - if we take as a partition $x_i = i/n$ and $c_i = x_i$, then the above sum becomes:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
S_n &= f(c_1) \cdot (x_1 - x_0) + f(c_2) \cdot (x_2 - x_1) + \cdots + f(c_n) \cdot (x_n - x_{n-1})\\
|
||||
&= (x_1)^2 \cdot \frac{1}{n} + (x_2)^2 \cdot \frac{1}{n} + \cdot + (x_n)^2 \cdot \frac{1}{n}\\
|
||||
@ -230,7 +235,7 @@ S_n &= f(c_1) \cdot (x_1 - x_0) + f(c_2) \cdot (x_2 - x_1) + \cdots + f(c_n) \cd
|
||||
&= \frac{1}{n^3} \cdot (1^2 + 2^2 + \cdots + n^2) \\
|
||||
&= \frac{1}{n^3} \cdot \frac{n\cdot(n-1)\cdot(2n+1)}{6}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The latter uses a well-known formula for the sum of squares of the first $n$ natural numbers.
|
||||
|
||||
@ -460,7 +465,7 @@ Using the definition, we can compute a few definite integrals:
|
||||
This is just the area of a trapezoid with heights $a$ and $b$ and side length $b-a$, or $1/2 \cdot (b + a) \cdot (b - a)$. The right sum would be:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
S &= x_1 \cdot (x_1 - x_0) + x_2 \cdot (x_2 - x_1) + \cdots x_n \cdot (x_n - x_{n-1}) \\
|
||||
&= (a + 1\frac{b-a}{n}) \cdot \frac{b-a}{n} + (a + 2\frac{b-a}{n}) \cdot \frac{b-a}{n} + \cdots (a + n\frac{b-a}{n}) \cdot \frac{b-a}{n}\\
|
||||
@ -469,7 +474,7 @@ S &= x_1 \cdot (x_1 - x_0) + x_2 \cdot (x_2 - x_1) + \cdots x_n \cdot (x_n - x_{
|
||||
& \rightarrow a \cdot(b-a) + \frac{(b-a)^2}{2} \\
|
||||
&= \frac{b^2}{2} - \frac{a^2}{2}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
> $$
|
||||
> \int_a^b x^2 dx = \frac{b^3}{3} - \frac{a^3}{3}.
|
||||
@ -491,7 +496,7 @@ This is similar to the Archimedes case with $a=0$ and $b=1$ shown above.
|
||||
Cauchy showed this using a *geometric series* for the partition, not the arithmetic series $x_i = a + i (b-a)/n$. The series defined by $1 + \alpha = (b/a)^{1/n}$, then $x_i = a \cdot (1 + \alpha)^i$. Here the bases $x_{i+1} - x_i$ simplify to $x_i \cdot \alpha$ and $f(x_i) = (a\cdot(1+\alpha)^i)^k = a^k (1+\alpha)^{ik}$, or $f(x_i)(x_{i+1}-x_i) = a^{k+1}\alpha[(1+\alpha)^{k+1}]^i$, so, using $u=(1+\alpha)^{k+1}=(b/a)^{(k+1)/n}$, $f(x_i) \cdot(x_{i+1} - x_i) = a^{k+1}\alpha u^i$. This gives
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
S &= a^{k+1}\alpha u^0 + a^{k+1}\alpha u^1 + \cdots + a^{k+1}\alpha u^{n-1}
|
||||
&= a^{k+1} \cdot \alpha \cdot (u^0 + u^1 + \cdot u^{n-1}) \\
|
||||
@ -499,7 +504,7 @@ S &= a^{k+1}\alpha u^0 + a^{k+1}\alpha u^1 + \cdots + a^{k+1}\alpha u^{n-1}
|
||||
&= (b^{k+1} - a^{k+1}) \cdot \frac{\alpha}{(1+\alpha)^{k+1} - 1} \\
|
||||
&\rightarrow \frac{b^{k+1} - a^{k+1}}{k+1}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
> $$
|
||||
> \int_a^b x^{-1} dx = \log(b) - \log(a), \quad (0 < a < b).
|
||||
@ -761,14 +766,12 @@ So $\pi$ is about `2a`.
|
||||
We have the well-known triangle [inequality](http://en.wikipedia.org/wiki/Triangle_inequality) which says for an individual sum: $\lvert a + b \rvert \leq \lvert a \rvert +\lvert b \rvert$. Applying this recursively to a partition with $a < b$ gives:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align*}
|
||||
\lvert f(c_1)(x_1-x_0) + f(c_2)(x_2-x_1) + \cdots + f(c_n) (x_n-x_1) \rvert
|
||||
& \leq
|
||||
\begin{multline*}
|
||||
\lvert f(c_1)(x_1-x_0) + f(c_2)(x_2-x_1) + \cdots + f(c_n) (x_n-x_1) \rvert\\
|
||||
\leq
|
||||
\lvert f(c_1)(x_1-x_0) \rvert + \lvert f(c_2)(x_2-x_1)\rvert + \cdots +\lvert f(c_n) (x_n-x_1) \rvert \\
|
||||
&= \lvert f(c_1)\rvert (x_1-x_0) + \lvert f(c_2)\rvert (x_2-x_1)+ \cdots +\lvert f(c_n) \rvert(x_n-x_1).
|
||||
\end{align*}
|
||||
$$
|
||||
= \lvert f(c_1)\rvert (x_1-x_0) + \lvert f(c_2)\rvert (x_2-x_1)+ \cdots +\lvert f(c_n) \rvert(x_n-x_1).
|
||||
\end{multline*}
|
||||
|
||||
This suggests that the following inequality holds for integrals:
|
||||
|
||||
@ -793,7 +796,7 @@ While such bounds are disappointing, often, when looking for specific values, th
|
||||
The Riemann sum above is actually extremely inefficient. To see how much, we can derive an estimate for the error in approximating the value using an arithmetic progression as the partition. Let's assume that our function $f(x)$ is increasing, so that the right sum gives an upper estimate and the left sum a lower estimate, so the error in the estimate will be between these two values:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\text{error} &\leq
|
||||
\left[
|
||||
@ -803,7 +806,7 @@ f(x_1) \cdot (x_{1} - x_0) + f(x_2) \cdot (x_{2} - x_1) + \cdots + f(x_{n-1})(
|
||||
&= \frac{b-a}{n} \cdot (\left[f(x_1) + f(x_2) + \cdots f(x_n)\right] - \left[f(x_0) + \cdots f(x_{n-1})\right]) \\
|
||||
&= \frac{b-a}{n} \cdot (f(b) - f(a)).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
We see the error goes to $0$ at a rate of $1/n$ with the constant depending on $b-a$ and the function $f$. In general, a similar bound holds when $f$ is not monotonic.
|
||||
|
||||
@ -847,12 +850,12 @@ This formula will actually be exact for any 3rd degree polynomial. In fact an en
|
||||
The formulas for an approximation to the integral $\int_{-1}^1 f(x) dx$ discussed so far can be written as:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
S &= f(x_1) \Delta_1 + f(x_2) \Delta_2 + \cdots + f(x_n) \Delta_n\\
|
||||
&= w_1 f(x_1) + w_2 f(x_2) + \cdots + w_n f(x_n).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The $w$s are "weights" and the $x$s are nodes. A [Gaussian](http://en.wikipedia.org/wiki/Gaussian_quadrature) *quadrature rule* is a set of weights and nodes for $i=1, \dots n$ for which the sum is *exact* for any $f$ which is a polynomial of degree $2n-1$ or less. Such choices then also approximate well the integrals of functions which are not polynomials of degree $2n-1$, provided $f$ can be well approximated by a polynomial over $[-1,1]$. (Which is the case for the "nice" functions we encounter.) Some examples are given in the questions.
|
||||
|
||||
|
@ -688,9 +688,13 @@ imgfile="figures/cycloid-companion-curve.png"
|
||||
caption = """
|
||||
Figure from Martin showing the companion curve to the cycloid. As the generating circle rolls, from ``A`` to ``C``, the original point of contact, ``D``, traces out an arch of the cycloid. The companion curve is that found by congruent line segments. In the figure, when ``D`` was at point ``P`` the line segment ``PQ`` is congruent to ``EF`` (on the original position of the generating circle).
|
||||
"""
|
||||
ImageFile(:integrals, imgfile, caption)
|
||||
# ImageFile(:integrals, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
In particular, it can be read that Roberval proved that the area between the cycloid and its companion curve is half the are of the generating circle. Roberval didn't know integration, so finding the area between two curves required other tricks. One is called "Cavalieri's principle." From the figure above, which of the following would you guess this principle to be:
|
||||
|
||||
|
||||
@ -738,5 +742,9 @@ imgfile="figures/companion-curve-bisects-rectangle.png"
|
||||
caption = """
|
||||
Roberval, avoiding a trignometric integral, instead used symmetry to show that the area under the companion curve was half the area of the rectangle, which in this figure is ``2\\pi``.
|
||||
"""
|
||||
ImageFile(:integrals, imgfile, caption)
|
||||
# ImageFile(:integrals, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
@ -32,9 +32,18 @@ m_2$. This means if the two children weigh the same the balance will
|
||||
tip in favor of the child farther away, and if both are the same
|
||||
distance, the balance will tip in favor of the heavier.
|
||||
"""
|
||||
ImageFile(:integrals, imgfile, caption)
|
||||
# ImageFile(:integrals, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
The game of seesaw is one where children earn an early appreciation for the effects of distance and relative weight. For children with equal weights, the seesaw will balance if they sit an equal distance from the center (on opposite sides, of course). However, with unequal weights that isn't the case. If one child weighs twice as much, the other must sit twice as far.
|
||||
|
||||
|
||||
@ -148,13 +157,13 @@ The figure shows the approximating rectangles and circles representing their mas
|
||||
Generalizing from this figure shows the center of mass for such an approximation will be:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
&\frac{\rho f(c_1) (x_1 - x_0) \cdot x_1 + \rho f(c_2) (x_2 - x_1) \cdot x_1 + \cdots + \rho f(c_n) (x_n- x_{n-1}) \cdot x_{n-1}}{\rho f(c_1) (x_1 - x_0) + \rho f(c_2) (x_2 - x_1) + \cdots + \rho f(c_n) (x_n- x_{n-1})} \\
|
||||
&=\\
|
||||
&\quad\frac{f(c_1) (x_1 - x_0) \cdot x_1 + f(c_2) (x_2 - x_1) \cdot x_1 + \cdots + f(c_n) (x_n- x_{n-1}) \cdot x_{n-1}}{f(c_1) (x_1 - x_0) + f(c_2) (x_2 - x_1) + \cdots + f(c_n) (x_n- x_{n-1})}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
But the top part is an approximation to the integral $\int_a^b x f(x) dx$ and the bottom part the integral $\int_a^b f(x) dx$. The ratio of these defines the center of mass.
|
||||
|
||||
|
@ -99,7 +99,7 @@ where we define $g(i) = f(a + ih)h$. In the above, $n$ relates to $b$, but we co
|
||||
Again, we fix a large $n$ and let $h=(b-a)/n$. And suppose $x = a + Mh$ for some $M$. Then writing out the approximations to both the definite integral and the derivative we have
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
F'(x) = & \frac{d}{dx} \int_a^x f(u) du \\
|
||||
& \approx \frac{F(x) - F(x-h)}{h} \\
|
||||
@ -112,18 +112,18 @@ F'(x) = & \frac{d}{dx} \int_a^x f(u) du \\
|
||||
\left(f(a + 1h) + f(a + 2h) + \cdots + f(a + (M-1)h) \right) \\
|
||||
&= f(a + Mh).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
If $g(i) = f(a + ih)$, then the above becomes
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
F'(x) & \approx D(S(g))(M) \\
|
||||
&= f(a + Mh)\\
|
||||
&= f(x).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
That is $F'(x) \approx f(x)$.
|
||||
|
||||
@ -365,26 +365,26 @@ This statement is nothing more than the derivative formula $[cf(x) + dg(x)]' = c
|
||||
* The antiderivative of the polynomial $p(x) = a_n x^n + \cdots a_1 x + a_0$ follows from the linearity of the integral and the general power rule:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\int (a_n x^n + \cdots a_1 x + a_0) dx
|
||||
&= \int a_nx^n dx + \cdots \int a_1 x dx + \int a_0 dx \\
|
||||
&= a_n \int x^n dx + \cdots + a_1 \int x dx + a_0 \int dx \\
|
||||
&= a_n\frac{x^{n+1}}{n+1} + \cdots + a_1 \frac{x^2}{2} + a_0 \frac{x}{1}.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
* More generally, a [Laurent](https://en.wikipedia.org/wiki/Laurent_polynomial) polynomial allows for terms with negative powers. These too can be handled by the above. For example
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\int (\frac{2}{x} + 2 + 2x) dx
|
||||
&= \int \frac{2}{x} dx + \int 2 dx + \int 2x dx \\
|
||||
&= 2\int \frac{1}{x} dx + 2 \int dx + 2 \int xdx\\
|
||||
&= 2\log(x) + 2x + 2\frac{x^2}{2}.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
* Consider this integral:
|
||||
|
||||
@ -433,7 +433,6 @@ The value of $a$ does not matter, as long as the integral is defined.
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
#| cache: true
|
||||
##{{{ftc_graph}}}
|
||||
|
||||
function make_ftc_graph(n)
|
||||
@ -645,14 +644,14 @@ Under assumptions that the $X$ are identical and independent, the largest value,
|
||||
This problem is constructed to take advantage of the FTC, and we have:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\left[P(M \leq a)\right]'
|
||||
&= \left[F(a)^n\right]'\\
|
||||
&= n \cdot F(a)^{n-1} \left[F(a)\right]'\\
|
||||
&= n F(a)^{n-1}f(a)
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
##### Example
|
||||
|
||||
|
@ -26,7 +26,6 @@ To define integrals with either functions having singularities or infinite doma
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
#| cache: true
|
||||
### {{{sqrt_graph}}}
|
||||
|
||||
function make_sqrt_x_graph(n)
|
||||
|
@ -94,7 +94,7 @@ An illustration can clarify.
|
||||
Consider the integral $\int_0^\pi x\sin(x) dx$. If we let $u=x$ and $dv=\sin(x) dx$, then $du = 1dx$ and $v=-\cos(x)$. The above then says:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int_0^\pi x\sin(x) dx &= \int_0^\pi u dv\\
|
||||
&= uv\big|_0^\pi - \int_0^\pi v du\\
|
||||
@ -103,7 +103,7 @@ $$
|
||||
&= \pi + \sin(x)\big|_0^\pi\\
|
||||
&= \pi.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The technique means one part is differentiated and one part integrated. The art is to break the integrand up into a piece that gets easier through differentiation and a piece that doesn't get much harder through integration.
|
||||
|
||||
@ -128,7 +128,7 @@ $$
|
||||
Putting together gives:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int_1^2 x \log(x) dx
|
||||
&= (\log(x) \cdot \frac{x^2}{2}) \big|_1^2 - \int_1^2 \frac{x^2}{2} \frac{1}{x} dx\\
|
||||
@ -136,7 +136,7 @@ $$
|
||||
&= 2\log(2) - (1 - \frac{1}{4}) \\
|
||||
&= 2\log(2) - \frac{3}{4}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
##### Example
|
||||
|
||||
@ -144,14 +144,14 @@ $$
|
||||
This related problem, $\int \log(x) dx$, uses the same idea, though perhaps harder to see at first glance, as setting `dv=dx` is almost too simple to try:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
u &= \log(x) & dv &= dx\\
|
||||
du &= \frac{1}{x}dx & v &= x
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
$$
|
||||
|
||||
|
||||
\begin{align*}
|
||||
\int \log(x) dx
|
||||
&= \int u dv\\
|
||||
@ -160,7 +160,7 @@ $$
|
||||
&= x \log(x) - \int dx\\
|
||||
&= x \log(x) - x
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Were this a definite integral problem, we would have written:
|
||||
|
||||
@ -243,14 +243,14 @@ $$
|
||||
Positive integer powers of trigonometric functions can be addressed by this technique. Consider $\int \cos(x)^n dx$. We let $u=\cos(x)^{n-1}$ and $dv=\cos(x) dx$. Then $du = (n-1)\cos(x)^{n-2}(-\sin(x))dx$ and $v=\sin(x)$. So,
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int \cos(x)^n dx &= \cos(x)^{n-1} \cdot (\sin(x)) - \int (\sin(x)) ((n-1)\sin(x) \cos(x)^{n-2}) dx \\
|
||||
&= \sin(x) \cos(x)^{n-1} + (n-1)\int \sin^2(x) \cos(x)^{n-1} dx\\
|
||||
&= \sin(x) \cos(x)^{n-1} + (n-1)\int (1 - \cos(x)^2) \cos(x)^{n-2} dx\\
|
||||
&= \sin(x) \cos(x)^{n-1} + (n-1)\int \cos(x)^{n-2}dx - (n-1)\int \cos(x)^n dx.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
We can then solve for the unknown ($\int \cos(x)^{n}dx$) to get this *reduction formula*:
|
||||
|
||||
@ -278,13 +278,13 @@ The visual interpretation of integration by parts breaks area into two pieces, t
|
||||
Let $uv = x f^{-1}(x)$. Then we have $[uv]' = u'v + uv' = f^{-1}(x) + x [f^{-1}(x)]'$. So, up to a constant $uv = \int [uv]'dx = \int f^{-1}(x) + \int x [f^{-1}(x)]'$. Re-expressing gives:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int f^{-1}(x) dx
|
||||
&= xf^{-1}(x) - \int x [f^{-1}(x)]' dx\\
|
||||
&= xf^{-1}(x) - \int f(u) du.\\
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The last line follows from the $u$-substitution: $u=f^{-1}(x)$ for then $du = [f^{-1}(x)]' dx$ and $x=f(u)$.
|
||||
|
||||
@ -292,13 +292,13 @@ The last line follows from the $u$-substitution: $u=f^{-1}(x)$ for then $du = [f
|
||||
We use this to find an antiderivative for $\sin^{-1}(x)$:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int \sin^{-1}(x) dx &= x \sin^{-1}(x) - \int \sin(u) du \\
|
||||
&= x \sin^{-1}(x) + \cos(u) \\
|
||||
&= x \sin^{-1}(x) + \cos(\sin^{-1}(x)).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Using right triangles to simplify, the last value $\cos(\sin^{-1}(x))$ can otherwise be written as $\sqrt{1 - x^2}$.
|
||||
|
||||
@ -321,12 +321,12 @@ This [proof](http://www.math.ucsd.edu/~ebender/20B/77_Trap.pdf) for the error es
|
||||
First, for convenience, we consider the interval $x_i$ to $x_i+h$. The actual answer over this is just $\int_{x_i}^{x_i+h}f(x) dx$. By a $u$-substitution with $u=x-x_i$ this becomes $\int_0^h f(t + x_i) dt$. For analyzing this we integrate once by parts using $u=f(t+x_i)$ and $dv=dt$. But instead of letting $v=t$, we choose to add - as is our prerogative - a constant of integration $A$, so $v=t+A$:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int_0^h f(t + x_i) dt &= uv \big|_0^h - \int_0^h v du\\
|
||||
&= f(t+x_i)(t+A)\big|_0^h - \int_0^h (t + A) f'(t + x_i) dt.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
We choose $A$ to be $-h/2$, any constant is possible, for then the term $f(t+x_i)(t+A)\big|_0^h$ becomes $(1/2)(f(x_i+h) + f(x_i)) \cdot h$, or the trapezoid approximation. This means, the error over this interval - actual minus estimate - satisfies:
|
||||
|
||||
@ -338,12 +338,12 @@ $$
|
||||
For this, we *again* integrate by parts with
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
u &= f'(t + x_i) & dv &= (t + A)dt\\
|
||||
du &= f''(t + x_i) & v &= \frac{(t + A)^2}{2} + B
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Again we added a constant of integration, $B$, to $v$. The error becomes:
|
||||
|
||||
@ -417,14 +417,14 @@ We added a rectangle for a Riemann sum for $t_i = \pi/3$ and $t_{i+1} = \pi/3 +
|
||||
Taking this Riemann sum approach, we can approximate the area under the curve parameterized by $(u(t), v(t))$ over the time range $[t_i, t_{i+1}]$ as a rectangle with height $y(t_i)$ and base $x(t_{i}) - x(t_{i+1})$. Then we get, as expected:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
A &\approx \sum_i y(t_i) \cdot (x(t_{i}) - x(t_{i+1}))\\
|
||||
&= - \sum_i y(t_i) \cdot (x(t_{i+1}) - x(t_{i}))\\
|
||||
&= - \sum_i y(t_i) \cdot \frac{x(t_{i+1}) - x(t_i)}{t_{i+1}-t_i} \cdot (t_{i+1}-t_i)\\
|
||||
&\approx -\int_a^b y(t) x'(t) dt.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
So with a counterclockwise rotation, the actual answer for the area includes a minus sign. If the area is traced out in a *clockwise* manner, there is no minus sign.
|
||||
|
||||
|
@ -88,14 +88,14 @@ Though not continuous, $f(x)$ is integrable as it contains only jumps. The integ
|
||||
What is the average value of the function $e^{-x}$ between $0$ and $\log(2)$?
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\text{average} = \frac{1}{\log(2) - 0} \int_0^{\log(2)} e^{-x} dx\\
|
||||
&= \frac{1}{\log(2)} (-e^{-x}) \big|_0^{\log(2)}\\
|
||||
&= -\frac{1}{\log(2)} (\frac{1}{2} - 1)\\
|
||||
&= \frac{1}{2\log(2)}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Visualizing, we have
|
||||
|
||||
|
@ -109,7 +109,7 @@ What remains is to establish that we can take $A(x) = a(x)\cdot P(x)$ with a deg
|
||||
In Proposition 3.8 of [Bradley](http://www.m-hikari.com/imf/imf-2012/29-32-2012/cookIMF29-32-2012.pdf) and Cook we can see how. Recall the division algorithm, for example, says there are $q_k$ and $r_k$ with $A=q\cdot q_k + r_k$ where the degree of $r_k$ is less than that of $q$, which is linear or quadratic. This is repeatedly applied below:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\frac{A}{q^k} &= \frac{q\cdot q_k + r_k}{q^k}\\
|
||||
&= \frac{r_k}{q^k} + \frac{q_k}{q^{k-1}}\\
|
||||
@ -119,7 +119,7 @@ $$
|
||||
&= \cdots\\
|
||||
&= \frac{r_k}{q^k} + \frac{r_{k-1}}{q^{k-1}} + \cdots + q_1.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
So the term $A(x)/q(x)^k$ can be expressed in terms of a sum where the numerators or each term have degree less than $q(x)$, as expected by the statement of the theorem.
|
||||
|
||||
@ -208,14 +208,14 @@ integrate(B/((a*x)^2 - 1)^4, x)
|
||||
In [Bronstein](http://www-sop.inria.fr/cafe/Manuel.Bronstein/publications/issac98.pdf) this characterization can be found - "This method, which dates back to Newton, Leibniz and Bernoulli, should not be used in practice, yet it remains the method found in most calculus texts and is often taught. Its major drawback is the factorization of the denominator of the integrand over the real or complex numbers." We can also find the following formulas which formalize the above exploratory calculations ($j>1$ and $b^2 - 4c < 0$ below):
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int \frac{A}{(x-a)^j} &= \frac{A}{1-j}\frac{1}{(x-a)^{1-j}}\\
|
||||
\int \frac{A}{x-a} &= A\log(x-a)\\
|
||||
\int \frac{Bx+C}{x^2 + bx + c} &= \frac{B}{2} \log(x^2 + bx + c) + \frac{2C-bB}{\sqrt{4c-b^2}}\cdot \arctan\left(\frac{2x+b}{\sqrt{4c-b^2}}\right)\\
|
||||
\int \frac{Bx+C}{(x^2 + bx + c)^j} &= \frac{B' x + C'}{(x^2 + bx + c)^{j-1}} + \int \frac{C''}{(x^2 + bx + c)^{j-1}}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The first returns a rational function; the second yields a logarithm term; the third yields a logarithm and an arctangent term; while the last, which has explicit constants available, provides a reduction that can be recursively applied;
|
||||
|
||||
@ -482,12 +482,12 @@ How to see that these give rise to real answers on integration is the point of t
|
||||
Breaking the terms up over $a$ and $b$ we have:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
I &= \frac{a}{x - (\alpha + i \beta)} + \frac{a}{x - (\alpha - i \beta)} \\
|
||||
II &= i\frac{b}{x - (\alpha + i \beta)} - i\frac{b}{x - (\alpha - i \beta)}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Integrating $I$ leads to two logarithmic terms, which are combined to give:
|
||||
|
||||
|
@ -40,14 +40,14 @@ $$
|
||||
So,
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int_a^b g(u(t)) \cdot u'(t) dt &= \int_a^b (G \circ u)'(t) dt\\
|
||||
&= (G\circ u)(b) - (G\circ u)(a) \quad\text{(the FTC, part II)}\\
|
||||
&= G(u(b)) - G(u(a)) \\
|
||||
&= \int_{u(a)}^{u(b)} g(x) dx. \quad\text{(the FTC part II)}
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
That is, this substitution formula applies:
|
||||
|
||||
@ -173,21 +173,22 @@ $$
|
||||
So the answer is: the area under the transformed function over $a$ to $b$ is the area of the function over the transformed region.
|
||||
|
||||
|
||||
For example, consider the "hat" function $f(x) = 1 - \lvert x \rvert $ when $-1 \leq x \leq 1$ and $0$ otherwise. The area under $f$ is just $1$ - the graph forms a triangle with base of length $2$ and height $1$. If we take any values of $c$ and $h$, what do we find for the area under the curve of the transformed function?
|
||||
For example, consider the "hat" function $f(x) = 1 - \lvert x \rvert$
|
||||
when $-1 \leq x \leq 1$ and $0$ otherwise. The area under $f$ is just $1$ - the graph forms a triangle with base of length $2$ and height $1$. If we take any values of $c$ and $h$, what do we find for the area under the curve of the transformed function?
|
||||
|
||||
|
||||
Let $u(x) = (x-c)/h$ and $g(x) = h f(u(x))$. Then, as $du = 1/h dx$
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\int_{c-h}^{c+h} g(x) dx
|
||||
&= \int_{c-h}^{c+h} h f(u(x)) dx\\
|
||||
&= \int_{u(c-h)}^{u(c+h)} f(u) du\\
|
||||
&= \int_{-1}^1 f(u) du\\
|
||||
&= 1.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
So the area of this transformed function is still $1$. The shifting by $c$ we know doesn't effect the area, the scaling by $h$ inside of $f$ does, but is balanced out by the multiplication by $h$ outside of $f$.
|
||||
|
||||
@ -246,14 +247,14 @@ $$
|
||||
But $u^3/3 - 4u/3 = (1/3) \cdot u(u-1)(u+2)$, so between $-2$ and $0$ it is positive and between $0$ and $1$ negative, so this integral is:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int_{-2}^0 (u^3/3 - 4u/3 ) du + \int_{0}^1 -(u^3/3 - 4u/3) du
|
||||
&= (\frac{u^4}{12} - \frac{4}{3}\frac{u^2}{2}) \big|_{-2}^0 - (\frac{u^4}{12} - \frac{4}{3}\frac{u^2}{2}) \big|_{0}^1\\
|
||||
&= \frac{4}{3} - -\frac{7}{12}\\
|
||||
&= \frac{23}{12}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
##### Example
|
||||
|
||||
@ -268,14 +269,14 @@ $$
|
||||
Integrals involving this function are typically transformed by substitution. For example:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int_a^b f(x; \mu, \sigma) dx
|
||||
&= \int_a^b \frac{1}{\sqrt{2\pi}}\frac{1}{\sigma} \exp(-\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2) dx \\
|
||||
&= \int_{u(a)}^{u(b)} \frac{1}{\sqrt{2\pi}} \exp(-\frac{1}{2}u^2) du \\
|
||||
&= \int_{u(a)}^{u(b)} f(u; 0, 1) du,
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
where $u = (x-\mu)/\sigma$, so $du = (1/\sigma) dx$.
|
||||
|
||||
@ -293,13 +294,13 @@ $$
|
||||
A further change of variables by $t = u/\sqrt{2}$ (with $\sqrt{2}dt = du$) gives:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int_a^b f(x; \mu, \sigma) dx &=
|
||||
\int_{t(u(a))}^{t(u(b))} \frac{\sqrt{2}}{\sqrt{2\pi}} \exp(-t^2) dt\\
|
||||
&= \frac{1}{2} \int_{t(u(a))}^{t(u(b))} \frac{2}{\sqrt{\pi}} \exp(-t^2) dt
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Up to a factor of $1/2$ this is `erf`.
|
||||
|
||||
@ -307,14 +308,14 @@ Up to a factor of $1/2$ this is `erf`.
|
||||
So we would have, for example, with $\mu=1$,$\sigma=2$ and $a=1$ and $b=3$ that:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
t(u(a)) &= (1 - 1)/2/\sqrt{2} = 0\\
|
||||
t(u(b)) &= (3 - 1)/2/\sqrt{2} = \frac{1}{\sqrt{2}}\\
|
||||
\int_1^3 f(x; 1, 2)
|
||||
&= \frac{1}{2} \int_0^{1/\sqrt{2}} \frac{2}{\sqrt{\pi}} \exp(-t^2) dt.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Or
|
||||
|
||||
@ -486,7 +487,7 @@ integrate(1 / (a^2 + (b*x)^2), x)
|
||||
The expression $1-x^2$ can be attacked by the substitution $\sin(u) =x$ as then $1-x^2 = 1-\cos(u)^2 = \sin(u)^2$. Here we see this substitution being used successfully:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int \frac{1}{\sqrt{9 - x^2}} dx &= \int \frac{1}{\sqrt{9 - (3\sin(u))^2}} \cdot 3\cos(u) du\\
|
||||
&=\int \frac{1}{3\sqrt{1 - \sin(u)^2}}\cdot3\cos(u) du \\
|
||||
@ -494,7 +495,7 @@ $$
|
||||
&= u \\
|
||||
&= \sin^{-1}(x/3).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Further substitution allows the following integral to be solved for an antiderivative:
|
||||
|
||||
@ -511,24 +512,24 @@ integrate(1 / sqrt(a^2 - b^2*x^2), x)
|
||||
The expression $x^2 - 1$ is a bit different, this lends itself to $\sec(u) = x$ for a substitution, for $\sec(u)^2 - 1 = \tan(u)^2$. For example, we try $\sec(u) = x$ to integrate:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int \frac{1}{\sqrt{x^2 - 1}} dx &= \int \frac{1}{\sqrt{\sec(u)^2 - 1}} \cdot \sec(u)\tan(u) du\\
|
||||
&=\int \frac{1}{\tan(u)}\sec(u)\tan(u) du\\
|
||||
&= \int \sec(u) du.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
This doesn't seem that helpful, but the antiderivative to $\sec(u)$ is $\log\lvert (\sec(u) + \tan(u))\rvert$, so we can proceed to get:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int \frac{1}{\sqrt{x^2 - 1}} dx &= \int \sec(u) du\\
|
||||
&= \log\lvert (\sec(u) + \tan(u))\rvert\\
|
||||
&= \log\lvert x + \sqrt{x^2-1} \rvert.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
SymPy gives a different representation using the arccosine:
|
||||
|
||||
@ -564,14 +565,14 @@ $$
|
||||
The identify $\cos(u)^2 = (1 + \cos(2u))/2$ makes this tractable:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
4ab \int \cos(u)^2 du
|
||||
&= 4ab\int_0^{\pi/2}(\frac{1}{2} + \frac{\cos(2u)}{2}) du\\
|
||||
&= 4ab(\frac{1}{2}u + \frac{\sin(2u)}{4})\big|_0^{\pi/2}\\
|
||||
&= 4ab (\pi/4 + 0) = \pi ab.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Keeping in mind that that a circle with radius $a$ is an ellipse with $b=a$, we see that this gives the correct answer for a circle.
|
||||
|
||||
|
@ -34,9 +34,19 @@ revolution, there is an easier way. (Photo credit to
|
||||
[firepanjewellery](http://firepanjewellery.com/).)
|
||||
"""
|
||||
|
||||
ImageFile(:integrals, imgfile, caption)
|
||||
# ImageFile(:integrals, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||
.)
|
||||
](./figures/gehry-hendrix.jpg)
|
||||
|
||||
> The surface area generated by rotating the graph of $f(x)$ between $a$ and $b$ about the $x$-axis is given by the integral
|
||||
>
|
||||
> $$
|
||||
@ -110,7 +120,6 @@ If we assume integrability of the integrand, then as our partition size goes to
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
#| cache: true
|
||||
## {{{approximate_surface_area}}}
|
||||
|
||||
xs,ys = range(-1, stop=1, length=50), range(-1, stop=1, length=50)
|
||||
@ -154,7 +163,7 @@ Lets see that the surface area of an open cone follows from this formula, even t
|
||||
A cone be be envisioned as rotating the function $f(x) = x\tan(\theta)$ between $0$ and $h$ around the $x$ axis. This integral yields the surface area:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int_0^h 2\pi f(x) \sqrt{1 + f'(x)^2}dx
|
||||
&= \int_0^h 2\pi x \tan(\theta) \sqrt{1 + \tan(\theta)^2}dx \\
|
||||
@ -162,7 +171,7 @@ $$
|
||||
&= \pi \tan(\theta) \sec(\theta) h^2 \\
|
||||
&= \pi r^2 / \sin(\theta).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
(There are many ways to express this, we used $r$ and $\theta$ to match the work above. If the cone is parameterized by a height $h$ and radius $r$, then the surface area of the sides is $\pi r\sqrt{h^2 + r^2}$. If the base is included, there is an additional $\pi r^2$ term.)
|
||||
|
||||
@ -350,14 +359,14 @@ plot(g, f, 0, 1pi)
|
||||
The integrand simplifies to $8\sqrt{2}\pi \sin(t) (1 + \cos(t))^{3/2}$. This lends itself to $u$-substitution with $u=\cos(t)$.
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\int_0^\pi 8\sqrt{2}\pi \sin(t) (1 + \cos(t))^{3/2}
|
||||
&= 8\sqrt{2}\pi \int_1^{-1} (1 + u)^{3/2} (-1) du\\
|
||||
&= 8\sqrt{2}\pi (2/5) (1+u)^{5/2} \big|_{-1}^1\\
|
||||
&= 8\sqrt{2}\pi (2/5) 2^{5/2} = \frac{2^7 \pi}{5}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
## The first Theorem of Pappus
|
||||
|
||||
@ -406,12 +415,12 @@ surface(ws..., legend=false, zlims=(-12,12))
|
||||
The surface area of sphere will be SA$=2\pi \rho (\pi r) = 2 \pi^2 r \cdot \rho$. What is $\rho$? The centroid of an arc formula can be derived in a manner similar to that of the centroid of a region. The formulas are:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\text{cm}_x &= \frac{1}{L} \int_a^b g(t) \sqrt{g'(t)^2 + f'(t)^2} dt\\
|
||||
\text{cm}_y &= \frac{1}{L} \int_a^b f(t) \sqrt{g'(t)^2 + f'(t)^2} dt.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
Here, $L$ is the arc length of the curve.
|
||||
|
||||
|
@ -34,9 +34,12 @@ caption = """
|
||||
Hey Michelin Man, how much does that costume weigh?
|
||||
|
||||
"""
|
||||
ImageFile(:integrals, imgfile, caption)
|
||||
# ImageFile(:integrals, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
An ad for a summer job says work as the Michelin Man! Sounds promising, but how much will that costume weigh? A very hot summer may make walking around in a heavy costume quite uncomfortable.
|
||||
|
||||
|
||||
@ -96,9 +99,15 @@ curve about the $x$ axis. The radius of revolution varies as a function of $x$
|
||||
between about $0$ and $6.2$cm.
|
||||
|
||||
"""
|
||||
ImageFile(:integrals, imgfile, caption)
|
||||
#ImageFile(:integrals, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
If $r(x)$ is the radius as a function of $x$, then the cross sectional area is $\pi r(x)^2$ so the volume is given by:
|
||||
|
||||
|
||||
@ -166,9 +175,12 @@ Before Solo "squared" the cup, the Solo cup had markings that - [some thought](h
|
||||
#| echo: false
|
||||
imgfile = "figures/red-solo-cup.jpg"
|
||||
caption = "Markings on the red Solo cup indicated various volumes"
|
||||
ImageFile(:integrals, imgfile, caption)
|
||||
# ImageFile(:integrals, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
What is the height for $5$ ounces (for a glass of wine)? $12$ ounces (for a beer unit)?
|
||||
|
||||
|
||||
@ -515,9 +527,12 @@ Consider this big Solo cup:
|
||||
#| echo: false
|
||||
imgfile ="figures/big-solo-cup.jpg"
|
||||
caption = " Big solo cup. "
|
||||
ImageFile(:integrals, imgfile, caption)
|
||||
# ImageFile(:integrals, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
It has approximate dimensions: smaller radius 5 feet, upper radius 8 feet and height 15 feet. How many gallons is it? At $8$ pounds a gallon this would be pretty heavy!
|
||||
|
||||
|
||||
@ -552,9 +567,12 @@ This figure shows some of the wide variety of beer-serving glasses:
|
||||
#| echo: false
|
||||
imgfile ="figures/beer_glasses.jpg"
|
||||
caption = "A variety of different serving glasses for beer."
|
||||
ImageFile(:integrals, imgfile, caption)
|
||||
#ImageFile(:integrals, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
We work with metric units, as there is a natural relation between volume in cm$^3$ and liquid measure ($1$ liter = $1000$ cm$^3$, so a $16$-oz pint glass is roughly $450$ cm$^3$.)
|
||||
|
||||
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
@ -672,9 +672,13 @@ caption = """
|
||||
Elevation profile of the Hardrock 100 ultramarathon. Treating the elevation profile as a function, the absolute maximum is just about 14,000 feet and the absolute minimum about 7600 feet. These are of interest to the runner for different reasons. Also of interest would be each local maxima and local minima - the peaks and valleys of the graph - and the total elevation climbed - the latter so important/unforgettable its value makes it into the chart's title.
|
||||
"""
|
||||
|
||||
ImageFile(:limits, imgfile, caption)
|
||||
# ImageFile(:limits, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||
[](https://hardrock100.com)
|
||||
|
||||
The extreme value theorem discusses an assumption that ensures absolute maximum and absolute minimum values exist.
|
||||
|
||||
|
||||
@ -885,9 +889,13 @@ figure= "figures/cannonball.jpg"
|
||||
caption = """
|
||||
Trajectories of potential cannonball fires with air-resistance included. (http://ej.iop.org/images/0143-0807/33/1/149/Full/ejp405251f1_online.jpg)
|
||||
"""
|
||||
ImageFile(:limits, figure, caption)
|
||||
# ImageFile(:limits, figure, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
In 1638, according to Amir D. [Aczel](http://books.google.com/books?id=kvGt2OlUnQ4C&pg=PA28&lpg=PA28&dq=mersenne+cannon+ball+tests&source=bl&ots=wEUd7e0jFk&sig=LpFuPoUvODzJdaoug4CJsIGZZHw&hl=en&sa=X&ei=KUGcU6OAKJCfyASnioCoBA&ved=0CCEQ6AEwAA#v=onepage&q=mersenne%20cannon%20ball%20tests&f=false), an experiment was performed in the French Countryside. A monk, Marin Mersenne, launched a cannonball straight up into the air in an attempt to help Descartes prove facts about the rotation of the earth. Though the experiment was not successful, Mersenne later observed that the time for the cannonball to go up was greater than the time to come down. ["Vertical Projection in a Resisting Medium: Reflections on Observations of Mersenne".](http://www.maa.org/publications/periodicals/american-mathematical-monthly/american-mathematical-monthly-contents-junejuly-2014)
|
||||
|
||||
|
||||
|
@ -262,14 +262,14 @@ xs = [1/10^i for i in 1:5]
|
||||
This progression can be seen to be increasing. Cauchy, in his treatise, can see this through:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
(1 + \frac{1}{m})^n &= 1 + \frac{1}{1} + \frac{1}{1\cdot 2}(1 = \frac{1}{m}) + \\
|
||||
& \frac{1}{1\cdot 2\cdot 3}(1 - \frac{1}{m})(1 - \frac{2}{m}) + \cdots \\
|
||||
&+
|
||||
\frac{1}{1 \cdot 2 \cdot \cdots \cdot m}(1 - \frac{1}{m}) \cdot \cdots \cdot (1 - \frac{m-1}{m}).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
These values are clearly increasing as $m$ increases. Cauchy showed the value was bounded between $2$ and $3$ and had the approximate value above. Then he showed the restriction to integers was not necessary. Later we will use this definition for the exponential function:
|
||||
|
||||
@ -836,7 +836,7 @@ This accurately shows the limit does not exist mathematically, but `limit(ceil(x
|
||||
The `limit` function doesn't compute limits from the definition, rather it applies some known facts about functions within a set of rules. Some of these rules are the following. Suppose the individual limits of $f$ and $g$ always exist (and are finite) below.
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\lim_{x \rightarrow c} (a \cdot f(x) + b \cdot g(x)) &= a \cdot
|
||||
\lim_{x \rightarrow c} f(x) + b \cdot \lim_{x \rightarrow c} g(x)
|
||||
@ -850,7 +850,7 @@ $$
|
||||
\frac{\lim_{x \rightarrow c} f(x)}{\lim_{x \rightarrow c} g(x)}
|
||||
&(\text{provided }\lim_{x \rightarrow c} g(x) \neq 0)\\
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
These are verbally described as follows, when the individual limits exist and are finite then:
|
||||
|
||||
|
@ -20,9 +20,13 @@ The following image is the calculator that Google presents upon searching for "c
|
||||
#
|
||||
imgfile = "figures/calculator.png"
|
||||
caption = "Screenshot of a calculator provided by the Google search engine."
|
||||
ImageFile(:precalc, imgfile, caption)
|
||||
# ImageFile(:precalc, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
This calculator should have a familiar appearance with a keypad of numbers, a set of buttons for arithmetic operations, a set of buttons for some common mathematical functions, a degree/radian switch, and buttons for interacting with the calculator: `Ans`, `AC` (also `CE`), and `=`.
|
||||
|
||||
|
||||
@ -43,7 +47,7 @@ txt = """
|
||||
</iframe>
|
||||
</center>
|
||||
"""
|
||||
HTMLoutput(txt)
|
||||
a = HTMLoutput(txt)
|
||||
```
|
||||
|
||||
## Operations
|
||||
@ -204,6 +208,16 @@ Below we use the underscore as a separator, which is parsed as commas are to sep
|
||||
|
||||
Or not quite a million per pound.
|
||||
|
||||
Using a pound is $2.2$ killograms or $2,200$ grams, we can this many ants per gram:
|
||||
|
||||
|
||||
```{julia}
|
||||
20_000_000_000_000_000 / (1_000_000 * 12 * 2000) / 2200
|
||||
```
|
||||
|
||||
Such combinations will be easier to check for correctness when variable names are assigned the respective values.
|
||||
|
||||
|
||||
|
||||
## Order of operations
|
||||
|
||||
@ -816,7 +830,7 @@ radioq(choices, answ)
|
||||
###### Question
|
||||
|
||||
|
||||
In the U.S. version of the Office, the opening credits include a calculator calculation. The key sequence shown is `9653 +` which produces `11532`. What value was added to?
|
||||
In the U.S. version of the Office, the opening credits include a calculator calculation. The key sequence shown is `9653 +` which produces `11532`. What value was added to `9653`?
|
||||
|
||||
|
||||
```{julia}
|
||||
@ -1040,7 +1054,7 @@ radioq(choices, answ)
|
||||
A twitter post from popular mechanics generated some attention.
|
||||
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
What is the answer?
|
||||
|
@ -27,7 +27,7 @@ The family of exponential functions is defined by $f(x) = a^x, -\infty< x < \inf
|
||||
For a given $a$, defining $a^n$ for positive integers is straightforward, as it means multiplying $n$ copies of $a.$ From this, for *integer powers*, the key properties of exponents: $a^x \cdot a^y = a^{x+y}$, and $(a^x)^y = a^{x \cdot y}$ are immediate consequences. For example with $x=3$ and $y=2$:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
a^3 \cdot a^2 &= (a\cdot a \cdot a) \cdot (a \cdot a) \\
|
||||
&= (a \cdot a \cdot a \cdot a \cdot a) \\
|
||||
@ -36,7 +36,7 @@ a^3 \cdot a^2 &= (a\cdot a \cdot a) \cdot (a \cdot a) \\
|
||||
&= (a\cdot a \cdot a \cdot a\cdot a \cdot a) \\
|
||||
&= a^6 = a^{3\cdot 2}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
For $a \neq 0$, $a^0$ is defined to be $1$.
|
||||
|
||||
@ -388,13 +388,13 @@ In short, we have these three properties of logarithmic functions:
|
||||
If $a, b$ are positive bases; $u,v$ are positive numbers; and $x$ is any real number then:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\log_a(uv) &= \log_a(u) + \log_a(v), \\
|
||||
\log_a(u^x) &= x \log_a(u), \text{ and} \\
|
||||
\log_a(u) &= \log_b(u)/\log_b(a).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
##### Example
|
||||
|
||||
|
@ -69,13 +69,13 @@ However, typically we have a rule describing our function. What is the process t
|
||||
When we solve algebraically for $x$ in $y=9/5 \cdot x + 32$ we do the same thing as we do verbally: we subtract $32$ from each side, and then divide by $9/5$ to isolate $x$:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
y &= 9/5 \cdot x + 32\\
|
||||
y - 32 &= 9/5 \cdot x\\
|
||||
(y-32) / (9/5) &= x.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
From this, we have the function $g(y) = (y-32) / (9/5)$ is the inverse function of $f(x) = 9/5\cdot x + 32$.
|
||||
|
||||
@ -101,7 +101,7 @@ Suppose a transformation of $x$ is given by $y = f(x) = (ax + b)/(cx+d)$. This f
|
||||
From the expression $y=f(x)$ we *algebraically* solve for $x$:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
y &= \frac{ax +b}{cx+d}\\
|
||||
y \cdot (cx + d) &= ax + b\\
|
||||
@ -109,7 +109,7 @@ ycx - ax &= b - yd\\
|
||||
(cy-a) \cdot x &= b - dy\\
|
||||
x &= -\frac{dy - b}{cy-a}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
We see that to solve for $x$ we need to divide by $cy-a$, so this expression can not be zero. So, using $x$ as the dummy variable, we have
|
||||
|
||||
@ -127,14 +127,14 @@ The function $f(x) = (x-1)^5 + 2$ is strictly increasing and so will have an inv
|
||||
Again, we solve algebraically starting with $y=(x-1)^5 + 2$ and solving for $x$:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
y &= (x-1)^5 + 2\\
|
||||
y - 2 &= (x-1)^5\\
|
||||
(y-2)^{1/5} &= x - 1\\
|
||||
(y-2)^{1/5} + 1 &= x.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
We see that $f^{-1}(x) = 1 + (x - 2)^{1/5}$. The fact that the power $5$ is an odd power is important, as this ensures a unique (real) solution to the fifth root of a value, in the above $y-2$.
|
||||
|
||||
@ -170,14 +170,14 @@ The [inverse function theorem](https://en.wikipedia.org/wiki/Inverse_function_th
|
||||
Consider the function $f(x) = (1+x^2)^{-1}$. This bell-shaped function is even (symmetric about $0$), so can not possibly be one-to-one. However, if the domain is restricted to $[0,\infty)$ it is. The restricted function is strictly decreasing and its inverse is found, as follows:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
y &= \frac{1}{1 + x^2}\\
|
||||
1+x^2 &= \frac{1}{y}\\
|
||||
x^2 &= \frac{1}{y} - 1\\
|
||||
x &= \sqrt{(1-y)/y}, \quad 0 \leq y \leq 1.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Then $f^{-1}(x) = \sqrt{(1-x)/x}$ where $0 < x \leq 1$. The somewhat complicated restriction for the the domain coincides with the range of $f(x)$. We shall see next that this is no coincidence.
|
||||
|
||||
|
@ -122,7 +122,11 @@ Thinking in terms of transformations, this looks like the function $f(x) = x$ (w
|
||||
The indeterminate value `x` (or some other symbol) in a polynomial, is like a variable in a function and unlike a variable in `Julia`. Variables in `Julia` are identifiers, just a means to look up a specific, already determined, value. Rather, the symbol `x` is not yet determined, it is essentially a place holder for a future value. Although we have seen that `Julia` makes it very easy to work with mathematical functions, it is not the case that base `Julia` makes working with expressions of algebraic symbols easy. This makes sense, `Julia` is primarily designed for technical computing, where numeric approaches rule the day. However, symbolic math can be used from within `Julia` through add-on packages.
|
||||
|
||||
|
||||
Symbolic math programs include well-known ones like the commercial programs Mathematica and Maple. Mathematica powers the popular [WolframAlpha](www.wolframalpha.com) website, which turns "natural" language into the specifics of a programming language. The open-source Sage project is an alternative to these two commercial giants. It includes a wide-range of open-source math projects available within its umbrella framework. (`Julia` can even be run from within the free service [cloud.sagemath.com](https://cloud.sagemath.com/projects).) A more focused project for symbolic math, is the [SymPy](www.sympy.org) Python library. SymPy is also used within Sage. However, SymPy provides a self-contained library that can be used standalone within a Python session. That is great for `Julia` users, as the `PyCall` and `PythonCall` packages glue `Julia` to Python in a seamless manner. This allows the `Julia` package `SymPy` to provide functionality from SymPy within `Julia`.
|
||||
Symbolic math programs include well-known ones like the commercial programs Mathematica and Maple. Mathematica powers the popular [WolframAlpha](www.wolframalpha.com) website, which turns "natural" language into the specifics of a programming language. The open-source [Sage](https://www.sagemath.org/) project is an alternative to these two commercial giants. It includes a wide-range of open-source math projects available within its umbrella framework. (`Julia` can even be run from within the free service [cloud.sagemath.com](https://cloud.sagemath.com/projects).) A more focused project for symbolic math, is the [SymPy](www.sympy.org) Python library. SymPy is also used within Sage. However, SymPy provides a self-contained library that can be used standalone within a Python session.
|
||||
|
||||
The [Symbolics](https://github.com/JuliaSymbolics/Symbolics.jl) package for `Julia` provides a "fast and modern CAS for fast and modern language." It is described further in [Symbolics.jl](../alternatives/symbolics.qmd).
|
||||
|
||||
As `SymPy` has some features not yet implemented in `Symbolics`, we use that her. The `PyCall` and `PythonCall` packages are available to glue `Julia` to Python in a seamless manner. These allow the `Julia` package `SymPy` to provide functionality from SymPy within `Julia`.
|
||||
|
||||
|
||||
:::{.callout-note}
|
||||
|
@ -249,13 +249,13 @@ A line, $y=mx+b$ can be a linear polynomial or a constant depending on $m$, so w
|
||||
Knowing we can succeed, we approach the problem of $3$ points, say $(x_0, y_0)$, $(x_1,y_1)$, and $(x_2, y_2)$. There is a polynomial $p = a\cdot x^2 + b\cdot x + c$ with $p(x_i) = y_i$. This gives $3$ equations for the $3$ unknown values $a$, $b$, and $c$:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
a\cdot x_0^2 + b\cdot x_0 + c &= y_0\\
|
||||
a\cdot x_1^2 + b\cdot x_1 + c &= y_1\\
|
||||
a\cdot x_2^2 + b\cdot x_2 + c &= y_2\\
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Solving this with `SymPy` is tractable. A comprehension is used below to create the $3$ equations; the `zip` function is a simple means to iterate over $2$ or more iterables simultaneously:
|
||||
|
||||
@ -388,13 +388,13 @@ radioq(choices, answ, keep_order=true)
|
||||
Consider the polynomial $p(x) = a_1 x - a_3 x^3 + a_5 x^5$ where
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
a_1 &= 4(\frac{3}{\pi} - \frac{9}{16}) \\
|
||||
a_3 &= 2a_1 -\frac{5}{2}\\
|
||||
a_5 &= a_1 - \frac{3}{2}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
* Form the polynomial `p` by first computing the $a$s and forming `p=Polynomial([0,a1,0,-a3,0,a5])`
|
||||
* Form the polynomial `q` by these commands `x=variable(); q=p(2x/pi)`
|
||||
@ -544,13 +544,13 @@ This last answer is why $p$ is called an *interpolating* polynomial and this que
|
||||
The Chebyshev ($T$) polynomials are polynomials which use a different basis from the standard basis. Denote the basis elements $T_0$, $T_1$, ... where we have $T_0(x) = 1$, $T_1(x) = x$, and for bigger indices $T_{i+1}(x) = 2xT_i(x) - T_{i-1}(x)$. The first others are then:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
T_2(x) &= 2xT_1(x) - T_0(x) = 2x^2 - 1\\
|
||||
T_3(x) &= 2xT_2(x) - T_1(x) = 2x(2x^2-1) - x = 4x^3 - 3x\\
|
||||
T_4(x) &= 2xT_3(x) - T_2(x) = 2x(4x^3-3x) - (2x^2-1) = 8x^4 - 8x^2 + 1
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
With these definitions what is the polynomial associated to the coefficients $[0,1,2,3]$ with this basis?
|
||||
|
||||
|
@ -111,13 +111,13 @@ $$
|
||||
If can be helpful to think of the argument to $f$ as a "box" that gets filled in by $g$:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
g(x) &=e^x - x\\
|
||||
f(\square) &= (\square)^2 + 2(\square) - 1\\
|
||||
f(g(x)) &= (g(x))^2 + 2(g(x)) - 1 = (e^x - x)^2 + 2(e^x - x) - 1.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Here we look at a few compositions:
|
||||
|
||||
|
@ -44,13 +44,13 @@ annotate!([(.75, .25, "θ"), (4.0, 1.25, "opposite"), (2, -.25, "adjacent"), (1.
|
||||
With these, the basic definitions for the primary trigonometric functions are
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} &\quad(\text{the sine function})\\
|
||||
\cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} &\quad(\text{the cosine function})\\
|
||||
\tan(\theta) &= \frac{\text{opposite}}{\text{adjacent}}. &\quad(\text{the tangent function})
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
:::{.callout-note}
|
||||
## Note
|
||||
@ -119,12 +119,12 @@ Julia has the $6$ basic trigonometric functions defined through the functions `s
|
||||
Two right triangles - the one with equal, $\pi/4$, angles; and the one with angles $\pi/6$ and $\pi/3$ can have the ratio of their sides computed from basic geometry. In particular, this leads to the following values, which are usually committed to memory:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\sin(0) &= 0, \quad \sin(\pi/6) = \frac{1}{2}, \quad \sin(\pi/4) = \frac{\sqrt{2}}{2}, \quad\sin(\pi/3) = \frac{\sqrt{3}}{2},\text{ and } \sin(\pi/2) = 1\\
|
||||
\cos(0) &= 1, \quad \cos(\pi/6) = \frac{\sqrt{3}}{2}, \quad \cos(\pi/4) = \frac{\sqrt{2}}{2}, \quad\cos(\pi/3) = \frac{1}{2},\text{ and } \cos(\pi/2) = 0.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Using the circle definition allows these basic values to inform us of values throughout the unit circle.
|
||||
|
||||
@ -362,6 +362,7 @@ As can be seen, even a somewhat simple combination can produce complicated graph
|
||||
txt ="""
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/rrmx2Q3sO1Y" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
"""
|
||||
|
||||
HTMLoutput(txt; centered=true, caption="Julia logo animated")
|
||||
```
|
||||
|
||||
@ -391,21 +392,24 @@ According to [Wikipedia](https://en.wikipedia.org/wiki/Trigonometric_functions#I
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
ImageFile(:precalc, "figures/summary-sum-and-difference-of-two-angles.jpg", "Relations between angles")
|
||||
# ImageFile(:precalc, "figures/summary-sum-and-difference-of-two-angles.jpg", "Relations between angles")
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
To read this, there are three triangles: the bigger (green with pink part) has hypotenuse $1$ (and adjacent and opposite sides that form the hypotenuses of the other two); the next biggest (yellow) hypotenuse $\cos(\beta)$, adjacent side (of angle $\alpha$) $\cos(\beta)\cdot \cos(\alpha)$, and opposite side $\cos(\beta)\cdot\sin(\alpha)$; and the smallest (pink) hypotenuse $\sin(\beta)$, adjacent side (of angle $\alpha$) $\sin(\beta)\cdot \cos(\alpha)$, and opposite side $\sin(\beta)\sin(\alpha)$.
|
||||
|
||||
|
||||
This figure shows the following sum formula for sine and cosine:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\sin(\alpha + \beta) &= \sin(\alpha)\cos(\beta) + \cos(\alpha)\sin(\beta), & (\overline{CE} + \overline{DF})\\
|
||||
\cos(\alpha + \beta) &= \cos(\alpha)\cos(\beta) - \sin(\alpha)\sin(\beta). & (\overline{AC} - \overline{DE})
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
Using the fact that $\sin$ is an odd function and $\cos$ an even function, related formulas for the difference $\alpha - \beta$ can be derived.
|
||||
|
||||
@ -413,12 +417,12 @@ Using the fact that $\sin$ is an odd function and $\cos$ an even function, relat
|
||||
Taking $\alpha = \beta$ we immediately get the "double-angle" formulas:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\sin(2\alpha) &= 2\sin(\alpha)\cos(\alpha)\\
|
||||
\cos(2\alpha) &= \cos(\alpha)^2 - \sin(\alpha)^2.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The latter looks like the Pythagorean identify, but has a minus sign. In fact, the Pythagorean identify is often used to rewrite this, for example $\cos(2\alpha) = 2\cos(\alpha)^2 - 1$ or $1 - 2\sin(\alpha)^2$.
|
||||
|
||||
@ -432,12 +436,12 @@ Applying the above with $\alpha = \beta/2$, we get that $\cos(\beta) = 2\cos(\be
|
||||
Consider the expressions $\cos((n+1)\theta)$ and $\cos((n-1)\theta)$. These can be re-expressed as:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\cos((n+1)\theta) &= \cos(n\theta + \theta) = \cos(n\theta) \cos(\theta) - \sin(n\theta)\sin(\theta), \text{ and}\\
|
||||
\cos((n-1)\theta) &= \cos(n\theta - \theta) = \cos(n\theta) \cos(-\theta) - \sin(n\theta)\sin(-\theta).
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
But $\cos(-\theta) = \cos(\theta)$, whereas $\sin(-\theta) = -\sin(\theta)$. Using this, we add the two formulas above to get:
|
||||
|
||||
@ -663,12 +667,12 @@ end
|
||||
These values are more commonly expressed using the exponential function as:
|
||||
|
||||
|
||||
$$
|
||||
|
||||
\begin{align*}
|
||||
\sinh(x) &= \frac{e^x - e^{-x}}{2}\\
|
||||
\cosh(x) &= \frac{e^x + e^{-x}}{2}.
|
||||
\end{align*}
|
||||
$$
|
||||
|
||||
|
||||
The hyperbolic tangent is then the ratio of $\sinh$ and $\cosh$. As well, three inverse hyperbolic functions can be defined.
|
||||
|
||||
|
@ -18,9 +18,13 @@ nothing
|
||||
#| echo: false
|
||||
imgfile = "figures/calculator.png"
|
||||
caption = "Screenshot of a calculator provided by the Google search engine."
|
||||
ImageFile(:precalc, imgfile, caption)
|
||||
# ImageFile(:precalc, imgfile, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
The Google calculator has a button `Ans` to refer to the answer to the previous evaluation. This is a form of memory. The last answer is stored in a specific place in memory for retrieval when `Ans` is used. In some calculators, more advanced memory features are possible. For some, it is possible to push values onto a stack of values for them to be referred to at a later time. This proves useful for complicated expressions, say, as the expression can be broken into smaller intermediate steps to be computed. These values can then be appropriately combined. This strategy is a good one, though the memory buttons can make its implementation a bit cumbersome.
|
||||
|
||||
|
||||
|
@ -83,13 +83,14 @@ For the motion in the above figure, the object's $x$ and $y$ values change accor
|
||||
It is common to work with *both* formulas at once. Mathematically, when graphing, we naturally pair off two values using Cartesian coordinates (e.g., $(x,y)$). Another means of combining related values is to use a *vector*. The notation for a vector varies, but to distinguish them from a point we will use $\langle x,~ y\rangle$. With this notation, we can use it to represent the position, the velocity, and the acceleration at time $t$ through:
|
||||
|
||||
|
||||
$$
|
||||
\begin{align}
|
||||
|
||||
\begin{align*}
|
||||
\vec{x} &= \langle x_0 + v_{0x}t,~ -(1/2) g t^2 + v_{0y}t + y_0 \rangle,\\
|
||||
\vec{v} &= \langle v_{0x},~ -gt + v_{0y} \rangle, \text{ and }\\
|
||||
\vec{a} &= \langle 0,~ -g \rangle.
|
||||
\end{align}
|
||||
$$
|
||||
\end{align*}
|
||||
|
||||
|
||||
|
||||
Don't spend time thinking about the formulas if they are unfamiliar. The point emphasized here is that we have used the notation $\langle x,~ y \rangle$ to collect the two values into a single object, which we indicate through a label on the variable name. These are vectors, and we shall see they find use far beyond this application.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user