use quarto, not Pluto to render pages
This commit is contained in:
@@ -62,10 +62,10 @@ nothing
|
||||
|
||||
The gradient of a scalar function $f:R^n \rightarrow R$ is a vector field of partial derivatives. In $R^2$, we have:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla{f} = \langle \frac{\partial{f}}{\partial{x}},
|
||||
\frac{\partial{f}}{\partial{y}} \rangle.
|
||||
~$$
|
||||
```
|
||||
|
||||
It has the interpretation of pointing out the direction of greatest ascent for the surface $z=f(x,y)$.
|
||||
|
||||
@@ -113,15 +113,15 @@ p
|
||||
|
||||
Consider the sides with outward normal $\hat{i}$. The contribution to the surface integral, $\oint_S (F\cdot\hat{N})dS$, could be *approximated* by
|
||||
|
||||
$$~
|
||||
```math
|
||||
\left(F(x + \Delta x, y, z) \cdot \hat{i}\right) \Delta y \Delta z,
|
||||
~$$
|
||||
```
|
||||
|
||||
whereas, the contribution for the face with outward normal $-\hat{i}$ could be approximated by:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\left(F(x, y, z) \cdot (-\hat{i}) \right) \Delta y \Delta z.
|
||||
~$$
|
||||
```
|
||||
|
||||
The functions are being evaluated at a point on the face of the
|
||||
surface. For Riemann integrable functions, any point in a partition
|
||||
@@ -129,11 +129,11 @@ may be chosen, so our choice will not restrict the generality.
|
||||
|
||||
The total contribution of the two would be:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\left(F(x + \Delta x, y, z) \cdot \hat{i}\right) \Delta y \Delta z +
|
||||
\left(F(x, y, z) \cdot (-\hat{i})\right) \Delta y \Delta z =
|
||||
\left(F_x(x + \Delta x, y, z) - F_x(x, y, z)\right) \Delta y \Delta z,
|
||||
~$$
|
||||
```
|
||||
|
||||
as $F \cdot \hat{i} = F_x$.
|
||||
|
||||
@@ -142,11 +142,11 @@ as $F \cdot \hat{i} = F_x$.
|
||||
If this is repeated for the other two pair of matching faces, we get a definition for the *divergence*:
|
||||
|
||||
> The *divergence* of a vector field $F:R^3 \rightarrow R^3$ is given by
|
||||
> $$~
|
||||
> ```math
|
||||
> \text{divergence}(F) =
|
||||
> \lim \frac{1}{\Delta V} \oint_S F\cdot\hat{N} dS =
|
||||
> \frac{\partial{F_x}}{\partial{x}} +\frac{\partial{F_y}}{\partial{y}} +\frac{\partial{F_z}}{\partial{z}}.
|
||||
> ~$$
|
||||
> ```
|
||||
|
||||
The limit expression for the divergence will hold for any smooth closed surface, $S$, converging on $(x,y,z)$, not just box-like ones.
|
||||
|
||||
@@ -155,9 +155,9 @@ The limit expression for the divergence will hold for any smooth closed surface,
|
||||
|
||||
The derivation of the divergence is done for $n=3$, but could also have easily been done for two dimensions ($n=2$) or higher dimensions $n>3$. The formula in general would be: for $F(x_1, x_2, \dots, x_n): R^n \rightarrow R^n$:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\text{divergence}(F) = \sum_{i=1}^n \frac{\partial{F_i}}{\partial{x_i}}.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
----
|
||||
@@ -198,7 +198,7 @@ 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:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align}
|
||||
\left(F(x,y) \cdot \hat{i}\right)\Delta{x} &+
|
||||
\left(F(x+\Delta{x},y) \cdot \hat{j}\right)\Delta{y} +
|
||||
@@ -211,15 +211,15 @@ 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}
|
||||
~$$
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\lim \frac{1}{\Delta{x}\Delta{y}} \oint_C F\cdot d\vec{r} =
|
||||
\frac{\partial{F_y}}{\partial{x}} - \frac{\partial{F_x}}{\partial{y}}.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
The scalar function on the right hand side is called the (two-dimensional) curl of $F$ and the left-hand side lends itself as a measure of the microscopic circulation of the vector field, $F:R^2 \rightarrow R^2$.
|
||||
@@ -303,31 +303,36 @@ 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:
|
||||
|
||||
$$~
|
||||
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}.
|
||||
~$$
|
||||
|
||||
```math
|
||||
\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.)
|
||||
|
||||
|
||||
|
||||
$$~
|
||||
\oint_{C_1} F\cdot \hat{T} ds \approx
|
||||
(F_y(x+\Delta x, y, z+\Delta{z}) - F_y(x, y, z+\Delta{z})) \Delta{y} -
|
||||
(F_x(x,y + \Delta{y}, z+\Delta{z}) - F_x(x, y, z+\Delta{z})) \Delta{x}
|
||||
~$$
|
||||
```math
|
||||
\begin{align*}
|
||||
\oint_{C_1} F\cdot \hat{T} ds
|
||||
&\approx (F_y(x+\Delta x, y, z+\Delta{z}) \\
|
||||
&- F_y(x, y, z+\Delta{z})) \Delta{y} \\
|
||||
&- (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:
|
||||
|
||||
$$~
|
||||
\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}}.
|
||||
~$$
|
||||
```math
|
||||
\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}$.
|
||||
|
||||
@@ -336,56 +341,56 @@ 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}
|
||||
```math
|
||||
\begin{align*}
|
||||
\oint_{C_2} F \cdot \hat{T} ds
|
||||
&\approx
|
||||
F(x,y,z) \cdot \hat{i} \Delta{x} +
|
||||
F(x+\Delta{x},y,z) \cdot \hat{k} \Delta{z} +
|
||||
F(x,y,z+\Delta{z}) \cdot (-\hat{i}) \Delta{x} +
|
||||
F(x, y, z) \cdot (-\hat{k}) \Delta{z}\\
|
||||
F(x,y,z) \cdot \hat{i} \Delta{x} \\
|
||||
&+ F(x+\Delta{x},y,z) \cdot \hat{k} \Delta{z} \\
|
||||
&+ F(x,y,z+\Delta{z}) \cdot (-\hat{i}) \Delta{x} \\
|
||||
&+ F(x, y, z) \cdot (-\hat{k}) \Delta{z}\\
|
||||
&= (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}
|
||||
~$$
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
Dividing by $\Delta{S}=\Delta{x}\Delta{z}$ and taking a limit will give:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\lim \frac{1}{\Delta{S}} \oint_{C_2} F \cdot \hat{T} ds =
|
||||
\frac{\partial{F_z}}{\partial{x}} - \frac{\partial{F_x}}{\partial{z}}.
|
||||
~$$
|
||||
```
|
||||
|
||||
Had, the opposite face with outward normal $\hat{j}$ been chosen, the answer would differ by a factor of $-1$.
|
||||
|
||||
Similarly, let $S_3$ be the face with outward normal $\hat{i}$ and curve $C_3$ bounding it with parameterization chosen so that the right hand rule points in the direction of $\hat{i}$. This will give
|
||||
|
||||
|
||||
$$~
|
||||
```math
|
||||
\lim \frac{1}{\Delta{S}} \oint_{C_3} F \cdot \hat{T} ds =
|
||||
\frac{\partial{F_z}}{\partial{y}} - \frac{\partial{F_y}}{\partial{z}}.
|
||||
~$$
|
||||
```
|
||||
|
||||
In short, depending on the face chosen, a different answer is given, but all have the same type.
|
||||
|
||||
> Define the *curl* of a $3$-dimensional vector field $F=\langle F_x,F_y,F_z\rangle$ by:
|
||||
> $$~
|
||||
> ```math
|
||||
> \text{curl}(F) =
|
||||
> \langle \frac{\partial{F_z}}{\partial{y}} - \frac{\partial{F_y}}{\partial{z}},
|
||||
> \frac{\partial{F_x}}{\partial{z}} - \frac{\partial{F_z}}{\partial{x}},
|
||||
> \frac{\partial{F_y}}{\partial{x}} - \frac{\partial{F_x}}{\partial{y}} \rangle.
|
||||
> ~$$
|
||||
> ```
|
||||
|
||||
If $S$ is some surface with closed boundary $C$ oriented so that the unit normal, $\hat{N}$, of $S$ is given by the right hand rule about $C$, then
|
||||
|
||||
$$~
|
||||
```math
|
||||
\hat{N} \cdot \text{curl}(F) = \lim \frac{1}{\Delta{S}} \oint_C F \cdot \hat{T} ds.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
The curl has a formal representation in terms of a $3\times 3$ determinant, similar to that used to compute the cross product, that is useful for computation:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\text{curl}(F) = \det\left[
|
||||
\begin{array}{}
|
||||
\hat{i} & \hat{j} & \hat{k}\\
|
||||
@@ -393,7 +398,7 @@ $$~
|
||||
F_x & F_y & F_z
|
||||
\end{array}
|
||||
\right]
|
||||
~$$
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
@@ -419,18 +424,18 @@ curl(F::Function, pt) = curl(ForwardDiff.jacobian(F, pt))
|
||||
|
||||
The divergence, gradient, and curl all involve partial derivatives. There is a notation employed that can express the operations more succinctly. Let the [Del operator](https://en.wikipedia.org/wiki/Del) be defined in Cartesian coordinates by the formal expression:
|
||||
|
||||
> $$~
|
||||
> ```math
|
||||
> \nabla = \langle
|
||||
> \frac{\partial}{\partial{x}},
|
||||
> \frac{\partial}{\partial{y}},
|
||||
> \frac{\partial}{\partial{z}}
|
||||
> \rangle.
|
||||
> ~$$
|
||||
> ```
|
||||
|
||||
This is a *vector differential operator* that acts on functions and vector fields through the typical notation to yield the three operations:
|
||||
|
||||
$$~
|
||||
\begin{align}
|
||||
```math
|
||||
\begin{align*}
|
||||
\nabla{f} &= \langle
|
||||
\frac{\partial{f}}{\partial{x}},
|
||||
\frac{\partial{f}}{\partial{y}},
|
||||
@@ -440,13 +445,15 @@ $$~
|
||||
\frac{\partial}{\partial{x}},
|
||||
\frac{\partial}{\partial{y}},
|
||||
\frac{\partial}{\partial{z}}
|
||||
\rangle \cdot F =
|
||||
\rangle \cdot F \\
|
||||
&=
|
||||
\langle
|
||||
\frac{\partial}{\partial{x}},
|
||||
\frac{\partial}{\partial{y}},
|
||||
\frac{\partial}{\partial{z}}
|
||||
\rangle \cdot
|
||||
\langle F_x, F_y, F_z \rangle =
|
||||
\langle F_x, F_y, F_z \rangle \\
|
||||
&=
|
||||
\frac{\partial{F_x}}{\partial{x}} +
|
||||
\frac{\partial{F_y}}{\partial{y}} +
|
||||
\frac{\partial{F_z}}{\partial{z}},\quad\text{the divergence;}\\
|
||||
@@ -464,15 +471,12 @@ $$~
|
||||
F_x & F_y & F_z
|
||||
\end{array}
|
||||
\right],\quad\text{the curl}.
|
||||
\end{align}
|
||||
~$$
|
||||
|
||||
```julia; echo=false
|
||||
note("""
|
||||
Mathematically operators have not been seen previously, but the concept of an operation on a function that returns another function is a common one when using `Julia`. We have seen many examples (`plot`, `D`, `quadgk`, etc.). In computer science such functions are called *higher order* functions, as they accept arguments which are also functions.
|
||||
""")
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
!!! note
|
||||
Mathematically operators have not been seen previously, but the concept of an operation on a function that returns another function is a common one when using `Julia`. We have seen many examples (`plot`, `D`, `quadgk`, etc.). In computer science such functions are called *higher order* functions, as they accept arguments which are also functions.
|
||||
|
||||
----
|
||||
|
||||
In the `CalculusWithJulia` package, the constant `\nabla[\tab]`, producing $\nabla$ implements this operator for functions and symbolic expressions.
|
||||
@@ -543,11 +547,9 @@ There is a subtle difference in usage. Symbolically the evaluation of
|
||||
function evaluation, parentheses must be used in the numeric case.
|
||||
|
||||
|
||||
```julia; echo=false
|
||||
note("""
|
||||
As mentioned, for the symbolic evaluations, a specification of three variables (here `x`, `y`, and `z`) is necessary. This use takes `free_symbols` to identify three free symbols which may not always be the case. (It wouldn't be for, say, `F(x,y,z) = [a*x,b*y,0]`, `a` and `b` constants.) In those cases, the notation accepts a tuple to specify the function or vector field and the variables, e.g. (`∇( (f(x,y,z), [x,y,z]) )`, as illustrated; `∇ × (F(x,y,z), [x,y,z])`; or `∇ ⋅ (F(x,y,z), [x,y,z])` where this is written using function calls to produce the symbolic expression in the first positional argument, though a direct expression could also be used. In these cases, the named versions `gradient`, `curl`, and `divergence` may be preferred.
|
||||
""")
|
||||
```
|
||||
!!! note
|
||||
As mentioned, for the symbolic evaluations, a specification of three variables (here `x`, `y`, and `z`) is necessary. This use takes `free_symbols` to identify three free symbols which may not always be the case. (It wouldn't be for, say, `F(x,y,z) = [a*x,b*y,0]`, `a` and `b` constants.) In those cases, the notation accepts a tuple to specify the function or vector field and the variables, e.g. (`∇( (f(x,y,z), [x,y,z]) )`, as illustrated; `∇ × (F(x,y,z), [x,y,z])`; or `∇ ⋅ (F(x,y,z), [x,y,z])` where this is written using function calls to produce the symbolic expression in the first positional argument, though a direct expression could also be used. In these cases, the named versions `gradient`, `curl`, and `divergence` may be preferred.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -588,9 +590,9 @@ p
|
||||
|
||||
Consider the limit definition of the divergence:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla\cdot{F} = \lim \frac{1}{\Delta{V}} \oint_S F\cdot\hat{N} dA.
|
||||
~$$
|
||||
```
|
||||
|
||||
In the vector field above, the shape along the curved edges has constant magnitude field. On the left curved edge, the length is smaller and the field is smaller than on the right. The flux across the left edge will be less than the flux across the right edge, and a net flux will exist. That is, there is divergence.
|
||||
|
||||
@@ -747,37 +749,37 @@ 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:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\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}
|
||||
~$$
|
||||
```
|
||||
|
||||
### Product rule
|
||||
|
||||
The product rule $(uv)' = u'v + uv'$ has related formulas:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\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}
|
||||
~$$
|
||||
```
|
||||
|
||||
### Rules over cross products
|
||||
|
||||
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:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\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}
|
||||
~$$
|
||||
```
|
||||
The curl formula is more involved.
|
||||
|
||||
### Vanishing properties
|
||||
@@ -785,9 +787,9 @@ The curl formula is more involved.
|
||||
Surprisingly, the curl and divergence satisfy two vanishing properties. First
|
||||
|
||||
> The curl of a gradient field is $\vec{0}$
|
||||
> $$~
|
||||
> ```math
|
||||
> \nabla \times \nabla{f} = \vec{0},
|
||||
> ~$$
|
||||
> ```
|
||||
|
||||
if the scalar function $f$ is has continuous second derivatives (so the mixed partials do not depend on order).
|
||||
|
||||
@@ -800,14 +802,15 @@ The combination $\nabla\cdot\nabla{f}$ is defined and is called the Laplacian. T
|
||||
Second,
|
||||
|
||||
> The divergence of a curl field is $0$:
|
||||
>$$~
|
||||
>```math
|
||||
>\nabla \cdot(\nabla\times{F}) = 0.
|
||||
> ~$$
|
||||
> ```
|
||||
|
||||
This is not as clear, but can be seen algebraically as terms cancel. First:
|
||||
|
||||
$$~
|
||||
\nabla\cdot(\nabla\times{F}) =
|
||||
```math
|
||||
\begin{align*}
|
||||
\nabla\cdot(\nabla\times{F}) &=
|
||||
\langle
|
||||
\frac{\partial}{\partial{x}},
|
||||
\frac{\partial}{\partial{y}},
|
||||
@@ -816,19 +819,20 @@ $$~
|
||||
\frac{\partial{F_z}}{\partial{y}} - \frac{\partial{F_y}}{\partial{z}},
|
||||
\frac{\partial{F_x}}{\partial{z}} - \frac{\partial{F_z}}{\partial{x}},
|
||||
\frac{\partial{F_y}}{\partial{x}} - \frac{\partial{F_x}}{\partial{y}}
|
||||
\rangle
|
||||
=
|
||||
\rangle \\
|
||||
&=
|
||||
\left(\frac{\partial^2{F_z}}{\partial{y}\partial{x}} - \frac{\partial^2{F_y}}{\partial{z}\partial{x}}\right) +
|
||||
\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:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\frac{\partial^2{F_z}}{\partial{y}\partial{x}} -
|
||||
\frac{\partial^2{F_z}}{\partial{x}\partial{y}}.
|
||||
~$$
|
||||
```
|
||||
|
||||
This is zero under the assumption that the second partial derivatives are continuous.
|
||||
|
||||
@@ -887,12 +891,17 @@ 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:
|
||||
|
||||
$$~
|
||||
0 = \nabla\cdot(\nabla\times{B}) =
|
||||
\mu_0(\nabla\cdot{J} + \epsilon_0 \nabla\cdot{\frac{\partial{E}}{\partial{t}}}) =
|
||||
\mu_0(\nabla\cdot{J} + \epsilon_0 \frac{\partial}{\partial{t}}(\nabla\cdot{E}))
|
||||
= \mu_0(\nabla\cdot{J} + \frac{\partial{\rho}}{\partial{t}}).
|
||||
~$$
|
||||
```mat
|
||||
\begin{align*}
|
||||
0 &= \nabla\cdot(\nabla\times{B}) \\
|
||||
&=
|
||||
\mu_0(\nabla\cdot{J} + \epsilon_0 \nabla\cdot{\frac{\partial{E}}{\partial{t}}}) \\
|
||||
&=
|
||||
\mu_0(\nabla\cdot{J} + \epsilon_0 \frac{\partial}{\partial{t}}(\nabla\cdot{E})) \\
|
||||
&=
|
||||
\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.
|
||||
@@ -907,14 +916,14 @@ From [Wikipedia](https://en.wikipedia.org/wiki/Helmholtz_decomposition) we have
|
||||
|
||||
Let $F$ be a vector field on a **bounded** domain $V$ which is twice continuously differentiable. Let $S$ be the surface enclosing $V$. Then $F$ can be decomposed into a curl-free component and a divergence-free component:
|
||||
|
||||
$$~
|
||||
```math
|
||||
F = -\nabla(\phi) + \nabla\times A.
|
||||
~$$
|
||||
```
|
||||
|
||||
Without explaining why, these values can be computed using volume and
|
||||
surface integrals:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align}
|
||||
\phi(\vec{r}') &=
|
||||
\frac{1}{4\pi} \int_V \frac{\nabla \cdot F(\vec{r})}{\|\vec{r}'-\vec{r} \|} dV -
|
||||
@@ -922,16 +931,16 @@ $$~
|
||||
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}
|
||||
~$$
|
||||
```
|
||||
|
||||
If $V = R^3$, an unbounded domain, *but* $F$ *vanishes* faster than $1/r$, then the theorem still holds with just the volume integrals:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\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}
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
## Change of variable
|
||||
@@ -942,7 +951,7 @@ 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
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align}
|
||||
d\vec{r} &= \langle dx,dy,dz \rangle = J \langle du,dv,dw\rangle\\
|
||||
&=
|
||||
@@ -953,55 +962,58 @@ d\vec{r} &= \langle dx,dy,dz \rangle = J \langle du,dv,dw\rangle\\
|
||||
\frac{\partial{\vec{r}}}{\partial{v}} dv
|
||||
\frac{\partial{\vec{r}}}{\partial{w}} dw.
|
||||
\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.
|
||||
|
||||
As ${\partial{\vec{r}}}/{\partial{u}}$ is a vector it has a magnitude and direction. Define the scale factors as the magnitudes:
|
||||
|
||||
$$~
|
||||
```math
|
||||
h_u = \| \frac{\partial{\vec{r}}}{\partial{u}} \|,\quad
|
||||
h_v = \| \frac{\partial{\vec{r}}}{\partial{v}} \|,\quad
|
||||
h_w = \| \frac{\partial{\vec{r}}}{\partial{w}} \|.
|
||||
~$$
|
||||
```
|
||||
|
||||
and let $\hat{e}_u$, $\hat{e}_v$, and $\hat{e}_w$ be the unit, direction vectors.
|
||||
|
||||
This gives the following notation:
|
||||
|
||||
$$~
|
||||
```math
|
||||
d\vec{r} = h_u du \hat{e}_u + h_v dv \hat{e}_v + h_w dw \hat{e}_w.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
From here, we can express different formulas.
|
||||
|
||||
For line integrals, we have the line element:
|
||||
|
||||
$$~
|
||||
```math
|
||||
dl = \sqrt{d\vec{r}\cdot d\vec{r}} = \sqrt{(h_ud_u)^2 + (h_vd_v)^2 + (h_wd_w)^2}.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
Consider the surface for constant $u$. The vector $\hat{e}_v$ and $\hat{e}_w$ lie in the surface's tangent plane, and the surface element will be:
|
||||
|
||||
$$~
|
||||
```math
|
||||
dS_u = \| h_v dv \hat{e}_v \times h_w dw \hat{e}_w \| = h_v h_w dv dw \| \hat{e}_v \| = h_v h_w dv dw.
|
||||
~$$
|
||||
```
|
||||
|
||||
This uses orthogonality, so $\hat{e}_v \times \hat{e}_w$ is parallel to $\hat{e}_u$ and has unit length. Similarly, $dS_v = h_u h_w du dw$ and $dS_w = h_u h_v du dv$ .
|
||||
|
||||
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:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align*}
|
||||
\left[(d\vec{r} \cdot\hat{e}_u) \hat{e}_u\right] \cdot
|
||||
\left(
|
||||
\left[(d\vec{r} \cdot\hat{e}_v) \hat{e}_v\right] \times
|
||||
\left[(d\vec{r} \cdot\hat{e}_w) \hat{e}_w\right]
|
||||
\right) =
|
||||
(h_u h_v h_w) ( du dv dw ) (\hat{e}_u \cdot (\hat{e}_v \times \hat{e}_w) =
|
||||
\right) &=
|
||||
(h_u h_v h_w) ( du dv dw ) (\hat{e}_u \cdot (\hat{e}_v \times \hat{e}_w) \\
|
||||
&=
|
||||
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.
|
||||
|
||||
@@ -1010,13 +1022,13 @@ as the unit vectors are orthonormal, their triple scalar product is $1$ and $d\v
|
||||
|
||||
We consider spherical coordinates with
|
||||
|
||||
$$~
|
||||
```math
|
||||
F(r, \theta, \phi) = \langle
|
||||
r \sin(\phi) \cos(\theta),
|
||||
r \sin(\phi) \sin(\theta),
|
||||
r \cos(\phi)
|
||||
\rangle.
|
||||
~$$
|
||||
```
|
||||
|
||||
The following figure draws curves starting at $(r_0, \theta_0, \phi_0)$ formed by holding $2$ of the $3$ variables constant. The tangent vectors are added in blue. The surface $S_r$ formed by a constant value of $r$ is illustrated.
|
||||
|
||||
@@ -1061,7 +1073,7 @@ p
|
||||
|
||||
The tangent vectors found from the partial derivatives of $\vec{r}$:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align}
|
||||
\frac{\partial{\vec{r}}}{\partial{r}} &=
|
||||
\langle \cos(\theta) \cdot \sin(\phi), \sin(\theta) \cdot \sin(\phi), \cos(\phi)\rangle,\\
|
||||
@@ -1070,17 +1082,19 @@ $$~
|
||||
\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}
|
||||
~$$
|
||||
```
|
||||
|
||||
With this, we have $h_r=1$, $h_\theta=r\sin(\phi)$, and $h_\phi = r$. So that
|
||||
|
||||
$$~
|
||||
dl = \sqrt{dr^2 + (r\sin(\phi)d\theta^2) + (rd\phi)^2},\quad
|
||||
dS_r = r^2\sin(\phi)d\theta d\phi,\quad
|
||||
dS_\theta = rdr d\phi,\quad
|
||||
dS_\phi = r\sin(\phi)dr d\theta, \quad\text{and}\quad
|
||||
dV = r^2\sin(\phi) drd\theta d\phi.
|
||||
~$$
|
||||
```math
|
||||
\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,\\
|
||||
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.
|
||||
|
||||
@@ -1132,25 +1146,27 @@ p
|
||||
|
||||
If $f$ is a scalar function then $df = \nabla{f} \cdot d\vec{r}$ by the chain rule. Using the curvilinear coordinates:
|
||||
|
||||
$$~
|
||||
df =
|
||||
```math
|
||||
\begin{align*}
|
||||
df &=
|
||||
\frac{\partial{f}}{\partial{u}} du +
|
||||
\frac{\partial{f}}{\partial{v}} dv +
|
||||
\frac{\partial{f}}{\partial{w}} dw
|
||||
=
|
||||
\frac{\partial{f}}{\partial{w}} dw \\
|
||||
&=
|
||||
\frac{1}{h_u}\frac{\partial{f}}{\partial{u}} h_udu +
|
||||
\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:
|
||||
|
||||
$$~
|
||||
```math
|
||||
df = (\frac{1}{h_u}\frac{\partial{f}}{\partial{u}}\hat{e}_u +
|
||||
\frac{1}{h_v}\frac{\partial{f}}{\partial{v}}\hat{e}_v +
|
||||
\frac{1}{h_w}\frac{\partial{f}}{\partial{w}}\hat{e}_w) \cdot d\vec{r} =
|
||||
\nabla{f} \cdot d\vec{r}.
|
||||
~$$
|
||||
```
|
||||
|
||||
The gradient is the part within the parentheses.
|
||||
|
||||
@@ -1158,55 +1174,55 @@ The gradient is the part within the parentheses.
|
||||
|
||||
As an example, in cylindrical coordinates, we have $h_r =1$, $h_\theta=r$, and $h_z=1$, giving:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla{f} = \frac{\partial{f}}{\partial{r}}\hat{e}_r +
|
||||
\frac{1}{r}\frac{\partial{f}}{\partial{\theta}}\hat{e}_\theta +
|
||||
\frac{\partial{f}}{\partial{z}}\hat{e}_z
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
### The divergence in a new coordinate system
|
||||
|
||||
The divergence is a result of the limit of a surface integral,
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla \cdot F = \lim \frac{1}{\Delta{V}}\oint_S F \cdot \hat{N} dS.
|
||||
~$$
|
||||
```
|
||||
|
||||
Taking $V$ as a box in the curvilinear coordinates, with side lengths $h_udu$, $h_vdv$, and $h_wdw$
|
||||
the surface integral is computed by projecting $F$ onto each normal area element and multiplying by the area. The task is similar to how the the divergence was derived above, only now the terms are like $\partial{(F_uh_vh_w)}/\partial{u}$ due to the scale factors ($F_u$ is the u component of $F$.) The result is:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla\cdot F = \frac{1}{h_u h_v h_w}\left[
|
||||
\frac{\partial{(F_uh_vh_w)}}{\partial{u}} +
|
||||
\frac{\partial{(h_uF_vh_w)}}{\partial{v}} +
|
||||
\frac{\partial{(h_uh_vF_w)}}{\partial{w}} \right].
|
||||
~$$
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
For example, in cylindrical coordinates, we have
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla \cdot F = \frac{1}{r}
|
||||
\left[
|
||||
\frac{\partial{F_r r}}{\partial{r}} +
|
||||
\frac{\partial{F_\theta}}{\partial{\theta}} +
|
||||
\frac{\partial{F_x}}{\partial{z}}
|
||||
\right].
|
||||
~$$
|
||||
```
|
||||
|
||||
### The curl in a new coordinate system
|
||||
|
||||
The curl, like the divergence, can be expressed as the limit of an integral:
|
||||
|
||||
$$~
|
||||
```math
|
||||
(\nabla \times F) \cdot \hat{N} = \lim \frac{1}{\Delta{S}} \oint_C F \cdot d\vec{r},
|
||||
~$$
|
||||
```
|
||||
|
||||
where $S$ is a surface perpendicular to $\hat{N}$ with boundary $C$. For a small rectangular surface, the derivation is similar to above, only the scale factors are included. This gives, say, for the $\hat{e}_u$ normal, $\frac{\partial{(h_zF_z)}}{\partial{y}} - \frac{\partial{(h_yF_y)}}{\partial{z}}$. The following determinant form combines the terms compactly:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla\times{F} = \det \left[
|
||||
\begin{array}{}
|
||||
h_u\hat{e}_u & h_v\hat{e}_v & h_w\hat{e}_w \\
|
||||
@@ -1214,13 +1230,13 @@ h_u\hat{e}_u & h_v\hat{e}_v & h_w\hat{e}_w \\
|
||||
h_uF_u & h_v F_v & h_w F_w
|
||||
\end{array}
|
||||
\right].
|
||||
~$$
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
For example, in cylindrical coordinates, the curl is:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\det\left[
|
||||
\begin{array}{}
|
||||
\hat{r} & r\hat{\theta} & \hat{k} \\
|
||||
@@ -1228,11 +1244,11 @@ $$~
|
||||
F_r & rF_\theta & F_z
|
||||
\end{array}
|
||||
\right]
|
||||
~$$
|
||||
```
|
||||
|
||||
Applying this to the function $F(r,\theta, z) = \hat{\theta}$ we get:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\text{curl}(F) = \det\left[
|
||||
\begin{array}{}
|
||||
\hat{r} & r\hat{\theta} & \hat{k} \\
|
||||
@@ -1247,7 +1263,7 @@ $$~
|
||||
\end{array}
|
||||
\right] =
|
||||
\hat{k}.
|
||||
~$$
|
||||
```
|
||||
|
||||
As $F$ represents a vector field that rotates about the $z$ axis at a constant rate, the magnitude of the curl should be a constant and it should point in the $\hat{k}$ direction, as we found.
|
||||
|
||||
@@ -1290,8 +1306,8 @@ raw" ``x y + x e^{x y} + \cos{\left (x \right )}``",
|
||||
raw" ``x y + x e^{x y}``",
|
||||
raw" ``x e^{x y} + \cos{\left (x \right )}``"
|
||||
]
|
||||
ans=1
|
||||
radioq(choices, ans)
|
||||
answ=1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1306,8 +1322,8 @@ raw" ``xz``",
|
||||
raw" ``-yz``",
|
||||
raw" ``ye^{xy}``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1320,8 +1336,8 @@ raw" ``0``",
|
||||
raw" ``\vec{0}``",
|
||||
raw" ``6``"
|
||||
]
|
||||
ans=1
|
||||
radioq(choices, ans)
|
||||
answ=1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1329,21 +1345,21 @@ radioq(choices, ans)
|
||||
|
||||
In two dimension's the curl of a gradient field simplifies to:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla\times\nabla{f} = \nabla\times
|
||||
\langle\frac{\partial{f}}{\partial{x}},
|
||||
\frac{\partial{f}}{\partial{y}}\rangle =
|
||||
\frac{\partial{\frac{\partial{f}}{\partial{y}}}}{\partial{x}} -
|
||||
\frac{\partial{\frac{\partial{f}}{\partial{x}}}}{\partial{y}}.
|
||||
~$$
|
||||
```
|
||||
|
||||
```julia; hold=true; echo=false
|
||||
choices = [
|
||||
L"This is $0$ if the partial derivatives are continuous by Schwarz's (Clairault's) theorem",
|
||||
L"This is $0$ for any $f$, as $\nabla\times\nabla$ is $0$ since the cross product of vector with itself is the $0$ vector."
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1365,8 +1381,8 @@ choices=[
|
||||
"The field is irrotational (curl free)",
|
||||
"The field has a non-trivial curl and divergence"
|
||||
]
|
||||
ans=1
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ=1
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
|
||||
@@ -1388,8 +1404,8 @@ choices=[
|
||||
"The field is irrotational (curl free)",
|
||||
"The field has a non-trivial curl and divergence"
|
||||
]
|
||||
ans=2
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ=2
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1403,8 +1419,8 @@ choices=[
|
||||
"The field is irrotational (curl free)",
|
||||
"The field has a non-trivial curl and divergence"
|
||||
]
|
||||
ans=3
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ=3
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
|
||||
@@ -1419,8 +1435,8 @@ choices=[
|
||||
"The field is irrotational (curl free)",
|
||||
"The field has a non-trivial curl and divergence"
|
||||
]
|
||||
ans=1
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ=1
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
|
||||
@@ -1431,7 +1447,7 @@ For spherical coordinates, $\Phi(r, \theta, \phi)=r \langle \sin\phi\cos\theta,\
|
||||
|
||||
The curl then will then be
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla\times{F} = \det \left[
|
||||
\begin{array}{}
|
||||
\hat{e}_r & r\sin\phi\hat{e}_\theta & r\hat{e}_\phi \\
|
||||
@@ -1439,7 +1455,7 @@ $$~
|
||||
F_r & r\sin\phi F_\theta & r F_\phi
|
||||
\end{array}
|
||||
\right].
|
||||
~$$
|
||||
```
|
||||
|
||||
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$?
|
||||
|
||||
@@ -1449,6 +1465,6 @@ raw" ``\vec{0}``",
|
||||
raw" ``re_\phi``",
|
||||
raw" ``rh'(r)e_\phi``"
|
||||
]
|
||||
ans=1
|
||||
radioq(choices, ans)
|
||||
answ=1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
@@ -14,8 +14,8 @@ using HCubature
|
||||
```julia; echo=false; results="hidden"
|
||||
using CalculusWithJulia.WeaveSupport
|
||||
|
||||
import PyPlot
|
||||
pyplot()
|
||||
#import PyPlot
|
||||
#pyplot()
|
||||
|
||||
|
||||
const frontmatter = (
|
||||
@@ -89,9 +89,9 @@ As with the one-dimensional case, $f$ is Riemann integrable over $R$ if the limi
|
||||
|
||||
When $f$ is Riemann integrable over a rectangular region $R$, we denote the limit by any of:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\iint_R f(x) dV, \quad \iint_R fdV, \quad \iint_R f(x_1, \dots, x_n) dx_1 \cdot\cdots\cdot dx_n, \quad\iint_R f(\vec{x}) d\vec{x}.
|
||||
~$$
|
||||
```
|
||||
|
||||
A key fact, requiring proof, is:
|
||||
|
||||
@@ -111,25 +111,25 @@ As with one-dimensional integrals, from the Riemann sum definition, several fami
|
||||
|
||||
|
||||
* For integrable $f$ and $g$ and constants $a$ and $b$:
|
||||
$$~
|
||||
```math
|
||||
\iint_R (af(x) + bg(x))dV = a\iint_R f(x)dV + b\iint_R g(x) dV.
|
||||
~$$
|
||||
```
|
||||
|
||||
**Disjoint:**
|
||||
|
||||
* If $R$ and $R'$ are *disjoint* rectangular regions (possibly sharing a boundary), then the integral over the union is defined by linearity:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\iint_{R \cup R'} f(x) dV = \iint_R f(x)dV + \iint_{R'} f(x) dV.
|
||||
~$$
|
||||
```
|
||||
|
||||
**Monotonicity:**
|
||||
|
||||
* As $f$ is bounded, let $m \leq f(x) \leq M$ for all $x$ in $R$. Then
|
||||
|
||||
$$~
|
||||
```math
|
||||
m V(R) \leq \iint_R f(x) dV \leq MV(R).
|
||||
~$$
|
||||
```
|
||||
|
||||
* If $f$ and $g$ are integrable *and* $f(x) \leq g(x)$, then the integrals have the same property, namely $\iint_R f dV \leq \iint_R gdV$.
|
||||
|
||||
@@ -234,7 +234,7 @@ The answer agrees with that known from the formula, $4 = (1/3)a^2 h$, but the a
|
||||
We might try integrating a function with a condition:
|
||||
|
||||
```julia; hold=true
|
||||
function f(x,y, r)
|
||||
function f(x, y, r)
|
||||
if x^2 + y^2 < r
|
||||
sqrt(z - x^2 + y^2)
|
||||
else
|
||||
@@ -246,16 +246,11 @@ end
|
||||
**But** `hcubature` is **very** slow to integrate such functions. We will see our instincts are good -- this is the approach taken to discuss integrals over general regions -- but this is not practical here. There are two alternative approaches to be discussed: approach the integral *iteratively* or *transform* the circular region into a rectangular region and integrate. Before doing so, we discuss how the integral is developed for more general regions.
|
||||
|
||||
|
||||
```julia; echo=false
|
||||
note("""
|
||||
The approach above takes a nice smooth function and makes it non smooth at the boundary. In general this is not a good idea for numeric solutions, as many algorithms work better with assumptions of smoothness.
|
||||
""")
|
||||
```
|
||||
!!! note
|
||||
The approach above takes a nice smooth function and makes it non smooth at the boundary. In general this is not a good idea for numeric solutions, as many algorithms work better with assumptions of smoothness.
|
||||
|
||||
```julia; echo=false
|
||||
note("""
|
||||
The `Quadrature` package provides a uniform interface for `QuadGK`, `HCubature`, and other numeric integration routines available in `Julia`.""")
|
||||
```
|
||||
!!! note
|
||||
The `Quadrature` package provides a uniform interface for `QuadGK`, `HCubature`, and other numeric integration routines available in `Julia`.
|
||||
|
||||
## Integrals over more general regions
|
||||
|
||||
@@ -350,10 +345,10 @@ $I(x) = \int_{-2}^2 f(x,y) dy$. Like partial derivatives, this integrates in $y
|
||||
The question then: under what conditions will the three integrals be equal?
|
||||
|
||||
> [Fubini](https://math.okstate.edu/people/lebl/osu4153-s16/chapter10-ver1.pdf). Let $R \times S$ be a closed rectangular region in $R^n \times R^m$. Suppose $f$ is bounded. Define $f_x(y) = f(x,y)$ and $f^y(x) = f(x,y)$ where $x$ is in $R^n$ and $y$ in $R^m$. *If* $f_x$ and $f^y$ are integrable then
|
||||
> $$~
|
||||
> ```math
|
||||
> \iint_{R\times S}fdV = \iint_R \left(\iint_S f_x(y) dy\right) dx
|
||||
> = \iint_S \left(\iint_R f^y(x) dx\right) dy.
|
||||
> ~$$
|
||||
> ```
|
||||
|
||||
Similarly, if $f^y$ is integrable for all $y$, then $\iint_{R\times S}fdV =\iint_S \iint_R f(x,y) dx dy$.
|
||||
|
||||
@@ -380,18 +375,18 @@ A domain, as described above, is known as a [normal](https://en.wikipedia.org/wi
|
||||
|
||||
For example, we return to the problem of a square pyramid, only now using symmetry, we integrate only over the triangular region between $0 \leq x \leq a/2$ and $0 \leq y \leq x$. The answer is then (the $8$ by symmetry)
|
||||
|
||||
$$~
|
||||
```math
|
||||
V = 8 \int_0^{a/2} \int_0^x h(l(x,y) - d(x,y))/l(x,y) dy dx.
|
||||
~$$
|
||||
```
|
||||
|
||||
But, using similar triangles, we have $d/x = l/(a/2)$ so $(l-d)/l = 1 - 2x/a$. Continuing, our answer becomes
|
||||
|
||||
$$~
|
||||
```math
|
||||
V = 8 \int_0^{a/2} (\int_0^x h(1-\frac{2x}{a}) dy) dx =
|
||||
8 \int_0^{a/2} (h(1-2x/a) \cdot x) dx =
|
||||
8 (hx^2_2 \big\lvert_{0}^{a/2} - \frac{2}{a}\frac{x^3}{3}\big\lvert_0^{a/2})=
|
||||
8 h(\frac{a^2}{8} - \frac{2}{24}a^2) = \frac{a^2h}{3}.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -402,9 +397,9 @@ The `integrate` function of `SymPy` uses various algorithms to symbolically inte
|
||||
|
||||
For example, to perform the integral
|
||||
|
||||
$$~
|
||||
```math
|
||||
\int_a^b \int_{h(x)}^{g(x)} f(x,y) dy dx
|
||||
~$$
|
||||
```
|
||||
|
||||
the call would look like:
|
||||
|
||||
@@ -585,9 +580,9 @@ integrate(rho(x,y), (y, h(x), g(x)), (x, -a, a))
|
||||
|
||||
Integrate $\int_0^1 \int_y^1 \cos(x^2) dx dy$ avoiding the *impossible* integral of $\cos(x^2)$. As the integrand is continuous, Fubini's Theorem allows the interchange of the variable of integraton. The region, $R$, is a triangle in the first quadrant below the line $y=x$ and left of the line $x=1$. So we have:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\int_0^1 \int_0^x \cos(x^2) dy dx
|
||||
~$$
|
||||
```
|
||||
|
||||
We can integrate this, as the interior integral leaves $x \cos(x^2)$ to integrate:
|
||||
|
||||
@@ -692,8 +687,9 @@ sin(1)/2
|
||||
|
||||
Triple integrals are identical in theory to double integrals, though the computations can be more involved and the regions more complicated to describe. The main regions (emphasized by Strang) to understand are: box, prism, cylinder, cone, tetrahedron, and sphere.
|
||||
|
||||
```julia; hold=true; echo=false
|
||||
ts = range(0, pi/2, length=50)
|
||||
```julia; echo=false
|
||||
let
|
||||
ts = range(0, pi/2, length=50)
|
||||
O = [0,0,0]
|
||||
bx, by,bz = [1, 0, 0], [0,2,0], [0,0,3]
|
||||
|
||||
@@ -748,7 +744,8 @@ ts = range(0, pi/2, length=50)
|
||||
push!(ps, p)
|
||||
|
||||
l = @layout [a b; c d; e]
|
||||
plot(ps..., layout=l)
|
||||
plot(ps..., layout=l)
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
@@ -789,9 +786,9 @@ This is $1/6$th the volume of the box.
|
||||
|
||||
* Cone. Consider a cone formed by the function $z = f(x,y) = a - b(x^2+y^2)^{1/2}$ ($a,b > 0$) and the $x$-$y$ plane. This will have radius $r = a/b$ and height $a$. The volume is given by this integral:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\int_{x=-r}^r \int_{y=-\sqrt{r^2 - x^2}}^{\sqrt{r^2-x^2}} \int_0^{a - b(x^2 + y^2)} 1 dz dy dx.
|
||||
~$$
|
||||
```
|
||||
|
||||
This integral is doable, but `SymPy` has trouble with it. We will return to this when cylindrical coordinates are defined.
|
||||
|
||||
@@ -799,9 +796,9 @@ This integral is doable, but `SymPy` has trouble with it. We will return to this
|
||||
|
||||
* Sphere. The sphere $x^2 + y^2 + z^2 \leq 1$ has a known volume. Can we compute it using integration? In Cartesian coordinates, we can describe the region $x^2 + y^2 \leq 1$ and then the $z$-limits will follow:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\int_{x=-1}^1 \int_{y=-\sqrt{1-x^2}}^{\sqrt{1-x^2}} \int_{z=-\sqrt{1 - x^2 - y^2}}^{\sqrt{1-x^2 - y^2}} 1 dz dy dx.
|
||||
~$$
|
||||
```
|
||||
|
||||
This integral is doable, but `SymPy` has trouble with it. We will return to this when spherical coordinates are defined.
|
||||
|
||||
@@ -813,9 +810,9 @@ This integral is doable, but `SymPy` has trouble with it. We will return to this
|
||||
|
||||
The change of variables, or substitution, formula from first-semester calculus is expressed, under assumptions, by:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\int_{g(R)} f(x) dx = \int_R (f\circ g)(u)g'(u) du.
|
||||
~$$
|
||||
```
|
||||
|
||||
The derivation comes from reversing the chain rule. When using it, we start on the right hand side and typically write $x = g(u)$ and from here derive an expression involving differentials: $dx = g'(u) du$ and the rest follows. In practice, this is used to simplify the integrand in the search for an antiderivative, as $(f\circ g)$ is generally more complicated than $f$ alone.
|
||||
|
||||
@@ -827,23 +824,23 @@ 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
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align}
|
||||
dx &= A du + B dv\\
|
||||
dy &= C du + D dv,
|
||||
\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$.
|
||||
|
||||
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:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align}
|
||||
x &= a + mt + \sqrt{1-m^2} v\\
|
||||
y & = b + \sqrt{1-m^2}t -mv
|
||||
\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$.
|
||||
|
||||
@@ -937,7 +934,7 @@ showG(G, 1, 1)
|
||||
The arrows are the images of the standard unit vectors. We see some transformations leave these *orthogonal* and some change the respective lengths.
|
||||
The area of the associated parallelogram can be found using the determinant of an accompanying matrix. For two dimensions, using the cross product formulation on the embedded vectors, the area is
|
||||
|
||||
$$~
|
||||
```math
|
||||
\| \det\left(\left[
|
||||
\begin{array}{}
|
||||
\hat{i} & \hat{j} & \hat{k}\\
|
||||
@@ -961,7 +958,7 @@ v_1 & v_2
|
||||
\end{array}
|
||||
\right]
|
||||
\right)|.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
Using the fact that the two vectors involved are columns in the Jacobian of the transformation, this is just $|\det(J_G)|$. For $3$ dimensions, the determinant gives the volume of the 3-dimensional parallelepiped in the same manner. This holds for higher dimensions.
|
||||
@@ -970,20 +967,16 @@ The absolute value of the determinant of the Jacobian
|
||||
is the multiplying factor that is seen in the change of variable formula for all dimensions:
|
||||
|
||||
> [Change of variable](https://en.wikipedia.org/wiki/Integration_by_substitution#Substitution_for_multiple_variables) Let $U$ be an open set in $R^n$, $G:U \rightarrow R^n$ be an *injective* differentiable function with *continuous* partial derivatives. If $f$ is continuous and compactly supported, then
|
||||
> $$~
|
||||
> ```math
|
||||
> \iint_{G(S)} f(\vec{x}) dV = \iint_S (f \circ G)(\vec{u}) |\det(J_G)(\vec{u})| dU.
|
||||
> ~$$
|
||||
> ```
|
||||
|
||||
|
||||
For the one-dimensional case, there is no absolute value, but there the interval is reversed, producing "negative" area. This is not the case here, where $S$ is parameterized to give positive volume.
|
||||
|
||||
```julia; echo=false
|
||||
note(L"""
|
||||
!!! note
|
||||
The term "functional determinant" is found for the value $\det(J_G)$, as is the notation $\partial(x_1, x_2, \dots x_n)/\partial(u_1, u_2, \dots, u_n)$.
|
||||
|
||||
The term "functional determinant" is found for the value $\det(J_G)$, as is the notation $\partial(x_1, x_2, \dots x_n)/\partial(u_1, u_2, \dots, u_n)$.
|
||||
|
||||
""")
|
||||
```
|
||||
|
||||
### Two dimensional change of variables
|
||||
|
||||
@@ -994,14 +987,14 @@ Now we see several examples of two-dimensional transformations.
|
||||
|
||||
We have [seen](../differentiable_vector_calculus/polar_coordinates.html) how to compute area in polar coordinates through the formula $A = \int (1/2) r^2(\theta) d\theta$. This formula can be derived as follows. Consider a region $R$ parameterized in polar coordinates by $r(\theta)$ for $a \leq \theta \leq b$. The area of this region would be $\iint_R fdA$. Let $G(r, \theta) = r \langle \cos\theta, \sin\theta\rangle$. Then
|
||||
|
||||
$$~
|
||||
```math
|
||||
J_G = \left[
|
||||
\begin{array}{}
|
||||
\cos(\theta) & - r\sin(\theta)\\
|
||||
\sin(\theta) & r\cos(\theta)
|
||||
\end{array}
|
||||
\right],
|
||||
~$$
|
||||
```
|
||||
|
||||
with determinant $r$.
|
||||
|
||||
@@ -1010,9 +1003,9 @@ That is, for *polar coordinates* $dx dy = r dr d\theta$ ($r \geq 0$).
|
||||
|
||||
So by the change of variable formula, we have:
|
||||
|
||||
$$~
|
||||
```math
|
||||
A = \iint_R 1 dx dy = \int_a^b \int_0^{r(\theta)} 1 r dr d\theta = \int_a^b \frac{r^2(\theta)}{2} d\theta.
|
||||
~$$
|
||||
```
|
||||
|
||||
The key is noting that the region, $S$, described by $\theta$ running from $a$ to $b$ and $r$ running from $0$ to $r(\theta)$, maps onto $R$ through the change of variables. As polar coordinates is just a renaming, this is clear to see.
|
||||
|
||||
@@ -1020,21 +1013,21 @@ The key is noting that the region, $S$, described by $\theta$ running from $a$ t
|
||||
|
||||
Now consider finding the volume of a sphere using polar coordinates. We have, with $\rho$ being the radius:
|
||||
|
||||
$$~
|
||||
```math
|
||||
V = 2 \iint_R \sqrt{\rho^2 - x^2 - y^2} dy dx,
|
||||
~$$
|
||||
```
|
||||
|
||||
where $R$ is the disc of radius $\rho$. Using polar coordinates, we have $x^2 + y^2 = r^2$ and the expression becomes:
|
||||
|
||||
$$~
|
||||
```math
|
||||
V = 2 \int_0^{2\pi} \int_0^\rho \sqrt{\rho^2 - r^2} r dr d\theta = 2 \int_0^{2\pi} -(1 - r^2)^{3/2}\frac{1}{3} \mid_0^\rho d\theta = 2\int_0^{2\pi} \frac{\rho^3}{3}d\theta = \frac{4\pi\rho^3}{3}.
|
||||
~$$
|
||||
```
|
||||
|
||||
##### Linear transformations
|
||||
|
||||
Some [transformations](https://en.wikipedia.org/wiki/Transformation_matrix#Examples_in_2D_computer_graphics) from ``2``D computer graphics are represented in matrix notation:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\left[
|
||||
\begin{array}{}
|
||||
x\\
|
||||
@@ -1053,7 +1046,7 @@ u\\
|
||||
v
|
||||
\end{array}
|
||||
\right],
|
||||
~$$
|
||||
```
|
||||
|
||||
or $G(u,v) = \langle au+bv, cu+dv\rangle$. The Jacobian of this *linear* transformation is the matrix itself.
|
||||
|
||||
@@ -1085,7 +1078,7 @@ showG(G)
|
||||
|
||||
* **Reflection** If $\vec{l} = \langle l_x, l_y \rangle$ with norm $\|\vec{l}\|$. The reflection through the line in the direction of $\vec{l}$ through the origin is defined, using a matrix, by:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\frac{1}{\| \vec{l} \|^2}
|
||||
\left[
|
||||
\begin{array}{}
|
||||
@@ -1093,7 +1086,7 @@ l_x^2 - l_y^2 & 2 l_x l_y\\
|
||||
2l_x l_y & l_y^2 - l_x^2
|
||||
\end{array}
|
||||
\right]
|
||||
~$$
|
||||
```
|
||||
|
||||
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$.
|
||||
|
||||
@@ -1126,7 +1119,7 @@ showG(G, lambda=1/3)
|
||||
|
||||
The determinant of the Jacobian is
|
||||
|
||||
$$~
|
||||
```math
|
||||
\det(J_G) = \det\left(
|
||||
\left[
|
||||
\begin{array}{}
|
||||
@@ -1135,12 +1128,12 @@ v & u
|
||||
\end{array}
|
||||
\right]
|
||||
\right) = u.
|
||||
~$$
|
||||
```
|
||||
|
||||
So, $\iint_R f(x,y) dA = \int_0^1\int_0^1 f(u, uv) u du dv$. Here we illustrate with a generic monomial:
|
||||
|
||||
```julia;
|
||||
@syms n::positive m::positive
|
||||
@syms x y n::positive m::positive
|
||||
monomial(x,y) = x^n*y^m
|
||||
integrate(monomial(x,y), (y, 0, x), (x, 0, 1))
|
||||
```
|
||||
@@ -1159,10 +1152,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:
|
||||
|
||||
$$~
|
||||
\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 =
|
||||
```math
|
||||
\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.)
|
||||
|
||||
@@ -1255,34 +1251,34 @@ plot(ps..., layout=l)
|
||||
|
||||
The center of mass is a balancing point of a region with density $\rho(x,y)$. In two dimensions it is a point $\langle \bar{x}, \bar{y}\rangle$. These are found by the following formulas:
|
||||
|
||||
$$~
|
||||
```math
|
||||
A = \iint_R \rho(x,y) dA, \quad \bar{x} = \frac{1}{A} \iint_R x \rho(x,y) dA, \quad
|
||||
\bar{y} = \frac{1}{A} \iint_R y \rho(x,y) dA.
|
||||
~$$
|
||||
```
|
||||
|
||||
The $x$ value can be seen in terms of Fubini by integrating in $y$ first:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\iint_R x \rho(x,y) dA = \int_{x=a}^b (\int_{y=h(x)}^{g(x)} \rho(x,y) dy) dx.
|
||||
~$$
|
||||
```
|
||||
|
||||
The inner integral is the mass of a slice at a value along the $x$ axis. The center of mass is formed then by the mass times the distance from the origin. The center of mass is a "balance" point, in the sense that $\iint_R (x - \bar{x}) dA = 0$ and $\iint_R (y-\bar{y})dA = 0$.
|
||||
|
||||
For example, the center of mass of the upper half *unit* disc will have a centroid with $\bar{x} = 0$, by symmetry. We can see this by integrating in *Cartesian* coordinates, as follows
|
||||
|
||||
$$~
|
||||
```math
|
||||
\iint_R x dA = \int_{y=0}^1 \int_{x=-\sqrt{1-y^2}}^{\sqrt{1 - y^2}} x dx dy.
|
||||
~$$
|
||||
```
|
||||
|
||||
The inner integral is $0$ as it an integral of an *odd* function over an interval symmetric about $0$.
|
||||
|
||||
|
||||
The value of $\bar{y}$ is found using polar coordinate transformation from:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\iint_R y dA = \int_{r=0}^1 \int_{\theta=0}^{\pi} (r\sin(\theta))r d\theta dr =
|
||||
\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)$.
|
||||
|
||||
@@ -1294,9 +1290,9 @@ Let $R$ be the half disc contained by $x^2 + y^2 = 1$ and $y \geq 0$. Let $\rho(
|
||||
|
||||
$R$ is best described in polar coordinates, so we try to compute
|
||||
|
||||
$$~
|
||||
```math
|
||||
\int_0^1 \int_{-\pi/2}^{\pi/2} (r\cos(\theta))^2 (r\cos(\theta))(r\sin(\theta)) r d\theta dr.
|
||||
~$$
|
||||
```
|
||||
|
||||
That requires integrating $\sin^2(\theta)\cos^3(\theta)$, a doable task, but best left to SymPy:
|
||||
|
||||
@@ -1314,9 +1310,9 @@ integrate(x^2 * rho(x, y), (theta, -PI/2, PI/2), (r, 0, 1))
|
||||
|
||||
The counterclockwise rotation of the unit square is $G(u,v) = \langle \cos(\alpha)u-\sin(\alpha)v, \sin(\alpha)u + \cos(\alpha) v\rangle$. This comes from the above formula for clockwise rotation using $-\alpha$. This transformation has Jacobian determinant $1$, as the area is not deformed. With this, we have
|
||||
|
||||
$$~
|
||||
```math
|
||||
\iint_R x^2 dA = \iint_{G(U)} (f\circ G)(u) |\det(J_G(u))| dU,
|
||||
~$$
|
||||
```
|
||||
|
||||
which is computed with:
|
||||
|
||||
@@ -1334,9 +1330,9 @@ Let $R$ be a ring with inner radius $4$ and outer radius $5$. Find its moment of
|
||||
|
||||
The integral to compute is:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\iint_R x^2 dA,
|
||||
~$$
|
||||
```
|
||||
|
||||
with domain that is easy to describe in polar coordinates:
|
||||
|
||||
@@ -1356,9 +1352,9 @@ The change of variables formula is no different between dimensions $2$ and $3$ (
|
||||
|
||||
Polar coordinates describe the $x$-$y$ plane in terms of a radius $r$ and angle $\theta$. *Cylindrical* coordinates describe the $x-y-z$ plane in terms of $r, \theta$, and $z$. A transformation is:
|
||||
|
||||
$$~
|
||||
```math
|
||||
G(r,\theta, z) = \langle r\cos(\theta), r\sin(\theta), z\rangle.
|
||||
~$$
|
||||
```
|
||||
|
||||
This has Jacobian determinant $r$, similar to polar coordinates.
|
||||
|
||||
@@ -1368,18 +1364,18 @@ This has Jacobian determinant $r$, similar to polar coordinates.
|
||||
|
||||
Returning to the volume of a cone above the $x$-$y$ plane under $z = a - b(x^2 + y^2)^{12}$. This yielded the integral in Cartesian coordinates:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\int_{x=-r}^r \int_{y=-\sqrt{r^2 - x^2}}^{\sqrt{r^2-x^2}} \int_0^{a - b(x^2 + y^2)} 1 dz dy dx,
|
||||
~$$
|
||||
```
|
||||
|
||||
where $r=a/b$. This is *much* simpler in Cylindrical coordinates, as the region is described by the rectangle in $(r, \theta)$: $[0, \sqrt{b/a}] \times [0, 2\pi]$ and the $z$ range is from $0$ to $a - b r$.
|
||||
|
||||
The volume then is:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\int_{theta=0}^{2\pi} \int_{r=0}^{a/b} \int_{z=0}^{a - br} 1 r dz dr d\theta =
|
||||
2\pi \int_{r=0}^{a/b} (a-br)r dr = \frac{\pi a^3}{3b^2}.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
This is in agreement with $\pi r^2 h/3$.
|
||||
@@ -1437,13 +1433,13 @@ Spherical coordinates describe a point in space by a radius from the origin, $r$
|
||||
|
||||
The exact formula to relate $(\rho, \theta, \phi)$ to $(x,y,z)$ is given by
|
||||
|
||||
$$~
|
||||
```math
|
||||
G(\rho, \theta, \phi) = \rho \langle
|
||||
\sin(\phi)\cos(\theta),
|
||||
\sin(\phi)\sin(\theta),
|
||||
\cos(\phi)
|
||||
\rangle.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
```julia; hold=true; echo=false
|
||||
@@ -1465,10 +1461,10 @@ det(G(ρ, theta, phi).jacobian([ρ, theta, phi])) |> simplify |> abs
|
||||
|
||||
Computing the volume of a sphere is a challenge (for SymPy) in Cartesian coordinates, but a breeze in spherical coordinates. Using $r^2\sin(\phi)$ as the multiplying factor, the volume is simply:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\int_{\theta=0}^{2\pi} \int_{\phi=0}^{\pi} \int_{r=0}^R 1 \cdot r^2 \sin(\phi) dr d\phi d\theta =
|
||||
\int_{\theta=0}^{2\pi} d\theta \int_{\phi=0}^{\pi} \sin(\phi)d\phi \int_{r=0}^R r^2 dr = (2\pi)(2)\frac{R^3}{3} = \frac{4\pi R^3}{3}.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -1478,9 +1474,9 @@ Compute the volume of the ellipsoid, $R$, described by $(x/a)^2 + (y/v)^2 + (z/c
|
||||
|
||||
We first change variables via $G(u,v,w) = \langle ua, vb, wc \rangle$. This maps the unit sphere, $S$, given by $u^2 + v^2 + w^2 \leq 1$ into the ellipsoid. Then
|
||||
|
||||
$$~
|
||||
```math
|
||||
\iint_R 1 dV = \iint_S 1 |\det(J_G)| dU
|
||||
~$$
|
||||
```
|
||||
|
||||
But the Jacobian is a constant:
|
||||
|
||||
@@ -1499,17 +1495,17 @@ So the answer is $abc V(S) = 4\pi abc/3$
|
||||
|
||||
Suppose $f(x,y) = f_1(x)f_2(y)$ and $R = [a_1, b_1] \times [a_2,b_2]$ is a rectangular region. Is this true?
|
||||
|
||||
$$~
|
||||
```math
|
||||
\iint_R f dA = (\int_{a_1}^{b_1} f_1(x) dx) \cdot (\int_{a_2}^{b_2} f_2(y) dy).
|
||||
~$$
|
||||
```
|
||||
|
||||
```julia; hold=true; echo=false
|
||||
choices = [
|
||||
L"Yes. As an inner integral $\int_{a^2}^{b_2} f(x,y) dy = f_1(x) \int_{a_2}^{b_2} f_2(y) dy$.",
|
||||
"No."
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1517,9 +1513,9 @@ radioq(choices, ans)
|
||||
|
||||
Which integrals of the following are $0$ by symmetry? Let $R$ be the unit disc.
|
||||
|
||||
$$~
|
||||
```math
|
||||
a = \iint_R x dA, \quad b = \iint_R (x^2 + y^2) dA, \quad c = \iint_R xy dA
|
||||
~$$
|
||||
```
|
||||
|
||||
```julia; hold=true; echo=false
|
||||
choices = [
|
||||
@@ -1527,8 +1523,8 @@ L"Both $a$ and $b$",
|
||||
L"Both $a$ and $c$",
|
||||
L"Both $b$ and $c$"
|
||||
]
|
||||
ans = 2
|
||||
radioq(choices, ans)
|
||||
answ = 2
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1536,11 +1532,11 @@ radioq(choices, ans)
|
||||
|
||||
Let $R$ be the unit disc. Which integrals can be found from common geometric formulas (e.g., known formulas for the sphere, cone, pyramid, ellipse, ...)
|
||||
|
||||
$$~
|
||||
```math
|
||||
a = \iint_R (1 - (x^2+y2)) dA, \quad
|
||||
b = \iint_R (1 - \sqrt{x^2 + y^2}) dA, \quad
|
||||
c = \iint_R (1 - (x^2 + y^2)^2 dA
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
```julia; hold=true; echo=false
|
||||
@@ -1549,8 +1545,8 @@ L"Both $a$ and $b$",
|
||||
L"Both $a$ and $c$",
|
||||
L"Both $b$ and $c$"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1567,8 +1563,8 @@ raw" ``\int_0^1 \int_0^{(1-x^3)^{1/3}} 1\cdot dy dx``",
|
||||
raw" ``\int_0^1 \int_0^{(1-y^3)^{1/3}} 1\cdot dx dy``",
|
||||
raw" ``\int_0^1 \int_0^{(1-y^3)^{1/3}} 1\cdot dy dx``"
|
||||
]
|
||||
ans = 3
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ = 3
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
|
||||
@@ -1583,8 +1579,8 @@ raw" ``\int_0^b\int_{y/b}^{2-y/b} dx dy``",
|
||||
raw" ``\int_0^2\int_0^{bx} dy dx``",
|
||||
raw" ``\int_0^2 \int_0^{2b - bx} dy dx``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1598,8 +1594,8 @@ raw" ``\int_a^b \int_0^{f(x)} dy dx``",
|
||||
raw" ``\int_a^b \int_0^{f(x)} dx dy``",
|
||||
raw" ``\int_0^{f(x)} \int_a^b dx dy``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1613,8 +1609,8 @@ raw" ``G(u,v) = \langle u-v, u+v \rangle``",
|
||||
raw" ``G(u,v) = \langle u^2-v^2, u^2+v^2 \rangle``",
|
||||
raw" ``G(u,v) = \langle u-v, u \rangle``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1636,12 +1632,12 @@ Let $G(u, v) = \langle \cosh(u)\cos(v), \sinh(u)\sin(v) \rangle$. Compute the de
|
||||
|
||||
```julia; hold=true; echo=false
|
||||
choices = [
|
||||
raw" ``\sin^{2}{\left (v \right )} \cosh^{2}{\left (u \right )} + \cos^{2}{\left (v \right )} \sinh^{2}{\left (u \right )}",
|
||||
raw" ``\sin^{2}{\left (v \right )} \cosh^{2}{\left (u \right )} + \cos^{2}{\left (v \right )} \sinh^{2}{\left (u \right )}``",
|
||||
raw" ``1``",
|
||||
raw" ``\sinh(u)\cosh(v)``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1655,8 +1651,8 @@ L"It is $1$, as each is area preserving",
|
||||
L"It is $r$, as the rotation uses polar coordinates",
|
||||
L"It is $r^2 \sin(\phi)$, as the rotations use spherical coordinates"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1681,8 +1677,8 @@ L"The value $\bar{x}$ of the centroid",
|
||||
L"The value $\bar{y}$ of the centroid",
|
||||
L"The moment of inertia of $R$ about the $x$ axis"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ = 1
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
What does $B/A$ compute?
|
||||
@@ -1695,8 +1691,8 @@ L"The value $\bar{x}$ of the centroid",
|
||||
L"The value $\bar{y}$ of the centroid",
|
||||
L"The moment of inertia of $R$ about the $x$ axis"
|
||||
]
|
||||
ans = 2
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ = 2
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
|
||||
@@ -1710,6 +1706,6 @@ raw" ``dtdv``",
|
||||
raw" ``(1-2m^2)dt dv``",
|
||||
raw" ``m\sqrt{1-m^2}dt^2+(1-2m^2)dtdv -m\sqrt{1-m^2}dv^2``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
@@ -242,11 +242,9 @@ quadgk(t -> (Fₘ ∘ rₒ)(t) ⋅ rₒ'(t), 0, 1)
|
||||
|
||||
Still $0$. We will see next that this is not surprising if something about $F$ is known.
|
||||
|
||||
```julia; echo=false
|
||||
note("""
|
||||
The [Washington Post](https://www.washingtonpost.com/outlook/everything-you-thought-you-knew-about-gravity-is-wrong/2019/08/01/627f3696-a723-11e9-a3a6-ab670962db05_story.html") had an article by Richard Panek with the quote "Well, yes — depending on what we mean by 'attraction.' Two bodies of mass don’t actually exert some mysterious tugging on each other. Newton himself tried to avoid the word 'attraction' for this very reason. All (!) he was trying to do was find the math to describe the motions both down here on Earth and up there among the planets (of which Earth, thanks to Copernicus and Kepler and Galileo, was one)." The point being the formula above is a mathematical description of the force, but not an explanation of how the force actually is transferred.
|
||||
""")
|
||||
```
|
||||
!!! note
|
||||
The [Washington Post](https://www.washingtonpost.com/outlook/everything-you-thought-you-knew-about-gravity-is-wrong/2019/08/01/627f3696-a723-11e9-a3a6-ab670962db05_story.html") had an article by Richard Panek with the quote "Well, yes — depending on what we mean by 'attraction.' Two bodies of mass don’t actually exert some mysterious tugging on each other. Newton himself tried to avoid the word 'attraction' for this very reason. All (!) he was trying to do was find the math to describe the motions both down here on Earth and up there among the planets (of which Earth, thanks to Copernicus and Kepler and Galileo, was one)." The point being the formula above is a mathematical description of the force, but not an explanation of how the force actually is transferred.
|
||||
|
||||
|
||||
#### Work in a *conservative* vector field
|
||||
|
||||
@@ -432,11 +430,8 @@ p
|
||||
The flow integral is typically computed for a closed (Jordan) curve, measuring the total flow out of a region. In this case, the integral is written $\oint_C (F\cdot\hat{N})ds$.
|
||||
|
||||
|
||||
```julia; echo=false
|
||||
note(L"""
|
||||
For a Jordan curve, the positive orientation of the curve is such that the normal direction (proportional to $\hat{T}'$) points away from the bounded interior. For a non-closed path, the choice of parameterization will determine the normal and the integral for flow across a curve is dependent - up to its sign - on this choice.
|
||||
""")
|
||||
```
|
||||
!!! note
|
||||
For a Jordan curve, the positive orientation of the curve is such that the normal direction (proportional to $\hat{T}'$) points away from the bounded interior. For a non-closed path, the choice of parameterization will determine the normal and the integral for flow across a curve is dependent - up to its sign - on this choice.
|
||||
|
||||
|
||||
##### Example
|
||||
@@ -725,10 +720,10 @@ In [Surface area](../integrals/surface_area.mmd) the following formula for the s
|
||||
|
||||
Consider the transformation $(x, \theta) \rightarrow \langle x, f(x)\cos(\theta), f(x)\sin(\theta)$. This maps the region $[a,b] \times [0, 2\pi]$ *onto* the surface of revolution. As such, the surface element would be:
|
||||
|
||||
```julia; hold=true
|
||||
@syms f()::positive x::real theta::real
|
||||
```julia
|
||||
@syms 𝒇()::positive x::real theta::real
|
||||
|
||||
Phi(x, theta) = [x, f(x)*cos(theta), f(x)*sin(theta)]
|
||||
Phi(x, theta) = [x, 𝒇(x)*cos(theta), 𝒇(x)*sin(theta)]
|
||||
Jac = Phi(x, theta).jacobian([x, theta])
|
||||
v1, v2 = Jac[:,1], Jac[:,2]
|
||||
se = norm(v1 × v2)
|
||||
@@ -994,8 +989,8 @@ raw" ``\langle a, b, c\rangle / \| \langle a, b, c\rangle\|``",
|
||||
raw" ``\langle a, b, c\rangle``",
|
||||
raw" ``\langle d-a, d-b, d-c\rangle / \| \langle d-a, d-b, d-c\rangle\|``",
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
Does it depend on $d$?
|
||||
@@ -1006,8 +1001,8 @@ L"No. Moving $d$ just shifts the plane up or down the $z$ axis, but won't change
|
||||
L"Yes. Of course. Different values for $d$ mean different values for $x$, $y$, and $z$ are needed.",
|
||||
L"Yes. The gradient of $F(x,y,z) = ax + by + cz$ will be normal to the level curve $F(x,y,z)=d$, and so this will depend on $d$."
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1035,8 +1030,8 @@ raw" ``2\pi + 2\pi^2``",
|
||||
raw" ``2\pi^2``",
|
||||
raw" ``4\pi``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1062,8 +1057,8 @@ choices =[
|
||||
L"It will be $0$, as $\nabla{f}$ is orthogonal to the level curve and $\vec{r}'$ is tangent to the level curve",
|
||||
L"It will $f(b)-f(a)$ for any $b$ or $a$"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1103,8 +1098,8 @@ choices = [
|
||||
L"The field is a potential field, but the path integral around $0$ is not path dependent.",
|
||||
L"The value of $d/dt(f\circ\vec{r})=0$, so the integral should be $0$."
|
||||
]
|
||||
ans =1
|
||||
radioq(choices, ans)
|
||||
answ =1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
The function $F = \nabla{f}$ is
|
||||
@@ -1114,8 +1109,8 @@ choices = [
|
||||
"Not continuous everywhere",
|
||||
"Continuous everywhere"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1165,8 +1160,8 @@ raw" ``\int_0^{2\pi} (a\cos(t)) \cdot (b\cos(t)) dt``",
|
||||
raw" ``\int_0^{2\pi} (-b\sin(t)) \cdot (b\cos(t)) dt``",
|
||||
raw" ``\int_0^{2\pi} (a\cos(t)) \cdot (a\cos(t)) dt``"
|
||||
]
|
||||
ans=1
|
||||
radioq(choices, ans)
|
||||
answ=1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1182,8 +1177,8 @@ raw" ``\langle \cos(v), \sin(v), 1\rangle``",
|
||||
raw" ``\langle -u\sin(v), u\cos(v), 0\rangle``",
|
||||
raw" ``u\langle -\cos(v), -\sin(v), 1\rangle``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ = 1
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
Compute $\vec{v}_2 = \partial{\Phi}/\partial{u}$
|
||||
@@ -1194,8 +1189,8 @@ raw" ``\langle \cos(v), \sin(v), 1\rangle``",
|
||||
raw" ``\langle -u\sin(v), u\cos(v), 0\rangle``",
|
||||
raw" ``u\langle -\cos(v), -\sin(v), 1\rangle``"
|
||||
]
|
||||
ans = 2
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ = 2
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
Compute $\vec{v}_1 \times \vec{v}_2$
|
||||
@@ -1207,8 +1202,8 @@ raw" ``\langle \cos(v), \sin(v), 1\rangle``",
|
||||
raw" ``\langle -u\sin(v), u\cos(v), 0\rangle``",
|
||||
raw" ``u\langle -\cos(v), -\sin(v), 1\rangle``"
|
||||
]
|
||||
ans = 3
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ = 3
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
|
||||
@@ -1288,8 +1283,8 @@ raw" ``\sqrt{2}/24``",
|
||||
raw" ``2/\sqrt{24}``",
|
||||
raw" ``1/12``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1315,6 +1310,6 @@ raw" ``0``",
|
||||
raw" ``7/36``",
|
||||
raw" ``1/60``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
@@ -114,24 +114,24 @@ Let's consider now what an integral over the boundary would mean. The region, or
|
||||
|
||||
With this choice of integral over the boundary, we can see much cancellation arises were we to compute this integral for each piece, as we would have with $a=x_0 < x_1 < \cdots x_{n-1} < x_n=b$:
|
||||
|
||||
$$~
|
||||
```math
|
||||
(F(x_1) - F(x_0)) + (F(x_2)-F(x_1)) + \cdots + (F(x_n) - F(x_{n-1})) = F(x_n) - F(x_0) = F(b) - F(a).
|
||||
~$$
|
||||
```
|
||||
|
||||
That is, with this definition for a boundary integral, the interior pieces of the microscopic approximation cancel and the total is just the integral over the oriented macroscopic boundary $\{a, b\}$.
|
||||
|
||||
But each microscopic piece can be reimagined, as
|
||||
|
||||
$$~
|
||||
```math
|
||||
F(x_{i}) - F(x_{i-1}) = \left(\frac{F(x_{i}) - F(x_{i-1})}{\Delta{x}}\right)\Delta{x}
|
||||
\approx F'(x_i)\Delta{x}.
|
||||
~$$
|
||||
```
|
||||
|
||||
The approximation could be exact were the mean value theorem used to identify a point in the interval, but we don't pursue that, as the key point is the right hand side is a Riemann sum approximation for a *different* integral, in this case the integral $\int_a^b F'(x) dx$. Passing from the microscopic view to an infinitesimal view, the picture gives two interpretations, leading to the Fundamental Theorem of Calculus:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\int_a^b F'(x) dx = F(b) - F(a).
|
||||
~$$
|
||||
```
|
||||
|
||||
The three theorems of this section, Green's theorem, Stokes' theorem, and the divergence theorem, can all be seen in this manner: the sum of microscopic boundary integrals leads to a macroscopic boundary integral of the entire region; whereas, by reinterpretation, the microscopic boundary integrals are viewed as Riemann sums, which in the limit become integrals of a *related* function over the region.
|
||||
|
||||
@@ -166,14 +166,14 @@ p
|
||||
|
||||
Consider the boundary integral $\oint_c F\cdot\vec{T} ds$ around the smallest (green) squares. We have seen that the *curl* at a point in a direction is given in terms of the limit. Let the plane be the $x-y$ plane, and the $\hat{k}$ direction be the one coming out of the figure. In the derivation of the curl, we saw that the line integral for circulation around the square satisfies:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\lim \frac{1}{\Delta{x}\Delta{y}} \oint_C F \cdot\hat{T}ds =
|
||||
\frac{\partial{F_y}}{\partial{x}} - \frac{\partial{F_x}}{\partial{y}}.
|
||||
~$$
|
||||
```
|
||||
|
||||
If the green squares are small enough, then the line integrals satisfy:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\oint_C F \cdot\hat{T}ds
|
||||
\approx
|
||||
\left(
|
||||
@@ -181,15 +181,15 @@ $$~
|
||||
-
|
||||
\frac{\partial{F_x}}{\partial{y}}
|
||||
\right) \Delta{x}\Delta{y} .
|
||||
~$$
|
||||
```
|
||||
|
||||
We interpret the right hand side as a Riemann sum approximation for the $2$ dimensional integral of the function $f(x,y) = \frac{\partial{F_x}}{\partial{y}} - \frac{\partial{F_y}}{\partial{x}}=\text{curl}(F)$, the two-dimensional curl. Were the green squares continued to fill out the large blue square, then the sum of these terms would approximate the integral
|
||||
|
||||
$$~
|
||||
```math
|
||||
\iint_S f(x,y) dA = \iint_S
|
||||
\left(\frac{\partial{F_y}}{\partial{x}} - \frac{\partial{F_x}}{\partial{y}}\right) dA
|
||||
= \iint_S \text{curl}(F) dA.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
However, the microscopic boundary integrals have cancellations that lead to a macroscopic boundary integral. The sum of $\oint_C F \cdot\hat{T}ds$ over the $4$ green squares will be equal to $\oint_{C_r} F\cdot\hat{T}ds$, where $C_r$ is the red square, as the interior line integral pieces will all cancel off. The sum of $\oint_{C_r} F \cdot\hat{T}ds$ over the $4$ red squares will equal $\oint_{C_b} F \cdot\hat{T}ds$, where $C_b$ is the oriented path around the blue square, as again the interior line pieces will cancel off. Etc.
|
||||
@@ -217,10 +217,10 @@ Some examples, following Strang, are:
|
||||
|
||||
Let $F(x,y) = \langle -y, x\rangle$. Then $\frac{\partial{F_y}}{\partial{x}} - \frac{\partial{F_x}}{\partial{y}}=2$, so
|
||||
|
||||
$$~
|
||||
```math
|
||||
\frac{1}{2}\oint_C F\cdot\hat{T}ds = \frac{1}{2}\oint_C (xdy - ydx) =
|
||||
\iint_D dA = A(D).
|
||||
~$$
|
||||
```
|
||||
|
||||
This gives a means to compute the area of a region by integrating around its boundary.
|
||||
|
||||
@@ -235,29 +235,29 @@ F(v) = F(v...)
|
||||
|
||||
r(t) = [a*cos(t),b*sin(t)]
|
||||
|
||||
@syms a::positive b::positive
|
||||
@syms a::positive b::positive t
|
||||
(1//2) * integrate( F(r(t)) ⋅ diff.(r(t),t), (t, 0, 2PI))
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
|
||||
$$~
|
||||
```math
|
||||
\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}
|
||||
~$$
|
||||
```
|
||||
|
||||
as on $A$, $y=0$ and $dy=0$ and on $B$, $x=0$ and $dx=0$.
|
||||
|
||||
On $C$ we have $\vec{r}(t) = (0, b) + t\cdot(1,-b/a) =\langle t, b-(bt)/a\rangle$ from $t=a$ to $0$
|
||||
|
||||
$$~
|
||||
```math
|
||||
\int_C F\cdot \frac{d\vec{r}}{dt} dt =
|
||||
\int_a^0 \langle -b + (bt)/a), t\rangle\cdot\langle 1, -b/a\rangle dt
|
||||
= \int_a^0 -b dt = -bt\mid_{a}^0 = ba.
|
||||
~$$
|
||||
```
|
||||
|
||||
Dividing by $1/2$ give the familiar answer $A=(1/2) a b$.
|
||||
|
||||
@@ -274,12 +274,17 @@ 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:
|
||||
|
||||
$$~
|
||||
0 = \iint_D 0 dA =
|
||||
\iint_D \left(\partial{F_y}/\partial{x} - \partial{F_x}/\partial{y}\right)dA =
|
||||
\oint_C F \cdot \hat{T} ds =
|
||||
```math
|
||||
\begin{align*}
|
||||
0 &= \iint_D 0 dA \\
|
||||
&=
|
||||
\iint_D \left(\partial{F_y}/\partial{x} - \partial{F_x}/\partial{y}\right)dA \\
|
||||
&=
|
||||
\oint_C F \cdot \hat{T} ds \\
|
||||
&=
|
||||
\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.
|
||||
|
||||
@@ -293,14 +298,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:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\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}
|
||||
~$$
|
||||
```
|
||||
|
||||
It is not the case that $\partial{F_y}/\partial{x} - \partial{F_x}/\partial{y}=0$, so this vector field is *not* conservative.
|
||||
|
||||
@@ -326,9 +331,9 @@ diff(Fy, x) - diff(Fx, y) |> simplify
|
||||
|
||||
As the integrand is ``00``, $\iint_D \left( \partial{F_y}/{\partial{x}}-\partial{F_xy}/{\partial{y}}\right)dA = 0$, as well. But,
|
||||
|
||||
$$~
|
||||
```math
|
||||
F\cdot\hat{T} = \frac{R}{R\cdot{R}} \cdot \frac{R}{R\cdot{R}} = \frac{R\cdot{R}}{(R\cdot{R})^2} = \frac{1}{R\cdot{R}},
|
||||
~$$
|
||||
```
|
||||
|
||||
so $\oint_C F\cdot\hat{T}ds = 2\pi$, $C$ being the unit circle so $R\cdot{R}=1$.
|
||||
|
||||
@@ -357,24 +362,24 @@ 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:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align}
|
||||
\int_A (xdy - ydx) &= a f(a)\\
|
||||
\int_C (xdy - ydx) &= b(-f(b))\\
|
||||
\int_D (xdy - ydx) &= 0\\
|
||||
\end{align}
|
||||
~$$
|
||||
```
|
||||
|
||||
Finally the integral over $B$, using integration by parts:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\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}
|
||||
~$$
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
@@ -403,16 +408,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:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\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\\
|
||||
\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}
|
||||
~$$
|
||||
```
|
||||
|
||||
(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.)
|
||||
|
||||
@@ -425,22 +430,22 @@ Green's theorem has a complement in terms of flow across $C$. As $C$ is positive
|
||||
|
||||
Let $F = \langle F_x, F_y \rangle$ and $G = \langle F_y, -F_x \rangle$, then $G\cdot\hat{T} = -F\cdot\hat{N}$. The curl formula applied to $G$ becomes
|
||||
|
||||
$$~
|
||||
```math
|
||||
\frac{\partial{G_y}}{\partial{x}} - \frac{\partial{G_x}}{\partial{y}} =
|
||||
\frac{\partial{-F_x}}{\partial{x}}-\frac{\partial{(F_y)}}{\partial{y}}
|
||||
=
|
||||
-\left(\frac{\partial{F_x}}{\partial{x}} + \frac{\partial{F_y}}{\partial{y}}\right)=
|
||||
-\nabla\cdot{F}.
|
||||
~$$
|
||||
```
|
||||
|
||||
Green's theorem applied to $G$ then gives this formula for $F$:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\oint_C F\cdot\hat{N} ds =
|
||||
-\oint_C G\cdot\hat{T} ds =
|
||||
-\iint_D (-\nabla\cdot{F})dA =
|
||||
\iint_D \nabla\cdot{F}dA.
|
||||
~$$
|
||||
```
|
||||
|
||||
The right hand side integral is the $2$-dimensional divergence, so this has the interpretation that the flux through $C$ ($\oint_C F\cdot\hat{N} ds$) is the integral of the divergence. (The divergence is defined in terms of a limit of this picture, so this theorem extends the microscopic view to a bigger view.)
|
||||
|
||||
@@ -522,17 +527,17 @@ Again, the microscopic boundary integrals when added will give a macroscopic bou
|
||||
But, as seen in the derivation of the divergence, only modified for $2$ dimensions, we have
|
||||
$\nabla\cdot{F} = \lim \frac{1}{\Delta S} \oint_C F\cdot\hat{N}$, so for each cell
|
||||
|
||||
$$~
|
||||
```math
|
||||
\oint_{C_i} F\cdot\hat{N} \approx \left(\nabla\cdot{F}\right)\Delta{x}\Delta{y},
|
||||
~$$
|
||||
```
|
||||
an approximating Riemann sum for $\iint_D \nabla\cdot{F} dA$. This yields:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\oint_C (F \cdot\hat{N}) dA =
|
||||
\sum_i \oint_{C_i} (F \cdot\hat{N}) dA \approx
|
||||
\sum \left(\nabla\cdot{F}\right)\Delta{x}\Delta{y} \approx
|
||||
\iint_S \nabla\cdot{F}dA,
|
||||
~$$
|
||||
```
|
||||
|
||||
the approximation signs becoming equals signs in the limit.
|
||||
|
||||
@@ -549,11 +554,11 @@ We have the divergence is simply $a + b$ so $\iint_D (a+b)dA = (a+b)A(D) = 4(a+b
|
||||
|
||||
The integral of the flow across $C$ consists of $4$ parts. By symmetry, they all should be similar. We consider the line segment connecting $(1,-1)$ to $(1,1)$ (which has the proper counterclockwise orientation):
|
||||
|
||||
$$~
|
||||
```math
|
||||
\int_C F \cdot \hat{N} ds=
|
||||
\int_{-1}^1 \langle F_x, F_y\rangle\cdot\langle 0, 1\rangle ds =
|
||||
\int_{-1}^1 b dy = 2b.
|
||||
~$$
|
||||
```
|
||||
|
||||
Integrating across the top will give $2a$, along the bottom $2a$, and along the left side $2b$ totaling $4(a+b)$.
|
||||
|
||||
@@ -586,10 +591,10 @@ The gradient of $f=\langle v_x, v_y\rangle$ is orthogonal to the contour lines o
|
||||
|
||||
As an [example](https://en.wikipedia.org/wiki/Potential_flow#Examples_of_two-dimensional_flows) consider the following in polar coordinates:
|
||||
|
||||
$$~
|
||||
```math
|
||||
f(r, \theta) = A r^n \cos(n\theta),\quad
|
||||
g(r, \theta) = A r^n \sin(n\theta).
|
||||
~$$
|
||||
```
|
||||
|
||||
The constant $A$ just sets the scale, the parameter $n$ has a qualitative effect on the contour lines. Consider $n=2$ visualized below:
|
||||
|
||||
@@ -607,7 +612,7 @@ f(v) = f(v...); g(v)= g(v...)
|
||||
xs = ys = range(-2,2, length=50)
|
||||
p = contour(xs, ys, f∘Φ, color=:red, legend=false, aspect_ratio=:equal)
|
||||
contour!(p, xs, ys, g∘Φ, color=:blue, linewidth=3)
|
||||
pyplot()
|
||||
#pyplot()
|
||||
p
|
||||
```
|
||||
|
||||
@@ -636,29 +641,34 @@ Imagine if instead of the retro labeling, a rectangular grid were drawn on the
|
||||
|
||||
Now imagine the popcorn expanding, but rather than worry about burning, focusing instead on what happens to the integral of the curl in the direction of the normal, we have
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla\times{F} \cdot\hat{N} = \lim \frac{1}{\Delta{S}} \oint_C F\cdot\hat{T} ds
|
||||
\approx \frac{1}{\Delta{S}} F\cdot\hat{T} \Delta{s}.
|
||||
~$$
|
||||
```
|
||||
|
||||
This gives the series of approximations:
|
||||
|
||||
$$~
|
||||
\oint_C F\cdot\hat{T} ds =
|
||||
\sum \oint_{C_i} F\cdot\hat{T} ds \approx
|
||||
\sum F\cdot\hat{T} \Delta s \approx
|
||||
\sum \nabla\times{F}\cdot\hat{N} \Delta{S} \approx
|
||||
```math
|
||||
\begin{align*}
|
||||
\oint_C F\cdot\hat{T} ds &=
|
||||
\sum \oint_{C_i} F\cdot\hat{T} ds \\
|
||||
&\approx
|
||||
\sum F\cdot\hat{T} \Delta s \\
|
||||
&\approx
|
||||
\sum \nabla\times{F}\cdot\hat{N} \Delta{S} \\
|
||||
&\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:
|
||||
|
||||
|
||||
> **Stokes' theorem**: Let $S$ be an orientable smooth surface in $R^3$ with boundary $C$, $C$ oriented so that the chosen normal for $S$ agrees with the right-hand rule for $C$'s orientation. Then *if* $F$ has continuous partial derivatives
|
||||
> $$~
|
||||
> ```math
|
||||
> \oint_C F \cdot\hat{T} ds = \iint_S (\nabla\times{F})\cdot\hat{N} dA.
|
||||
> ~$$
|
||||
> ```
|
||||
|
||||
|
||||
Green's theorem is an immediate consequence upon viewing the region in $R^2$ as a surface in $R^3$ with normal $\hat{k}$.
|
||||
@@ -707,51 +717,51 @@ integrate(integrandₛ, (t, 0, 2PI))
|
||||
|
||||
Ampere's circuital law relates the line integral of the magnetic field to the induced current through:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\oint_C B\cdot\hat{T} ds = \mu_0 I.
|
||||
~$$
|
||||
```
|
||||
|
||||
The goal here is to re-express this integral law to produce a law at each point of the field. Let $S$ be a surface with boundary $C$, Let $J$ be the current density - $J=\rho v$, with $\rho$ the density of the current (not time-varying) and $v$ the velocity. The current can be re-expressed as $I = \iint_S J\cdot\hat{n}dA$. (If the current flows through a wire and $S$ is much bigger than the wire, this is still valid as $\rho=0$ outside of the wire.)
|
||||
|
||||
We then have:
|
||||
|
||||
|
||||
$$~
|
||||
```math
|
||||
\mu_0 \iint_S J\cdot\hat{N}dA =
|
||||
\mu_0 I =
|
||||
\oint_C B\cdot\hat{T} ds =
|
||||
\iint_S (\nabla\times{B})\cdot\hat{N}dA.
|
||||
~$$
|
||||
```
|
||||
|
||||
As $S$ and $C$ are arbitrary, this implies the integrands of the surface integrals are equal, or:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla\times{B} = \mu_0 J.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
##### Example: Faraday's law
|
||||
|
||||
(Strang) Suppose $C$ is a wire and there is a time-varying magnetic field $B(t)$. Then Faraday's law says the *flux* passing within $C$ through a surface $S$ with boundary $C$ of the magnetic field, $\phi = \iint B\cdot\hat{N}dS$, induces an electric field $E$ that does work:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\oint_C E\cdot\hat{T}ds = -\frac{\partial{\phi}}{\partial{t}}.
|
||||
~$$
|
||||
```
|
||||
|
||||
Faraday's law is an empirical statement. Stokes' theorem can be used to produce one of Maxwell's equations. For any surface $S$, as above with its boundary being $C$, we have both:
|
||||
|
||||
$$~
|
||||
```math
|
||||
-\iint_S \left(\frac{\partial{B}}{\partial{t}}\cdot\hat{N}\right)dS =
|
||||
-\frac{\partial{\phi}}{\partial{t}} =
|
||||
\oint_C E\cdot\hat{T}ds =
|
||||
\iint_S (\nabla\times{E}) dS.
|
||||
~$$
|
||||
```
|
||||
|
||||
This is true for any capping surface for $C$. Shrinking $C$ to a point means it will hold for each point in $R^3$. That is:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla\times{E} = -\frac{\partial{B}}{\partial{t}}.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
##### Example: Conservative fields
|
||||
@@ -783,20 +793,20 @@ curl(F(x,y,z), [x,y,z])
|
||||
|
||||
We need $\phi$ with $\partial{\phi}/\partial{x} = F_x = yz^2$. To that end, we integrate in $x$:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\phi(x,y,z) = \int yz^2 dx = xyz^2 + g(y,z),
|
||||
~$$
|
||||
```
|
||||
the function $g(y,z)$ is a "constant" of integration (it doesn't depend on $x$). That $\partial{\phi}/\partial{x} = F_x$ is true is easy to verify. Now, consider the partial in $y$:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\frac{\partial{\phi}}{\partial{y}} = xz^2 + \frac{\partial{g}}{\partial{y}} = F_y = xz^2.
|
||||
~$$
|
||||
```
|
||||
|
||||
So we have $\frac{\partial{g}}{\partial{y}}=0$ or $g(y,z) = h(z)$, some constant in $y$. Finally, we must have $\partial{\phi}/\partial{z} = F_z$, or
|
||||
|
||||
$$~
|
||||
```math
|
||||
\frac{\partial{\phi}}{\partial{z}} = 2xyz + h'(z) = F_z = 2xyz,
|
||||
~$$
|
||||
```
|
||||
|
||||
So $h'(z) = 0$. This value can be any constant, even $0$ which we take, so that $g(y,z) = 0$ and $\phi(x,y,z) = xyz^2$ is a scalar potential for $F$.
|
||||
|
||||
@@ -847,18 +857,18 @@ However, the function $F(x,y,z) = \langle x, y,z\rangle/\sqrt{x^2+y^2+z^2}$ has
|
||||
The divergence theorem is a consequence of a simple observation. Consider two adjacent cubic regions that share a common face.
|
||||
The boundary integral, $\oint_S F\cdot\hat{N} dA$, can be computed for each cube. The surface integral requires a choice of normal, and the convention is to use the outward pointing normal. The common face of the two cubes has *different* outward pointing normals, the difference being a minus sign. As such, the contribution of the surface integral over this face for one cube is *cancelled* out by the contribution of the surface integral over this face for the adjacent cube. As with Green's theorem, this means for a cubic partition, that only the contribution over the boundary is needed to compute the boundary integral. In formulas, if $V$ is a $3$ dimensional cubic region with boundary $S$ and it is partitioned into smaller cubic subregions, $V_i$ with surfaces $S_i$, we have:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\oint_S F\cdot{N} dA = \sum \oint_{S_i} F\cdot{N} dA.
|
||||
~$$
|
||||
```
|
||||
|
||||
If the partition provides a microscopic perspective, then the divergence approximation $\nabla\cdot{F} \approx (1/\Delta{V_i}) \oint_{S_i} F\cdot{N} dA$ can be used to say:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\oint_S F\cdot{N} dA =
|
||||
\sum \oint_{S_i} F\cdot{N} dA \approx
|
||||
\sum (\nabla\cdot{F})\Delta{V_i} \approx
|
||||
\iiint_V \nabla\cdot{F} dV,
|
||||
~$$
|
||||
```
|
||||
|
||||
the last approximation through a Riemann sum approximation. This heuristic leads to:
|
||||
|
||||
@@ -965,29 +975,29 @@ 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:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\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}
|
||||
~$$
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
$$~
|
||||
```math
|
||||
\oint_S (\rho v)\cdot\hat{N} dS,
|
||||
~$$
|
||||
```
|
||||
|
||||
using the customary outward pointing normal for the orientation of $S$.
|
||||
|
||||
So we have:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\iiint_V \frac{\partial{\rho}}{\partial{t}} dV =
|
||||
-\oint_S (\rho v)\cdot\hat{N} dS = - \iiint_V \nabla\cdot\left(\rho v\right)dV.
|
||||
~$$
|
||||
```
|
||||
|
||||
The last equality by the divergence theorem, the minus sign as a positive change in amount within $V$ means flow *opposite* the outward pointing normal for $S$.
|
||||
|
||||
@@ -995,9 +1005,9 @@ The volume $V$ was arbitrary. While it isn't the case that two integrals being e
|
||||
|
||||
That is, under the *assumptions* that material is conserved and density is continuous a continuity equation can be derived from the divergence theorem:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla\cdot(\rho v) = - \frac{\partial{\rho}}{dt}.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -1018,11 +1028,11 @@ The simplification done by SymPy masks the presence of $R^{-5/2}$ when taking th
|
||||
|
||||
*Were* the divergence theorem applicable, then the integral of $F$ over the unit sphere would mean:
|
||||
|
||||
$$~
|
||||
```math
|
||||
0 = \iiint_V \nabla\cdot{F} dV =
|
||||
\oint_S F\cdot{N}dS = \oint_S \frac{R}{\|R\|^3} \cdot{R} dS =
|
||||
\oint_S 1 dS = 4\pi.
|
||||
~$$
|
||||
```
|
||||
|
||||
Clearly, as $0$ is not equal to $4\pi$, the divergence theorem can not apply.
|
||||
|
||||
@@ -1045,8 +1055,8 @@ L"We must have $\text{curl}(F) = 1$",
|
||||
L"We must have $\text{curl}(F) = 0$",
|
||||
L"We must have $\text{curl}(F) = x$"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1074,8 +1084,8 @@ raw" ``(1/2) \int r d\theta``",
|
||||
raw" ``\int r^2 d\theta``",
|
||||
raw" ``(1/2) \int r^2d\theta``"
|
||||
]
|
||||
ans=4
|
||||
radioq(choices, ans)
|
||||
answ=4
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1094,8 +1104,8 @@ raw" ``3\pi/8``",
|
||||
raw" ``\pi/4``",
|
||||
raw" ``\pi/2``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1110,8 +1120,8 @@ raw" ``0``",
|
||||
raw" ``1``",
|
||||
raw" ``2``"
|
||||
]
|
||||
ans =1
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ =1
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
As the curl is a constant, say $c$, we have $\iint_S (\nabla\times{F}) dS = c \cdot 1$. This is?
|
||||
@@ -1122,8 +1132,8 @@ raw" ``0``",
|
||||
raw" ``1``",
|
||||
raw" ``2``"
|
||||
]
|
||||
ans =1
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ =1
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
To integrate around the boundary we have ``4`` terms: the path $A$ connecting $(0,0)$ to $(1,0)$ (on the $x$ axis), the path $B$ connecting $(1,0)$ to $(1,1)$, the path $C$ connecting $(1,1)$ to $(0,1)$, and the path $D$ connecting $(0,1)$ to $(0,0)$ (along the $y$ axis).
|
||||
@@ -1132,8 +1142,8 @@ Which path has tangent $\hat{j}$?
|
||||
|
||||
```julia; hold=true; echo=false
|
||||
choices = ["`` A``","`` B``"," ``C``"," ``D``"]
|
||||
ans = 2
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ = 2
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
Along path $C$, $F(x,y) = [1,x]$ and $\hat{T}=-\hat{i}$ so $F\cdot\hat{T} = -1$. The path integral $\int_C (F\cdot\hat{T})ds = -1$. What is the value of the path integral over $A$?
|
||||
@@ -1144,8 +1154,8 @@ raw" ``-1``",
|
||||
raw" ``0``",
|
||||
raw" ``1``"
|
||||
]
|
||||
ans = 3
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ = 3
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
What is the integral over the oriented boundary of $S$?
|
||||
@@ -1156,8 +1166,8 @@ raw" ``0``",
|
||||
raw" ``1``",
|
||||
raw" ``2``"
|
||||
]
|
||||
ans =1
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ =1
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
|
||||
@@ -1171,8 +1181,8 @@ choices = [
|
||||
L"They are the same, as Green's theorem applies to the area, $S$, between $C_1$ and $C_2$ so $\iint_S \nabla\cdot{F}dA = 0$."
|
||||
L"They differ by a minus sign, as Green's theorem applies to the area, $S$, between $C_1$ and $C_2$ so $\iint_S \nabla\cdot{F}dA = 0$."
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1185,8 +1195,8 @@ choices = [
|
||||
L"Also $2\pi$, as Green's theorem applies to the region formed by the square minus the circle and so the overall flow integral around the boundary is $0$, so the two will be the same.",
|
||||
L"It is $-2\pi$, as Green's theorem applies to the region formed by the square minus the circle and so the overall flow integral around the boundary is $0$, so the two will have opposite signs, but the same magnitude."
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1199,8 +1209,8 @@ raw" ``4/3 \pi``",
|
||||
raw" ``4\pi``",
|
||||
raw" ``\pi``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1214,8 +1224,8 @@ raw" ``1``",
|
||||
raw" ``2``",
|
||||
raw" ``3``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ = 1
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
|
||||
@@ -1229,8 +1239,8 @@ raw" ``\log(\rho)``",
|
||||
raw" ``1/\rho``",
|
||||
raw" ``\rho``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
Based on this information, for $S$ a surface not including the origin with boundary $C$, a simple closed curve, what is $\oint_C F\cdot\hat{T}ds$?
|
||||
@@ -1240,8 +1250,8 @@ choices = [
|
||||
L"It is $0$, as, by Stoke's theorem, it is equivalent to $\iint_S (\nabla\times\nabla{\phi})dS = \iint_S 0 dS = 0$.",
|
||||
L"It is $2\pi$, as this is the circumference of the unit circle"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1254,8 +1264,8 @@ raw" ``2\pi``",
|
||||
raw" ``2``",
|
||||
raw" ``0``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1274,8 +1284,8 @@ choices = [
|
||||
"the field is *not* conservative.",
|
||||
"the field *is* conservative"
|
||||
]
|
||||
ans=1
|
||||
radioq(choices, ans)
|
||||
answ=1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1311,8 +1321,8 @@ choices = [
|
||||
"The maximum number in a row",
|
||||
"The row number plus 1"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1321,10 +1331,10 @@ radioq(choices, ans)
|
||||
|
||||
In 1846, Cauchy proved
|
||||
|
||||
$$~
|
||||
```math
|
||||
\int\left(p\frac{dx}{ds} + q \frac{dy}{ds}\right)ds =
|
||||
\pm\iint\left(\frac{\partial{p}}{\partial{y}} - \frac{\partial{q}}{\partial{x}}\right)dx dy.
|
||||
~$$
|
||||
```
|
||||
|
||||
This is a form of:
|
||||
|
||||
@@ -1334,6 +1344,6 @@ choices = [
|
||||
"The divergence (Gauss') theorem",
|
||||
"Stokes' theorem"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ = 1
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user