make pdf file generation work
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -2301,7 +2303,7 @@ $$
|
||||
\frac{f(x+\Delta x, y + \Delta y) - f(x, y+\Delta{y}) - f(x+\Delta x,y) + f(x,y)}{\Delta x \Delta y}.
|
||||
$$
|
||||
|
||||
At $(0,0)$ what is $ \frac{\partial \frac{\partial f}{\partial x}}{ \partial y}$?
|
||||
At $(0,0)$ what is $\frac{\partial \frac{\partial f}{\partial x}}{ \partial y}$?
|
||||
|
||||
|
||||
```{julia}
|
||||
@@ -2311,7 +2313,7 @@ answ = -1
|
||||
numericq(answ)
|
||||
```
|
||||
|
||||
At $(0,0)$ what is $ \frac{\partial \frac{\partial f}{\partial y}}{ \partial x}$?
|
||||
At $(0,0)$ what is $\frac{\partial \frac{\partial f}{\partial y}}{ \partial x}$?
|
||||
|
||||
|
||||
```{julia}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user