Title: Vector Calculus
Tags: VC13 VC1 VC10 VC4 VC11 VC2 VC12 VC7 VC3 VC5 VC15 VC6 VC8 VC9 VC14

Q: Product rules for vectors
A: \begin{prop}
  \begin{align*}
    \frac{\d}{\d t}(f\mathbf{g}) &= \frac{\d f}{\d t}\mathbf{g} + f\frac{\d \mathbf{g}}{\d t}\\
    \frac{\d}{\d t}(\mathbf{g}\cdot \mathbf{h}) &= \frac{\d \mathbf{g}}{\d t}\cdot \mathbf{h} + \mathbf{g}\cdot \frac{\d \mathbf{h}}{\d t}\\
    \frac{\d}{\d t}(\mathbf{g}\times \mathbf{h}) &= \frac{\d \mathbf{g}}{\d t}\times \mathbf{h} + \mathbf{g}\times \frac{\d \mathbf{h}}{\d t}
  \end{align*}
\end{prop}
\begin{proof}
\begin{align*}
\frac{\d}{\d t}(f\mathbf{g})&=\sum_i\frac{\d}{\d t} (fg_i) \\
&=\sum_i\frac{\d f}{\d t}g_i+ f\frac{\d g}{\d t} \\
&=\frac{\d f}{\d t}\sum_i g_i+ f\sum_i\frac{\d g}{\d t} \\
&=\frac{\d f}{\d t}\mathbf{g} + f\frac{\d \mathbf{g}}{\d t}
\end{align*}
\begin{align*}
\frac{\d}{\d t}(\mathbf{g}\cdot \mathbf{h})&=\frac{\d}{\d t} (g_ih_i) \\
&=\frac{\d g_i}{\d t}h_i+ g_i\frac{\d h_i}{\d t} \\
&= \frac{\d \mathbf{g}}{\d t}\cdot \mathbf{h} + \mathbf{g}\cdot \frac{\d \mathbf{h}}{\d t}
\end{align*}
\begin{align*}
 \frac{\d}{\d t}(\mathbf{g}\times \mathbf{h})&=\sum_i  \frac{\d}{\d t} \epsilon_{ijk} g_jh_k \\
&=\sum_i  \epsilon_{ijk}\left( \frac{\d g_j}{\d t}h_k  + g_j\frac{\d h_k}{\d t}\right) \\
&= \frac{\d \mathbf{g}}{\d t}\times \mathbf{h} + \mathbf{g}\times \frac{\d \mathbf{h}}{\d t}
\end{align*}
\end{proof}

Q: Gradient of a scalar function
A: A scalar function $f(\mathbf{r})$ is \emph{differentiable} at $\mathbf{r}$ if
  \[
    \delta f \stackrel{\text{def}}{=} f(\mathbf{r} + \delta \mathbf{r}) - f(\mathbf{r}) = (\nabla f)\cdot \delta \mathbf{r} + o(\delta \mathbf{r})
  \]
  for some vector $\nabla f$, the \emph{gradient} of $f$ at $\mathbf{r}$.
Equivalently, in terms of the directional derivative the gradient satisfies
\[
    \lim_{h \to 0} \frac{1}{h}[f(\mathbf{r} + h\mathbf{n}) - f(\mathbf{r})]=\mathbf{n}\cdot \nabla f.
  \]
Or componentwise, the gradient is
  \[
    \nabla f = \frac{\partial f}{\partial x_i}\mathbf{e}_i.
  \]

Q: Limit of a vector
A: $\mathbf{v}\to \mathbf{c}$ iff $|\mathbf{v} - \mathbf{c}| \to \mathbf{0}$ iff $\forall i: v_i\to c_i$.
Similarly, $f(\mathbf{r}) = o(\mathbf{r})$ means $\frac{|f(\mathbf{r})|}{|\mathbf{r}|} \to 0$ as $\mathbf{r}\to \mathbf{0}$.

Q: Chain rule for scalar functions
A: Now suppose we have a scalar function $f(\mathbf{r})$ and we want to consider the rate of change along a path $\mathbf{r}(u)$. A change $\delta u$ produces a change $\delta \mathbf{r} = \mathbf{r}' \delta u + o(\delta u)$, and
\[
  \delta f = \nabla f\cdot \delta \mathbf{r} + o(|\delta \mathbf{r}|) = \nabla f\cdot \mathbf{r}'(u)\delta u + o(\delta u).
\]
This shows that $f$ is differentiable as a function of $u$ and given a function $f(\mathbf{r}(u))$,
  \[
    \frac{\d f}{\d u} = \nabla f\cdot \frac{\d \mathbf{r}}{\d u} = \frac{\partial f}{\partial x_i} \frac{\d x_i}{\d u}.
  \]
Note that if we drop the $\d u$, we simply get
\[
  \d f = \nabla f\cdot \d \mathbf{r} = \frac{\partial f}{\partial x_i}\d x_i,
\]
which is the definition of differentiability of a scalar function.

Q: Derivative of vector field
A: A vector field $\mathbf{F}: \R^n \to \R^m$ is differentiable if
  \[
    \delta \mathbf{F} \stackrel{def}{=} \mathbf{F}(\mathbf{x} + \delta\mathbf{x}) - \mathbf{F}(\delta\mathbf{x}) = M\delta\mathbf{x} + o(\delta \mathbf{x})
  \]
  for some $n\times m$ matrix $M$. $M$ is the \emph{derivative} of $\mathbf{F}$.
Given an arbitrary function $\mathbf{F}: \R^n \to \R^m$ that maps $\mathbf{x}\mapsto \mathbf{y}$ and a choice of basis, we can write $\mathbf{F}$ as a set of $m$ functions $y_j = F_j(\mathbf{x})$ such that $\mathbf{y} = (y_1, y_2, \cdots, y_m)$. Then
\[
  \d y_j = \frac{\partial F_j}{\partial x_i} \d x_i.
\]
and we can write the derivative as
  \[
    M_{ji} =\frac{\partial y_j}{\partial x_i}.
  \]

Q: Smooth function
A: A function is \emph{smooth} if it can be differentiated any number of times. This requires that all partial derivatives exist and are totally symmetric in $i, j$ and $k$ (ie. the differential operator is commutative).

Q: Chain Rule for vector fields
A: Suppose $g: \R^p\to\R^n$ and $f: \R^n \to \R^m$. Suppose that the coordinates of the vectors in $\R^p, \R^n$ and $\R^m$ are $u_a, x_i$ and $y_r$ respectively. By the chain rule,
  \[
    \frac{\partial y_r}{\partial u_a} = \frac{\partial y_r}{\partial x_i}\frac{\partial x_i}{\partial u_a},
  \]
  with summation implied. Writing in matrix form,
  \[
    M(f\circ g)_{ra} = M(f)_{ri}M(g)_{ia}.
  \]
  Alternatively, in operator form,
  \[
    \frac{\partial}{\partial u_a} = \frac{\partial x_i}{\partial u_a}\frac{\partial}{\partial x_i}.
  \]

Q: Inverse rule for differentiation of vector fields
A: Suppose $g, f: \R^n \to \R^n$ are inverse functions, ie. $g\circ f = f\circ g = \id$. Suppose that $f(\mathbf{x}) =\mathbf{y}$ and $g(\mathbf{y}) = \mathbf{x}$.
Since the derivative of the identity function is the identity matrix, we must have
\[
  M(f\circ g) = I.
\]
Therefore we know that
\[
  M(g) = M(f)^{-1}.
\]
We derive this result more formally by noting
\[
  \frac{\partial y_b}{\partial y_a} = \delta_{ab}.
\]
So by the chain rule,
\[
  \frac{\partial y_b}{\partial x_i}\frac{\partial x_i}{\partial y_a} = \delta_{ab},
\]
ie. $M(f\circ g) = I$.
In the $n = 1$ case, it is the familiar result that $\d u/\d x = 1/(\d x/\d u)$.

Q: Polar coordinates
A: The plane polar coordinates $\rho, \varphi$ are defined by
\[
  x_1 = \rho\cos\varphi, \quad x_2 = \rho\sin \varphi.
\]
\[
  \mathbf{e}_\rho = \cos \varphi\, \mathbf{e}_1 + \sin \varphi\, \mathbf{e}_2,\quad \mathbf{e}_\varphi = -\sin \varphi\, \mathbf{e}_1 + \cos \varphi\, \mathbf{e}_2.
\]
In three dimensions, we have cylindrical polars and spherical polars.
\begin{center}
  \begin{tabularx}{\textwidth}{XX}
    \toprule
    \multicolumn{1}{c}{Cylindrical polars} & \multicolumn{1}{c}{Spherical polars}\\
    \midrule
    \multicolumn{2}{c}{Conversion formulae}\\
    \midrule
    $x_1 = \rho \cos \varphi$ & $x_1 = r\sin \theta\cos \varphi$\\
    $x_2 = \rho \sin \varphi$ & $x_2 = r\sin \theta \sin \varphi$\\
    $x_3 = z$ & $x_3 = r\cos\theta$\\
    \midrule
    \multicolumn{2}{c}{Basis vectors}\\
    \midrule
    $\mathbf{e}_\rho = (\cos\varphi, \sin \varphi, 0)$ & $\mathbf{e}_r = (\sin\theta\cos\varphi, \sin \theta\sin \varphi , \cos \theta)$\\
    $\mathbf{e}_\varphi = (-\sin \varphi, \cos \varphi, 0)$ & $\mathbf{e}_\varphi = (-\sin \varphi, \cos \varphi, 0)$\\
    $\mathbf{e}_z = (0, 0, 1)$ & $\mathbf{e}_\theta = (\cos \theta\cos \varphi, \cos\theta\sin\varphi, -\sin \theta)$\\
    \bottomrule
  \end{tabularx}
\end{center}

Q: Parametrisation of curve
A: Given a curve $C$ in $\R^n$, a \emph{parametrisation} of it is a continuous and invertible function $\mathbf{r}: D\to \R^n$ for some $D\subseteq \R$ whose image is $C$.
  $\mathbf{r}'(u)$ is a vector tangent to the curve at each point.
A parametrization is \emph{regular} if $\mathbf{r}'(u) \not= 0$ for all $u$.

Q: Arc length
A: If we change $u$ (and hence $\mathbf{r}(u)$) by a small amount, then the distance $|\delta \mathbf{r}|$ is roughly equal to the change in arclength $\delta s$. So $\delta s = |\delta \mathbf{r}| + o(\delta \mathbf{r})$.
Then
  \[
    \frac{\d s}{\d u} = \pm \left|\frac{\d \mathbf{r}}{\d u}\right| = \pm |\mathbf{r}'(u)|
  \]
  with the sign depending on whether it is in the direction of increasing or decreasing arclength.
We can change parametrisation of $\mathbf{r}$ by taking an invertible smooth function $u\mapsto \tilde{u}$, and have a new parametrization $\mathbf{r}(\tilde{u}) = \mathbf{r}(\tilde{u}(u))$. Then by the chain rule,
\begin{align*}
  \frac{\d \mathbf{r}}{\d u} &= \frac{\d \mathbf{r}}{\d \tilde{u}} \frac{\d \tilde{u}}{\d u}\\
  \frac{\d \mathbf{r}}{\d \tilde{u}} &= \frac{\d \mathbf{r}}{\d u}/ \frac{\d \tilde{u}}{\d u}
\end{align*}
It is often convenient to use the arclength $s$ as the parameter. Then the tangent vector will always have unit length since
\[
  |\mathbf{r}'(s)| = \frac{\d s}{\d s} = 1.
\]
We call $\d s = \pm |\mathbf{r}'(u)| \d u$ the scalar line element.

Q: Line Integral
A: The \emph{line integral} of a smooth vector field $\mathbf{F}(\mathbf{r})$ along a path $C$ parametrised by $\mathbf{r}(u)$ with along the direction (orientation) $ \mathbf{r}(\alpha)\to \mathbf{r}(\beta)$ is
  \[
    \int_C \mathbf{F}(\mathbf{r})\cdot \d \mathbf{r} = \int_\alpha^\beta \mathbf{F}(\mathbf{r}(u))\cdot \mathbf{r}'(u)\; \d u.
  \]
  We say $\d \mathbf{r} = \mathbf{r}'(u) \d u$ is the \emph{line element} on $C$. Note that the upper and lower limits of the integral are the end point and start point respectively.
We can also use the arclength $s$ as parameter. Since $\d \mathbf{r} = \mathbf{t}\;\d s$, with $\mathbf{t}$ being the unit tangent vector, we have
\[
  \int_C \mathbf{F}\cdot \d \mathbf{r} = \int_C \mathbf{F}\cdot \mathbf{t}\;\d s.
\]

Q: Work done moving along a path through a force field
A: Suppose we are moving a particle from $\mathbf{a}$ to $\mathbf{b}$ along a curve $C$ under a force field $\mathbf{F}$. Then we may divide the curve into many small segments $\delta \mathbf{r}$. Then for each segment, the force experienced is $\mathbf{F}(\mathbf{r})$ and the work done is $\mathbf{F}(\mathbf{r})\cdot \delta\mathbf{r}$. Then the total work done across the curve is given by the line integral
\[
  W = \int_C \mathbf{F}(\mathbf{r})\cdot \d \mathbf{r}.
\]
Consider a point particle moving under $\mathbf{F}(\mathbf{r})$ according to Newton's second law: $\mathbf{F}(\mathbf{r}) = m\ddot{\mathbf{r}}$.
Since the kinetic energy is defined as
\[
  T(t) = \frac{1}{2}m\dot{\mathbf{r}}^2,
\]
the rate of change of energy is
\[
  \frac{\d}{\d t}T(t) = m\dot{\mathbf{r}}\cdot \ddot{\mathbf{r}} = \mathbf{F}\cdot \mathbf{r}.
\]
Suppose the path of particle is a curve $C$ from $\mathbf{a} = \mathbf{r}(\alpha)$ to $\mathbf{b} = \mathbf{r}(\beta)$, Then
\[
  T(\beta) - T(\alpha) = \int_\alpha^\beta \frac{\d T}{\d t} \;\d t = \int_\alpha^\beta \mathbf{F}\cdot \dot{\mathbf{r}}\;\d t = \int_C \mathbf{F}\cdot \d \mathbf{r}.
\]
So the work done on the particle is the change in kinetic energy.

Q: Closed curve
A: A \emph{closed curve} is a curve with the same start and end point. The line integral along a closed curve is written as $\oint$ and is called the \emph{circulation} of $\mathbf{F}$ around $C$.

Q: Piecewise smooth curve
A: A \emph{piecewise smooth curve} is a curve $C = C_1 + C_2 + \cdots + C_n$ with all $C_i$ smooth with regular parametrisations. The line integral over a piecewise smooth $C$ is
  \[
    \int_C \mathbf{F}\cdot \d \mathbf{r} = \int_{C_1} \mathbf{F}\cdot \d \mathbf{r} + \int_{C_2} \mathbf{F}\cdot \d \mathbf{r} + \cdots + \int_{C_n} \mathbf{F}\cdot \d \mathbf{r}.
  \]

Q: Conservative vector field
A: \begin{thm}
  If $\mathbf{F} = \nabla f(\mathbf{r})$, then
  \[
    \int _C \mathbf{F}\cdot \mathbf{r} = f(\mathbf{b}) - f(\mathbf{a}),
  \]
  where $\mathbf{b}$ and $\mathbf{a}$ are the end points of the curve.
\end{thm}
\begin{proof}
  Let $\mathbf{r}(u)$ be any parametrization of the curve, and suppose $\mathbf{a} = \mathbf{r}(\alpha)$, $\mathbf{b} = \mathbf{r}(\beta)$. Then
  \[
    \int_C \mathbf{F}\cdot \d \mathbf{r} = \int_C\nabla f\cdot \d \mathbf{r} = \int_\alpha^\beta \nabla f\cdot \frac{\d \mathbf{r}}{\d u}\; \d u.
  \]
  So by the chain rule for scalar functions, this is equal to
  \[
    \int_\alpha^\beta \frac{\d }{\d u} (f(\mathbf{r}(u))) \;\d u = [f(\mathbf{r}(u))]_\alpha^\beta = f(\mathbf{b}) - f(\mathbf{a}).
  \]
\end{proof}
\begin{defi}[Conservative vector field]
  If $\mathbf{F} = \nabla f$ for some $f$, the $\mathbf{F}$ is called a \emph{conservative vector field}.
\end{defi}

Q: Exact differential
A: A differential $\mathbf{F}\cdot\d \mathbf{r}$ is \emph{exact} if there is an $f$ such that $\mathbf{F} = \nabla f$. Then
  \[
    \d f = \nabla f\cdot \d \mathbf{r} = \frac{\partial f}{\partial x_i} \d x_i.
  \]
To test if this holds, we can use the necessary condition
\begin{prop}
  If $\mathbf{F} = \nabla f$ for some $f$, then
  \[
    \frac{\partial F_i}{\partial x_j} = \frac{\partial F_j}{\partial x_i}.
  \]
  This is because both are equal to $\partial^2 f/\partial x_i\partial x_j$.
\end{prop}
For an exact differential, the line integral satisfies
\[
  \int_C \mathbf{F}\cdot \d \mathbf{r} = \int_C \d f = f(\mathbf{b}) - f(\mathbf{a}).
\]
Differentials can be manipulated using (for constant $\lambda, \mu$):
\begin{prop}
  \begin{align*}
    \d (\lambda f + \mu g) &= \lambda \d f + \mu \d g\\
    \d (fg) &= (\d f)g + f(\d g)
  \end{align*}
\end{prop}
Using these, it may be possible to find $f$ by inspection.

Q: Surface integral
A: Let $D\subseteq \R^2$. Let $\mathbf{r} = (x, y)$ be in Cartesian coordinates. We can approximate $D$ by $N$ disjoint subsets of simple shapes, labelled by $I$ and with areas $\delta A_i$.
  To integrate a function $f$ over $D$, we take $\sum f(\mathbf{r}_i) \delta A_i$, where $\mathbf{r}_i$ is some point within each subset $A_i$. Then we take the limit as $\ell \to 0$, $N\to \infty$, and the union of the pieces tends to $D$, where each area can be contained in a disc of diameter $\ell$, i.e.
  \[
    \int_D f(\mathbf{r}) \;\d A = \lim_{\ell\to 0}\sum _I f(\mathbf{r}_i)\delta A_i.
  \]
 The limit must be well-defined for this to exist.
If we plot out the surface $z = f(x, y)$, then the area integral is the volume under the surface.
We usually choose the small sets in the definition to be rectangles, each of size $\delta A_I = \delta x\delta y$. We sum over subsets in a narrow horizontal strip of height $\delta y$ with $y$ and $\delta y$ held constant. Take the limit as $\delta x\to 0$. We get a contribution $\delta y\int_{x_y} f(y, x)\;\d x$ with range $x_y\in \{x: (x, y)\in D\}$. We sum over all such strips and take $\delta y\to 0$, giving
  \[
    \int_D f(x, y)\;\d A = \int_Y\left(\int_{x_y}f(x, y)\;\d x\right) \d y.
  \]
  with $x_y$ ranging over $\{x: (x, y) \in D\}$.
Note that the range of the inner integral is given by a set $x_y$. This can be an interval, or many disconnected intervals summed together, which is important if we integrate over a concave area and we have disconnected vertical strips.
We could also do it the other way round, integrating over $y$ first, and come up with the result
\[
  \int_D f(x, y)\; \d A = \int_X\left(\int_{y_x}f(x, y)\; \d y\right) \d x.
\]
\begin{thm}[Fubini's theorem]
  If $f$ is a continuous function and $D$ is a compact (ie. closed and bounded) subset of $\R^2$, then
  \[
    \int\int f\;\d x\;\d y = \int\int f\;\d y\;\d x.
  \]
\end{thm}
$\d A$ is called the \emph{area element} and in Cartesian coordinates is given by $\d A = \d x\;\d y$.

Q: Separable function
A: A function $f(x, y)$ is separable if it can be written as $f(x, y) = h(y)g(x)$.
\begin{prop}
  Take separable $f(x, y) = h(y)g(x)$ and $D$ be a rectangle $\{(x, y): a\leq x\leq b, c\leq y \leq d\}$. Then
  \[
    \int_Df(x, y)\;\d x\;\d y = \left(\int_a^b g(x)\;\d x\right)\left(\int_c^d h(y)\;\d y\right)
  \]
\end{prop}

Q: Change of variables for a surface integral
A: \begin{prop}
  Suppose we have a change of variables $(x, y)\leftrightarrow (u, v)$ that is smooth and invertible, with regions $D, D'$ in one-to-one correspondence. Then
  \[
    \int_D f(x, y)\;\d x\;\d y = \int_D f(x(u, v), y(u, v))|J|\;\d u\;\d v,
  \]
  where
  \[
    J = \frac{\partial (x, y)}{\partial (u, v)} =
    \begin{vmatrix}
      \dfrac{\partial x}{\partial u} & \dfrac{\partial x}{\partial v}\vspace{5pt}\\
      \dfrac{\partial y}{\partial u} & \dfrac{\partial y}{\partial v}\\
    \end{vmatrix}
  \]
  is the Jacobian. In other words,
  \[
    \;\d x\;\d y = |J|\;\d u\;\d v.
  \]
\end{prop}
\begin{proof}
  Since we are writing $(x(u, v), y(u, v))$, we are transforming from $(u, v)$ to $(x, y)$.
  Suppose we start with an area $\delta A' = \delta u\delta v$ in the $(u, v)$ plane. Then by Taylors' theorem, we have
  \[
    \delta x = x(u + \delta u, v + \delta v) - x(u, v) \approx \frac{\partial x}{\partial u}\delta u + \frac{\partial x}{\partial v}\delta v.
  \]
  We have a similar expression for $\delta y$ and we obtain
  \[
    \begin{pmatrix}
      \delta x\\
      \delta y
    \end{pmatrix}
    \approx
    \begin{pmatrix}
      \frac{\partial x}{\partial u} & \frac{\partial x}{\partial v}\\
      \frac{\partial y}{\partial u} & \frac{\partial y}{\partial v}\\
    \end{pmatrix}
    \begin{pmatrix}
      \delta u\\
      \delta v
    \end{pmatrix}
  \]
So the area formed by $\delta x$ and $\delta y$ is $\det J$ times the area formed by $\delta u$ and $\delta v$. Hence
  \[
    \d x\;\d y = |J| \;\d u\;\d v.
  \]
\end{proof}

Q: Volume integral
A: Consider a volume $V\subseteq \R^3$ with position vector $\mathbf{r} = (x, y, z)$. We approximate $V$ by $N$ small disjoint subsets of some simple shape labelled by $I$, volume $\delta V_I$, contained within a solid sphere of diameter $\ell$.
  Assume that as $\ell \to 0$ and $N\to \infty$, the union of the small subsets tend to $V$. Then
  \[
    \int_V f(\mathbf{r})\;\d V = \lim_{\ell \to 0} \sum_{I}f(\mathbf{r}_I^*) \delta V_I,
  \]
  where $\mathbf{r}_I^*$ is any chosen point in each small subset.
To evaluate this, we can take $\delta V_I = \delta x \delta y \delta z$, and take $\delta x\to 0$, $\delta y\to 0$ and $\delta z$ in some order. So
\[
    \int_V f(\mathbf{r})\;\d V = \int\int\int f(\mathbf{r}) \;\d x\;\d y\;\d z.
  \]
We can change variables by some smooth, invertible transformation $(x, y, z)\mapsto (u, v, w)$. Then
  \[
    \int_V f\;\d x\;\d y\;\d z = \int_V f|J|\;\d u\;\d v\;\d w,
  \]
  with
  \[
    J = \frac{\partial(x, y, z)}{\partial(u, v, w)} =
    \begin{vmatrix}
      \dfrac{\partial x}{\partial u} & \dfrac{\partial x}{\partial v} & \dfrac{\partial x}{\partial w}\vspace{5pt} \\
      \dfrac{\partial y}{\partial u} & \dfrac{\partial y}{\partial v} & \dfrac{\partial y}{\partial w}\vspace{5pt} \\
      \dfrac{\partial z}{\partial u} & \dfrac{\partial z}{\partial v} & \dfrac{\partial z}{\partial w}
    \end{vmatrix}
  \]
The \emph{volume element} is $\d V$. In Cartesians, $\d V = \d x\; \d y\; \d z$.
In cylindrical coordinates,
  \[
    \d V = \rho\;\d \rho\;\d \varphi\;\d z.
  \]
  In spherical coordinates
  \[
    \d V = r^2\sin\theta \;\d r\;\d \theta\;\d \varphi.
  \]

Q: Integration in $R^n$
A: $\int_D f(x_1, x_2, \cdots x_n)\;\d x_1 \;\d x_2\cdots\;\d x_n$ is simply the integration over an $n$-dimensional volume. The change of variable formula is
  \[
    \int_D f(x_1, x_2, \cdots x_n)\;\d x_1 \;\d x_2\cdots\;\d x_n = \int_{D'} f(\{x_i(\mathbf{u})\}) |J| \;\d u_1\;\d u_2\cdots\;\d u_n.
  \]

Q: Vector-valued integrals
A: We can define $\int_V \mathbf{F}(\mathbf{r})\;\d V$ in a similar way to $\int_V f(\mathbf{r})\;\d V$as the limit of a sum over small contributions of volume. In practice, we integrate them componentwise. If
\[
  \mathbf{F}(\mathbf{r}) = F_{i}(\mathbf{r})\mathbf{e}_i,
\]
then
\[
  \int_V \mathbf{F}(\mathbf{r})\;\d V = \int_V (F_i(\mathbf{r})\;\d V)\mathbf{e}_i.
\]

Q: Normal to a surface
A: Let $f$ be a smooth function on $\R^3$ and a constant $c$. Then $f(\mathbf{r}) = c$ defines a smooth surface. Consider any curve $\mathbf{r}(u)$ on $S$. Then by the chain rule, if we differentiate $f(\mathbf{r}) = c$ with respect to $u$, we obtain
\[
  \frac{\d }{\d u}[f(\mathbf{r}(u))] = \nabla f\cdot \frac{\d \mathbf{r}}{\d u} = 0.
\]
This means that $\nabla f$ is always perpendicular to $\frac{\d \mathbf{r}}{\d u}$. Since $\frac{\d \mathbf{r}}{\d u}$ is the tangent to the curve, $\nabla f$ is perpendicular to the tangent. Since this is true for \emph{any} curve $\mathbf{r}(u)$, $\nabla f$ is perpendicular to any tangent of the surface. Therefore
\begin{prop}
  $\nabla f$ is the normal to the surface $f(\mathbf{r}) = c$.
\end{prop}

Q: Boundary
A: A surface $S$ can be defined to have a \emph{boundary} $\partial S$ consisting of a piecewise smooth curve. Points on this curve can be approached from $S$ and from the outside of $S$. In general, an $n$ dimensional bounded object has an $n-1$ dimensional boundary.
  A surface is \emph{bounded} if it can be contained in a solid sphere, \emph{unbounded} otherwise. A bounded surface with no boundary is called \emph{closed}.

Q: Orientable surface
A: At each point, there is a unit normal $\mathbf{n}$ that's unique up to a sign.
  If we can find a consistent choice of $\mathbf{n}$ that varies smoothly across $S$, then we say $S$ is \emph{orientable}, and the choice of sign of $\mathbf{n}$ is called the \emph{orientation} of the surface.
For simple cases, we can describe the orientation as ``inward'' and ``outward''.

Q: Surfaces defined by two parameters
A: A surface $S$ can also be parametrised by $\mathbf{r}(u, v)$ with parameters $u, v$. $S$ is swept out as $u$ and $v$ vary in some region $D$. By the chain rule,
\[
  \delta \mathbf{r} = \frac{\partial \mathbf{r}}{\partial u}\delta u + \frac{\partial \mathbf{r}}{\partial v}\delta v + o(\delta u, \delta v).
\]
$\frac{\partial \mathbf{r}}{\partial u}$ and $\frac{\partial \mathbf{r}}{\partial v}$ are tangent vectors to curves on $S$.
\begin{defi}[Regular parametrization]
  A parametrization is \emph{regular} if for all $u, v$,
  \[
    \frac{\partial \mathbf{r}}{\partial u}\times \frac{\partial \mathbf{r}}{\partial v} \not = 0,
  \]
  ie. there are always two independent tangent directions.
\end{defi}
The small changes $\delta u, \delta v$ make a small parallelogram on $S$. Up to $o$-terms, it has a vector area of
\[
  \delta \mathbf{S} = \frac{\partial \mathbf{r}}{\delta u}\times \frac{\partial \mathbf{r}}{\partial v} = \mathbf{n}\;\delta S.
\]
The order of $u, v$ gives the choice of the sign of the unit normal. By summing and taking limits, the area of $S$ is
\[
  \int_S \d S = \int_D \left|\frac{\partial \mathbf{r}}{\partial u}\times \frac{\partial \mathbf{r}}{\partial v}\right| \d u\;\d v.
\]
We call
  \[
    \d S = \left|\frac{\partial \mathbf{r}}{\partial u}\times \frac{\partial \mathbf{r}}{\partial v}\right|\;\d u\;\d v
  \]
  the \emph{scalar area element}.

Q: Flux
A: Let $S$ be a smooth surface parametrized by $\mathbf{r}(u, v)$, where $(u, v)$ takes values in $D$.
  The \emph{surface integral} or $\emph{flux}$ of a vector field $\mathbf{F}(\mathbf{r})$ over $S$ is defined by
  \[
    \int_S \mathbf{F}(\mathbf{r})\cdot \d \mathbf{S} = \int_S \mathbf{F}(\mathbf{r})\cdot \mathbf{n}\;\d S = \int_D \mathbf{F}(\mathbf{r}(u, v))\cdot \left(\frac{\partial \mathbf{r}}{\partial u}\times \frac{\partial \mathbf{r}}{\partial v}\right)\;\d u\;\d v.
  \]
  Intuitively, this is the total amount of $\mathbf{F}$ passing through $S$.

Q: Changing two parameters which define a surface
A: Let $\mathbf{r}(u, v)$ and $\mathbf{r}(\tilde{u}, \tilde{v})$ be two regular parametrizations for the surface. By the chain rule,
\begin{align*}
  \frac{\partial \mathbf{r}}{\partial u} &= \frac{\partial \mathbf{r}}{\partial \tilde{u}}\frac{\partial\tilde{u}}{\partial u} + \frac{\partial \mathbf{r}}{\partial \tilde{v}}\frac{\partial\tilde{v}}{\partial u}\\
  \frac{\partial \mathbf{r}}{\partial v} &= \frac{\partial \mathbf{r}}{\partial \tilde{u}}\frac{\partial\tilde{u}}{\partial v} + \frac{\partial \mathbf{r}}{\partial \tilde{v}}\frac{\partial\tilde{v}}{\partial v}
\end{align*}
So
\[
  \frac{\partial \mathbf{r}}{\partial u}\times\frac{\partial\mathbf{r}}{\partial v} = \frac{\partial (\tilde{u}, \tilde{v})}{\partial (u, v)} \frac{\partial \mathbf{r}}{\partial \tilde {u}}\times\frac{\partial\mathbf{r}}{\partial \tilde{v}}
\]
where $\frac{\partial (\tilde{u}, \tilde{v})}{\partial(u, v)}$ is the Jacobian.
Since
\[
  \d \tilde{u}\;\d \tilde{v} = \frac{\partial (\tilde{u}, \tilde{v})}{\partial (u, v)}\;\d u\;\d v,
\]
We recover the formula
\[
  \d S = \left|\frac{\partial \mathbf{r}}{\partial u}\times\frac{\partial\mathbf{r}}{\partial v}\right|\;\d u\;\d v = \left|\frac{\partial \mathbf{r}}{\partial \tilde {u}}\times\frac{\partial\mathbf{r}}{\partial \tilde{v}}\right| \;\d \tilde{u}\;\d \tilde{v}.
\]
Similarly, we have
\[
  \d \mathbf{S} = \frac{\partial \mathbf{r}}{\partial u}\times\frac{\partial\mathbf{r}}{\partial v}\;\d u\;\d v = \frac{\partial \mathbf{r}}{\partial \tilde {u}}\times\frac{\partial\mathbf{r}}{\partial \tilde{v}} \;\d \tilde{u}\;\d \tilde{v}.
\]
provided $(u, v)$ and $(\tilde{u}, \tilde{v})$ have the same orientation.

Q: 2D change of variable formula from the 3D surface integral formula
A: Consider a subset $S$ of the plane $\R^2$ parametrized by $\mathbf{r}(x(u, v), y(u, v))$. We can embed it to $\R^3$ as $\mathbf{r}(x(u, v), y(u, v), 0)$. Then
\[
  \frac{\partial \mathbf{r}}{\partial u}\times \frac{\partial\mathbf{r}}{\partial v} = (0, 0, J),
\]
with $J$ being the Jacobian.
Therefore
\[
  \int_S f(\mathbf{r})\;\d S = \int_D f(\mathbf{r}(u, v)) \left|\frac{\partial \mathbf{r}}{\partial u}\times \frac{\partial \mathbf{r}}{\partial v}\right| \;\d u\;\d v= \int_D f(\mathbf{r}(u, v))|J|\;\d u\;\d v,
\]
and we recover the formula for changing variables in $\R^2$.

Q: Change of variable in $\R^3$
A: In, suppose we have a volume parametrised by $\mathbf{r}(u, v, w)$. Then
\[
  \delta \mathbf{r} = \frac{\partial \mathbf{r}}{\partial u}\delta u + \frac{\partial \mathbf{r}}{\partial v}\delta v + \frac{\partial \mathbf{r}}{\partial w}\delta w + o(\delta u, \delta v, \delta w).
\]
Then the cuboid $\delta u, \delta v, \delta w$ in $u, v, w$ space is mapped to a parallelopiped of volume
\[
  \delta V = \left|\frac{\partial \mathbf{r}}{\partial u}\delta u\cdot \left( \frac{\partial \mathbf{r}}{\partial v}\delta v \times \frac{\partial \mathbf{r}}{\partial w}\delta w\right)\right| = |J|\;\delta u\; \delta v\;\delta w.
\]
So $\d V = |J|\; \d u\; \d v\; \d w$.

Q: Principal normal and curvature
A: Let $\mathbf{r}(s)$ be a curve parametrized by arclength $s$. Since $\mathbf{t}(s) = \frac{\d \mathbf{r}}{\d s}$ is a unit vector, $\mathbf{t}\cdot \mathbf{t} = 1$. Differentiating yields $\mathbf{t}\cdot \mathbf{t}' = 0$. So $\mathbf{t}'$ is a normal to the curve if $\mathbf{t}' \not= 0$.
We define the following:
\begin{defi}[Principal normal and curvature]
  Write $\mathbf{t}' = \kappa \mathbf{n}$, where $\mathbf{n}$ is a unit vector and $\kappa > 0$. Then $\mathbf{n}(s)$ is called the \emph{principal normal} and $\kappa(s)$ is called the \emph{curvature}.
\end{defi}
We take a curve that can Taylor expanded around $s = 0$. Then
\[
  \mathbf{r}(s) = \mathbf{r}(0) + s\mathbf{r}'(0) + \frac{1}{2}s^2 \mathbf{r}''(0) + O(s^3).
\]
We know that $\mathbf{r}' = \mathbf{t}$ and $\mathbf{r}'' = \mathbf{t}'$. So we have
\[
  \mathbf{r}(s) = \mathbf{r}(0) + s\mathbf{t}(0) + \frac{1}{2}\kappa(0) s^2 \mathbf{n} + O(s^3).
\]
Consider the vector equation for a circle passing through $\mathbf{r}(0)$ with radius $a$ in the plane defined by $\mathbf{t}$ and $\mathbf{n}$.
Imagine rotating $\mathbf{r} - \mathbf{r}(0)$ through $\theta$. Then the equation of the circle is
\[
  \mathbf{r} = \mathbf{r}(0) + a(1 - \cos \theta) \mathbf{n} + a\sin \theta \mathbf{t}.
\]
We can expand this to obtain
\[
  \mathbf{r} = \mathbf{r}(0) + a\theta \mathbf{t} + \frac{1}{2}\theta^2 a\mathbf{n} + o(\theta^3).
\]
Since the arclength $s = a\theta$, we obtain
\[
  \mathbf{r} = \mathbf{r}(0) + s\mathbf{t} + \frac{1}{2}\frac{1}{a}s^2\mathbf{n} + O(s^3).
\]
Comparing to the Taylor series for the curve give $\kappa = 1/a$, for $a$ the radius of the circle of best fit.
\begin{defi}[Radius of curvature]
  The \emph{radius of curvature} of a curve at a point $\mathbf{r}(s)$ is $1/\kappa(s)$.
\end{defi}

Q: Binormal and torsion
A: Since we are in 3D, given the tangent $\mathbf{t}(s)$ and principal normal $\mathbf{n}(s)$, there is another normal to the curve. We can add a third normal to generate an orthonormal basis.
 \begin{defi}[Binormal]
  The \emph{binormal} of a curve is $\mathbf{b} = \mathbf{t}\times \mathbf{n}$.
\end{defi}
We can define the torsion similar to the curvature, but with the binormal instead of the tangent.
$\mathbf{b}' = \mathbf{t}'\times \mathbf{n} + \mathbf{t}\times \mathbf{n}' = \mathbf{t}\times \mathbf{n}'$, so $\mathbf{b}'$ is perpendicular to $\mathbf{t}$. Also, $\mathbf{b} \cdot \mathbf{b} = 1\Rightarrow \mathbf{b}\cdot \mathbf{b}' = 0$. So $\mathbf{b}'$ is perpendicular to $\mathbf{b}$. Thus it must be in the same direction as $\mathbf{n}$.
\begin{defi}[Torsion] Let $\mathbf{b}' = -\tau \mathbf{n}$. Then $\tau$ is the \emph{torsion}.
\end{defi}

Q: Principal curvatures
A: The \emph{principal curvatures} of a surface at $P$ are the minimum and maximum possible curvature of a curve through $P$, denoted $\kappa_{\min}$ and $\kappa_{\max}$ respectively.

Q: Gaussian curvature
A: The \emph{Gaussian curvature} of a surface at a point $P$ is $K = \kappa_{\min}\kappa_{\max}$.

Q: Theorema Egregium
A: \begin{thm}[Theorema Egregium]
  The Gaussian curvature $K$ is \emph{intrinsic} to the surface $S$. It can be expressed in terms of lengths, angles etc. which are measured entirely on the surface. So $K$ can be defined on an arbitrary surface without embedding it on a higher dimensional surface.
\end{thm}

Q: Gauss-Bonnet Theorem
A: Consider a geodesic triangle $D$ on a surface $S$. It consists of three geodesics: shortest curves between two points.
Let $\theta_i$ be the interior angles of the triangle (defined by using scalar products of tangent vectors). Then
\begin{thm}[Gauss-Bonnet theorem]
  \[
    \theta_1 +\theta_2 + \theta_3 = \pi + \int_D K\; \d A,
  \]
  integrating over the area of the triangle.
\end{thm}

Q: Divergence
A: \begin{defi}[Divergence]
  The \emph{divergence} or \emph{div} of a vector field $\mathbf{F}$ is
  \[
    \nabla\cdot \mathbf{F} = \frac{\partial F_i}{\partial x_i} = \frac{\partial F_1}{\partial x_1} + \frac{\partial F_2}{\partial x_2} + \frac{\partial F_3}{\partial x_3}.
  \]
\end{defi}

Q: Curl
A: \begin{defi}[Curl]
  The \emph{curl} of $\mathbf{F}$ is
  \[
    \nabla\times \mathbf{F} = \varepsilon_{ijk}\frac{\partial F_k}{\partial x_j}\mathbf{e}_i = \begin{vmatrix}
      \mathbf{e}_1 & \mathbf{e}_2 & \mathbf{e}_3\\
      \frac{\partial}{\partial x} & \frac{\partial}{\partial y} & \frac{\partial}{\partial z}\\
      F_x & F_y & F_z
    \end{vmatrix}
  \]
\end{defi}

Q: Grad, div and curl of a linear combination
A: \begin{prop}
  Let $f, g$ be scalar functions, $\mathbf{F}, \mathbf{G}$ be vector functions, and $\mu, \lambda$ be constants. Then
  \begin{align*}
    \nabla(\lambda f + \mu g) &= \lambda\nabla f + \mu\nabla g\\
    \nabla\cdot (\lambda \mathbf{F} + \mu \mathbf{G}) &= \lambda\nabla \cdot \mathbf{F} + \mu\nabla\cdot \mathbf{G}\\
    \nabla\times (\lambda \mathbf{F} + \mu \mathbf{G}) &= \lambda\nabla\times \mathbf{F} + \mu\nabla\times \mathbf{G}.
  \end{align*}
\end{prop}

Q: Leibniz properties of grad, div and curl
A: \begin{prop}
  We have the following Leibnitz properties:
  \begin{align*}
    \nabla(fg) &= (\nabla f)g + f(\nabla g)\\\
    \nabla\cdot (f\mathbf{F}) &= (\nabla f)\cdot \mathbf{F} + f(\nabla\cdot \mathbf{F})\\
    \nabla\times (f\mathbf{F}) &= (\nabla f)\times \mathbf{F} + f(\nabla\times \mathbf{F})\\
    \nabla(\mathbf{F}\cdot \mathbf{G}) &= \mathbf{F}\times (\nabla \times \mathbf{G}) + \mathbf{G}\times (\nabla \times \mathbf{F}) + (\mathbf{F}\cdot \nabla)\mathbf{G} + (\mathbf{G}\cdot \nabla) \mathbf{F}\\
    \nabla \times (\mathbf{F}\times \mathbf{G}) &= \mathbf{F}(\nabla\cdot \mathbf{G}) - \mathbf{G}(\nabla\cdot \mathbf{F}) + (\mathbf{G}\cdot \nabla)\mathbf{F} - (\mathbf{F}\cdot \nabla)\mathbf{G}\\
    \nabla\cdot (\mathbf{F}\times \mathbf{G}) &= (\nabla\times \mathbf{F})\cdot \mathbf{G} - \mathbf{F}\cdot (\nabla\times \mathbf{G})
  \end{align*}
  which can be proven by brute-forcing with suffix notation and summation convention.
\end{prop}

Q: Second-order derivatives
A: We have
\begin{prop}
  \begin{align*}
    \nabla\times (\nabla f) &= 0\\
    \nabla\cdot (\nabla\times \mathbf{F}) &=0
  \end{align*}
\end{prop}
\begin{proof}
  Expand out using suffix notation, noting that
  \[
    \varepsilon_{ijk}\frac{\partial^2 f}{\partial x_i \partial x_j} = 0.
  \]
  since if, say, $i = 3$, then
  \[
    \varepsilon_{ijk}\frac{\partial^2 f}{\partial x_i \partial x_j} = \frac{\partial^2 f}{\partial x_1 \partial x_2} - \frac{\partial^2 f}{\partial x_2 \partial x_1} = 0.
  \]
\end{proof}
The converse of each result holds for fields $\mathbf{F}$ defined in all of $\R^3$:
  \begin{align*}
    \nabla\times \mathbf{F} &= 0 \implies \mathbf{F} = \nabla f \\
\nabla\cdot \mathbf{F} &= 0 \implies\mathbf{F} = \nabla \times \mathbf{A}.
  \end{align*}
We call $\mathbf{A}$ the \emph{vector potential}, $\mathbf{F}$ \emph{solenoidal}, $f$ is the \emph{scalar potential} and $\mathbf{F}$ is \emph{conservative} or \emph{irrotational}.
  The \emph{Laplacian operator} is defined by
  \[
    \nabla^2 = \nabla\cdot \nabla = \frac{\partial^2}{\partial x_i \partial x_i} = \left(\frac{\partial^2}{\partial x_1^2} + \frac{\partial^2}{\partial x_2^2} + \frac{\partial^2}{\partial x_3^3}\right).
  \]
  This operation is defined on both scalar and vector fields --- on a scalar field,
  \[
    \nabla^2 f = \nabla\cdot (\nabla f),
  \]
  whereas on a vector field,
  \[
    \nabla^2 \mathbf{A} = \nabla(\nabla\cdot \mathbf{A}) - \nabla\times (\nabla\times \mathbf{A}).
  \]

Q: Green's theorem in the plane
A: \begin{thm}[Green's theorem]
  For smooth functions $P(x, y)$, $Q(x, y)$ and $A$ a bounded region in the $(x, y)$ plane with boundary $\partial A$,
  \[
    \int_A \left(\frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y}\right)\;\d A = \int_{\partial A}(P\;\d x + Q\;\d y).
  \]
  Given that $\partial A$ is a piecewise smooth, non-intersecting closed curve, traversed anti-clockwise.
\end{thm}
Green's theorem also holds for a bounded region $A$, where the boundary $\partial A$ consists of \emph{disconnected} components (each piecewise smooth, non-intersecting and closed) with anti-clockwise orientation on the exterior, and clockwise on the interior boundary. The orientation of the curve comes from imagining the surface as having a gap connecting the interior to exterior and take the limit as the gap shrinks to 0.

Q: Stokes' theorem
A: \begin{thm}[Stokes' theorem]
  For a smooth vector field $\mathbf{F}(\mathbf{r})$,
  \[
    \int_S \nabla\times \mathbf{F}\cdot \d \mathbf{S} = \int_{\partial S} \mathbf{F}\cdot \d \mathbf{r},
  \]
  where $S$ is a smooth, bounded surface and $\partial S$ is a piecewise smooth boundary of $S$.
  The direction of the line integral is as follows: If we walk along $C$ with $\mathbf{n}$ facing up, then the surface is on your left.
\end{thm}
It also holds if $\partial S$ is a collection of disconnected piecewise smooth closed curves. The orientation of the curve comes from imagining the surface as having a gap from interior to exterior and taking the limit as the gap shrinks to 0.

Q: Divergence/Gauss theorem
A: \begin{thm}[Divergence/Gauss theorem]
  For a smooth vector field $\mathbf{F}(\mathbf{r})$,
  \[
    \int _V \nabla\cdot \mathbf{F}\;\d V = \int_{\partial V}\mathbf{F}\cdot \d \mathbf{S},
  \]
  where $V$ is a bounded volume with boundary $\partial V$, a piecewise smooth, closed surface, with outward normal $\mathbf{n}$.
\end{thm}

Q: Stokes' theorem $\Rightarrow $ Green's theorem
A: Stokes' theorem $\Rightarrow $ Green's theorem
\begin{proof}
  Stokes' theorem talks about 3D surfaces and Green's theorem is about 2D regions. So given a region $A$ on the $(x, y)$ plane, we pretend that there is a third dimension and apply Stokes' theorem to derive Green's theorem.
  Let $A$ be a region in the $(x, y)$ plane with boundary $C = \partial A$, parametrised by arc length, $(x(s), y(s), 0)$. Then the tangent to $C$ is
  \[
    \mathbf{t} = \left(\frac{\d x}{\d s}, \frac{\d y}{\d s}, 0\right).
  \]
  Given any $P(x, y)$ and $Q(x, y)$, we can consider the vector field
  \[
    \mathbf{F} = (P, Q, 0),
  \]
  So
  \[
    \nabla \times \mathbf{F} = \left(0, 0, \frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y}\right).
  \]
  Then the left hand side of Stokes is
  \[
    \int_C \mathbf{F} \cdot \d \mathbf{r} = \int_C \mathbf{F}\cdot \mathbf{t}\;\d s = \int_C P\;\d x + Q\;\d y,
  \]
  and the right hand side is
  \[
    \int_A (\nabla\times \mathbf{F})\cdot \hat{\mathbf{k}}\;\d A = \int_A \left(\frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y}\right)\;\d A.
  \]
\end{proof}

Q: Green's theorem $\Rightarrow $ Stokes' theorem.
A: \begin{proof}
  Green's is for 2D, Stokes' is for 3D surface $S=\mathbf{r}(u, v)$. So use $A=$ 2D parameter space $u, v$. Write $\partial A = (u(t), v(t))$ so $\partial S = \mathbf{r}(u(t), v(t))$. rtp
  \begin{align*}
 \int_{\partial A} F_u\;\d u + F_v\;\d v &= \int_A\left(\frac{\partial F_v}{\partial u} - \frac{\partial F_u}{\partial v}\right)\;\d A \\
\implies  \int_{\partial S}\mathbf{F}\cdot \d \mathbf{r} &= \int_S (\nabla \times \mathbf{F})\cdot \d \mathbf{S}
  \end{align*}
So to match LHS we show $\mathbf{F}\cdot \d \mathbf{r} = F_u \;\d u + F_v \;\d v$ for some $F_u$ and $F_v$. By the chain rule, we know
  \[
    \d \mathbf{r} = \frac{\partial \mathbf{r}}{\partial u} \d u + \frac{\partial \mathbf{r}}{\partial v}\d v.
  \]
  So we choose
  \[
    F_u = \mathbf{F}\cdot \frac{\partial \mathbf{r}}{\partial u}, \quad F_v = \mathbf{F}\cdot\frac{\partial \mathbf{r}}{\partial v}.
  \]
  To match the RHS, recall that
  \[
    (\nabla\times \mathbf{F}) \cdot \d \mathbf{S} = (\nabla\times \mathbf{F})\cdot \left(\frac{\partial \mathbf{r}}{\partial u}\times \frac{\partial \mathbf{r}}{\partial v}\right).
  \]
  Therefore, for the right hand sides to match, we want
  \[
    \frac{\partial F_v}{\partial u} - \frac{\partial F_u}{\partial v} = (\nabla\times \mathbf{F})\cdot \left(\frac{\partial \mathbf{r}}{\partial u}\times \frac{\partial \mathbf{r}}{\partial v}\right).\tag{$*$}
  \]
  \[
    \frac{\partial F_v}{\partial u} = \frac{\partial}{\partial u}\left(\mathbf{F}\cdot \frac{\partial \mathbf{r}}{\partial v}\right) = \frac{\partial}{\partial u}\left(F_i\frac{\partial x_i}{\partial v}\right) = \left(\frac{\partial F_i}{\partial x_j}\frac{\partial x_j}{\partial u}\right)\frac{\partial x_i}{\partial v} + F_i\frac{\partial x_i}{\partial u\partial v}
  \]
  \[
    \frac{\partial F_u}{\partial v} = \frac{\partial}{\partial v}\left(\mathbf{F}\cdot \frac{\partial \mathbf{r}}{\partial u}\right) = \frac{\partial}{\partial v}\left(F_j\frac{\partial x_j}{\partial u}\right) = \left(\frac{\partial F_j}{\partial x_i}\frac{\partial x_i}{\partial v}\right)\frac{\partial x_j}{\partial u} + F_i\frac{\partial x_i}{\partial u\partial v}
  \]
  So the LHS of $(*)$ is
  \[
    \frac{\partial F_v}{\partial u} - \frac{\partial F_u}{\partial v} = \frac{\partial x_j}{\partial u}\frac{\partial x_i}{\partial v}\left(\frac{\partial F_i}{\partial x_j} - \frac{\partial F_j}{\partial x_i}\right).
  \]
  The RHS of $(*)$ is
  \begin{align*}
    (\nabla \times \mathbf{F})\cdot \left(\frac{\partial \mathbf{r}}{\partial u}\times \frac{\partial \mathbf{r}}{\partial v}\right) &= \varepsilon_{kij}\frac{\partial F_j}{\partial x_i}\varepsilon_{kpq}\frac{\partial x_p}{\partial u}\frac{\partial x_q}{\partial v}\\
    &= (\delta_{ip}\delta_{jq} - \delta_{iq}\delta_{jp}) \frac{\partial F_j}{\partial x_i}\frac{\partial x_p}{\partial u}\frac{\partial x_q}{\partial v}\\
    &= \left(\frac{\partial F_j}{\partial x_i} - \frac{\partial F_i}{\partial x_j}\right)\frac{\partial x_i}{\partial u}\frac{\partial x_j}{\partial v}.
  \end{align*}
\end{proof}

Q: Greens theorem $\Leftrightarrow$ 2D divergence theorem.
A: \begin{proof}
  The 2D divergence theorem states that
  \[
    \int_A (\nabla\cdot \mathbf{G})\;\d A = \int_{\partial A} \mathbf{G}\cdot \mathbf{n}\;\d s.
  \]
  with an outward normal $\mathbf{n}$.
  Write $\mathbf{G}$ as $(Q, -P)$. Then
  \[
    \nabla\cdot \mathbf{G} = \frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y}.
  \]
  Around the curve $\mathbf{r}(s) = (x(s), y(s))$, $\mathbf{t}(s) = (x'(s), y'(s))$. Then the normal is $\mathbf{n}(s) = (y'(s), -x'(s))$ (check that it points outwards!). So
  \[
    \mathbf{G}\cdot \mathbf{n} = P\frac{\d x}{\d s} + Q\frac{\d y}{\d s}.
  \]
  Then we can expand out the integrals to obtain
  \[
    \int_C \mathbf{G}\cdot \mathbf{n}\;\d s = \int_C P\;\d x + Q\;\d y,
  \]
  and
  \[
    \int_A(\nabla\cdot \mathbf{G})\;\d A = \int_A\left(\frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y}\right)\;\d A.
  \]
  Now the 2D divergence theorem says the two LHS are the equal, and Green's theorem says the two RHS are equal.
\end{proof}

Q: Divergence theorem: proof
A: \[
    \int_A (\nabla\cdot \mathbf{G})\;\d A = \int_{C = \partial A} \mathbf{G}\cdot \mathbf{n}\;\d s.
  \]
\begin{proof}
wlog take $\mathbf{G}$ vertical (same for horizontal so true for linear combinations) and $A$ simple, convex (by partitioning). So $\mathbf{G} = G(x, y)\hat{\mathbf{j}}$. Then
  \begin{align*}
    \nabla \cdot \mathbf{G} &= \frac{\partial G}{\partial y} \\
\implies \int_A \nabla\cdot \mathbf{G}\;\d A &= \int_X \left(\int_{Y_x}\frac{\partial G}{\partial y}\;\d y\right)\;\d x.
  \end{align*}
  Now we divide $A$ into an upper and lower part, with boundaries $C_+ = y_+(x)$ and $C_- = y_-(x)$. So
  \[
    \int_{Y_x}\frac{\partial G}{\partial y}\;\d y = \int_{y_-(x)}^{y_+(x)} \frac{\partial G}{\partial y}\;\d y = G(x, y_+(x)) - G(x, y_-(x)).
  \]
Now $\delta x=\delta s\cos \theta$, where $\theta=\angle(\vec{t},\hat{i})=\angle(\vec{n},\hat{j})$. So $\cos \theta = \mathbf{n}\cdot \hat{\mathbf{j}}$. Therefore $\d x = \hat{\mathbf{j}}\cdot \mathbf{n}\;\d s$. In particular, $G\;\d x = G\,\hat{\mathbf{j}}\cdot \mathbf{n}\;\d s = \mathbf{G}\cdot \mathbf{n}\;\d s$. But at $C_-$, $\mathbf{n}$ points down, so $G \d x = -\mathbf{G}\cdot \mathbf{n}\;\d s$. Thus
  \begin{align*}
    \int_A \nabla\cdot \mathbf{G}\;\d A &= \int_X \left(\int_{Y_x}\frac{\partial G}{\partial y}\;\d y\right)\;\d x\\
&= \int_X G(x, y_+(x)) - G(x, y_{-}(x))\;\d x\\
    &= \int_{C_+}\mathbf{G}\cdot \mathbf{n}\;\d s + \int_{C_-}\mathbf{G}\cdot \mathbf{n}\;\d s\\
    &= \int_C \mathbf{G}\cdot \mathbf{n}\;\d s.
  \end{align*}
\end{proof}
To prove the 3D version, we again consider $\mathbf{F} = F(x, y, z)\hat{\mathbf{k}}$, a purely vertical vector field. Then
\[
  \int_V \nabla\cdot \mathbf{F}\;\d V = \int_D \left(\int_{Z_{xy}} \frac{\partial F}{\partial z}\;\d z\right)\;\d A.
\]
Again, split $S = \partial V$ into the top and bottom parts $S_+$ and $S_-$ (ie the parts with $\hat{\mathbf{k}}\cdot \mathbf{n} \geq 0$ and $\hat{\mathbf{k}}\cdot \mathbf{n} < 0$, and parametrize by $z_+(x, y)$ and $z_-(x, y)$. Then the integral becomes
\[
  \int_V \nabla\cdot \mathbf{F}\;\d V = \int_D (F(x, y, z_+) - F(x, y, z_-))\;\d A = \int_S \mathbf{F}\cdot \mathbf{n}\;\d S.
\]

Q: Integral expression for divergence
A: Gauss' theorem for $\mathbf{F}$ in a small volume $V$ containing $\mathbf{r}_0$ gives
\[
  \int_{\partial V}\mathbf{F}\cdot \d \mathbf{S} = \int_V\nabla\cdot \mathbf{F}\;\d V\approx (\nabla\cdot \mathbf{F})V.
\]
We take the limit as $V\to 0$ to obtain
  \[
    \nabla \cdot \mathbf{F} = \lim_{V \to 0} \frac{1}{V}\int_{\partial V}\mathbf{F}\cdot \d \mathbf{S}.
  \]

Q: Integral expression for curl
A: Stokes' theorem for $\vec{F}$ in a small area $\vec{A}$ gives
\[
  \int _{\partial A}\mathbf{F}\cdot \d \mathbf{r} = \int_A(\nabla\times \mathbf{F})\cdot \mathbf{n}\;\d A \approx \mathbf{n}\cdot (\nabla\times \mathbf{F})A.
\]
So
  \[
    \mathbf{n}\cdot \nabla \times \mathbf{F} = \lim_{A \to 0}\frac{1}{A}\int_{\partial A}\mathbf{F}\cdot \d \mathbf{r}.
  \]

Q: Conservative field: proof
A: A vector field $f$ is \emph{conservative} if
  \begin{enumerate}
    \item $\mathbf{F} = \nabla f$ for some scalar field $f$; or
    \item $\int_C \mathbf{F}\cdot \d \mathbf{r}$ is independent of $C$, for fixed end points and orientation; or
    \item $\nabla \times \mathbf{F} = 0$.
  \end{enumerate}
  In $\mathcal{D}\subseteq\R^3$, where $\mathcal{D}$ is a simply-connected domain, all three formulations are equivalent.
\begin{proof}
(i) $\implies$ (iii). Suppose $\mathbf{F} = \nabla f$. Then $\nabla \times \mathbf{F}=\nabla \times (\nabla f) $ which is a second-order derivative which is always zero.
(iii) $\implies$ (ii). Given $\mathbf{F}(\mathbf{r})$ satisfying $\nabla\times \mathbf{F} = 0$, let $C$ and $\tilde C$ be any two curves from $\mathbf{a}$ to $\mathbf{b}$.
  If $S$ is any surface with boundary $\partial S = C - \tilde C$, then by Stokes' theorem,
  \[
    \int_{S}\nabla \times \mathbf{F}\cdot \d \mathbf{S} = \int_{\partial S}\mathbf{F}\cdot \d \mathbf{r} = \int_C \mathbf{F}\cdot \d \mathbf{r} - \int_{\tilde{C}}\mathbf{F}\cdot \d \mathbf{r}.
  \]
  But $\nabla\times \mathbf{F} = 0$. So
  \[
    \int_C \mathbf{F}\cdot \d \mathbf{r} - \int_{\tilde{C}} \mathbf{F}\cdot \d \mathbf{r} = 0,
  \]
  or
  \[
    \int_C \mathbf{F}\cdot \d \mathbf{r} = \int_{\tilde{C}}\mathbf{F}\cdot \d \mathbf{r}.
  \]
(ii) $\implies$ (i). We fix $\mathbf{a}$ and define $f(\mathbf{r}) = \int_C \mathbf{F}(\mathbf{r}')\cdot\d \mathbf{r}'$ for any curve from $\mathbf{a}$ to $\mathbf{r}$. For small changes $\mathbf{r}$ to $\mathbf{r} + \delta \mathbf{r}$, there is a small extension of $C$ by $\delta C$. Then
  \begin{align*}
    f(\mathbf{r} + \delta \mathbf{r}) &= \int_{C + \delta C}\mathbf{F} (\mathbf{r}')\cdot \d \mathbf{r}'\\
    &= \int_C \mathbf{F}\cdot \d \mathbf{r}' + \int_{\delta C}\mathbf{F}\cdot \d \mathbf{r}'\\
    &= f(\mathbf{r}) + \mathbf{F}(\mathbf{r})\cdot \delta \mathbf{r} + o(\delta \mathbf{r}).
  \end{align*}
  So
  \[
    \delta f = f(\mathbf{r} + \delta \mathbf{r}) - f(\mathbf{r}) = \mathbf{F}(\mathbf{r})\cdot \delta \mathbf{r} + o(\delta \mathbf{r}).
  \]
  But the definition of grad is exactly
  \[
    \delta f = \nabla f\cdot \delta \mathbf{r} + o(\delta \mathbf{r}).
  \]
  So we have $\mathbf{F} = \nabla f$.
\end{proof}

Q: Conservation equation
A: Suppose we are interested in a quantity $Q$. Let $\rho(\mathbf{r}, t)$ be the $Q$ per unit volume and $\mathbf{j}(\mathbf{r}, t)$ be the flow rate of $Q$.
  The \emph{conservation equation} is
  \[
    \frac{\partial \rho}{\partial t} + \nabla\cdot \mathbf{j} = 0.
  \]
Now let $V$ be a fixed time-independent volume with boundary $S = \partial V$. Then
\[
  Q(t) = \int_V \rho (\mathbf{r}, t)\; \d V.
\]
So in $V$
\[
  \frac{\d Q}{\d t} = \int_V \frac{\partial \rho }{\partial t}\;\d V = -\int_V \nabla \cdot \mathbf{j}\;\d V = -\int_S \mathbf{j}\cdot \d \mathbf{S}
\]
by the divergence theorem.
Now suppose $V$ is the whole universe (ie $\R^3$), and $\mathbf{j}\to 0$ sufficiently rapidly as $|\mathbf{r}| \to \infty$. Then let $V$ to be a solid sphere of radius $R$, and take the limit as $R\to \infty$. Then the surface integral vanishes and the equation states that
\[
  \frac{\d Q}{\d t} = 0.
\]

Q: Good parameterisation
A: By the chain rule, we have
\[
  \d \mathbf{r} = \frac{\partial \mathbf{r}}{\partial u}\d u + \frac{\partial \mathbf{r}}{\partial v}\d v + \frac{\partial \mathbf{r}}{\partial w}\d w
\]
For a good parametrization,
\[
  \frac{\partial \mathbf{r}}{\partial u}\cdot \left(\frac{\partial \mathbf{r}}{\partial v}\times \frac{\partial \mathbf{r}}{\partial w}\right) \not = 0,
\]
ie. $\frac{\partial \mathbf{r}}{\partial u}, \frac{\partial \mathbf{r}}{\partial v}$ and $\frac{\partial \mathbf{r}}{\partial w}$ are linearly independent. These vectors are tangent to the curves parametrized by $u, v, w$ respectively when the other two are being fixed.

Q: Orthogonal curvilinear coordinates
A: \begin{defi}
  $u, v, w$ are \emph{orthogonal curvilinear} if the tangent vectors are orthogonal.
\end{defi}
We can then set
\[
  \frac{\partial \mathbf{r}}{\partial u} = h_u \mathbf{e}_u, \quad \frac{\partial \mathbf{r}}{\partial v} = h_v \mathbf{e}_v,\quad \frac{\partial \mathbf{r}}{\partial w} = h_w \mathbf{e}_w,
\]
with $h_u, h_v, h_w > 0$ and $\mathbf{e}_u, \mathbf{e}_v, \mathbf{e}_w$ form an \emph{orthonormal} right-handed basis (ie. $\mathbf{e}_u \times \mathbf{e}_v = \mathbf{e}_w$). Then
\[
  \d \mathbf{r} = h_u \mathbf{e}_u \;\d u + h_v \mathbf{e}_v\;\d v + h_w\mathbf{e}_w \;\d w,
\]
and $h_u, h_v, h_w$ determine the changes in length along each orthogonal direction resulting from changes in $u, v, w$. Note that clearly by definition, we have
\[
  h_u = \left|\frac{\partial \mathbf{r}}{\partial u}\right|.
\]

Q: Vector area/volume element of an orthogonal curvilinear parameterised surface
A: Let $\mathbf{r}(u, v, w)$ with $u,v,w$ orthogonal curvilinear coordinates. Consider a surface with $w$ constant and parametrised by $u$ and $v$. The vector area element is
\[
  \d \mathbf{S} = \frac{\d \mathbf{r}}{\partial u}\times \frac{\partial \mathbf{r}}{\partial v}\;\d u\;\d v = h_u \mathbf{e}_u \times h_v \mathbf{e}_v \;\d u\;\d v = h_uh_v \mathbf{e}_w \;\d u\;\d v.
\]
We interpret this as $\delta S$ having a small rectangle with sides approximately $h_u \delta u$ and $h_v \delta v$. The volume element is
\[
  \d V = \frac{\partial \mathbf{r}}{\partial u}\cdot \left(\frac{\partial \mathbf{r}}{\partial v}\times \frac{\partial \mathbf{r}}{\partial w}\right)\;\d u\;\d v\;\d w = h_uh_vh_w \;\d u\;\d v\;\d w,
\]
ie. a small cuboid with sides $h_u \delta _u$, $h_v\delta _v$ and $h_w \delta_w$ respectively.

Q: Grad, div and curl in orthogonal curvilinear coordinates
A: Consider $f(\mathbf{r}(u, v, w))$ and compare
\[
  \d f = \frac{\partial f}{\partial u}\;\d u + \frac{\partial f}{\partial v}\;\d v + \frac{\partial f}{\partial w}\;\d w,
\]
with $\d f = (\nabla f)\cdot \d \mathbf{r}$. Since we know that
\[
  \d \mathbf{r} = \frac{\partial \mathbf{r}}{\partial u}\;\d u + \frac{\partial \mathbf{r}}{\partial v}\;\d v + \frac{\partial \mathbf{r}}{\partial w}\;\d w = h_u \mathbf{e}_u \;\d u + h_v \mathbf{e}_v \;\d v + h_w \mathbf{e}_w \;\d v,
\]
we can compare the terms to know that
  \[
    \nabla f = \frac{1}{h_u} \frac{\partial f}{\partial u} \mathbf{e}_u + \frac{1}{h_v} \frac{\partial f}{\partial v}\mathbf{e}_v + \frac{1}{h_w} \frac{\partial f}{\partial w}\mathbf{e}_w.
  \]
Then we know that the differential operator is
  \[
    \nabla = \frac{1}{h_u}\mathbf{e}_u \frac{\partial }{\partial u} + \frac{1}{h_v}\mathbf{e}_v\frac{\partial }{\partial v} + \frac{1}{h_w}\mathbf{e}_w \frac{\partial}{\partial w}.
  \]
We can apply this to a vector field
\[
  \mathbf{F} = F_u \mathbf{e}_u + F_v \mathbf{e}_v + F_w \mathbf{e}_w
\]
using scalar or vector products to obtain
  \begin{align*}
    \nabla \times \mathbf{F} &= \frac{1}{h_vh_w}\left[\frac{\partial}{\partial v}(h_wF_w) - \frac{\partial }{\partial w}(h_vF_v)\right]\mathbf{e}_u + \text{ two similar terms}\\
    &= \frac{1}{h_uh_vh_w}
    \begin{vmatrix} h_u\mathbf{e}_u & h_v\mathbf{e}_v & h_w \mathbf{e}_w\\
      \frac{\partial}{\partial u} & \frac{\partial}{\partial v} & \frac{\partial}{\partial w}\\
      h_u F_u & h_v F_v & h_wF_w
    \end{vmatrix}
  \end{align*}
  and
  \[
    \nabla\cdot \mathbf{F} = \frac{1}{h_uh_vh_w}\left[\frac{\partial}{\partial u}(h_vh_wF_u) + \text{ two similar terms}\right].
  \]

Q: Gravitational field
A: Consider a distribution of mass producing a gravitational force $\mathbf{F}$ on a point mass $m$ at $\mathbf{r}$. The total force is a sum of contributions from each part of the mass distribution, and is proportional to $m$. Write
\[
  \mathbf{F} = m\mathbf{g}(\mathbf{r}),
\]
\begin{defi}[Gravitational field]
  $\mathbf{g}(\mathbf{r})$ is the \emph{gravitational field}, \emph{acceleration due to gravity}, or \emph{force per unit mass}.
\end{defi}
The gravitational field is conservative, ie
\[
  \oint_C \mathbf{g}\cdot \d \mathbf{r} = 0.
\]

Q: Gauss' law for gravitation
A: \begin{law}[Integral form]
  Given any volume $V$ bounded by closed surface $S$,
  \[
    \int_S \mathbf{g}\cdot \d \mathbf{S} = -4\pi GM,
  \]
  where $G$ is Newton's gravitational constant, and $M$ is the total mass contained in $V$.
\end{law}
We take $\vec{g}$ to be conservative, i.e. $\int_C \mathbf{g}\cdot \d \mathbf{r} = 0$ for any closed $C$, or equivalently $\nabla\times \mathbf{g} = 0$.
Suppose
\[
  M = \int_V \rho(\mathbf{r})\;\d V,
\]
where $\rho$ is the mass density. Then by Gauss' theorem
\[
  \int_S \mathbf{g} \cdot \d \mathbf{S} = -4\pi GM \Rightarrow \int_V \nabla\cdot \mathbf{g}\;\d V = \int_V -4\pi G\rho \;\d V.
\]
Since this is true for all $V$, we must have
\begin{law}[Differential form]
  \[
    \nabla\cdot \mathbf{g} = -4\pi G\rho.
  \]
\end{law}
Since $\nabla\times \mathbf{g} = 0$, we can introduce a gravitational potential $\varphi(\mathbf{r})$ with $\mathbf{g} = -\nabla \varphi$. Then Gauss' Law becomes
\[
  \nabla^2 \varphi = 4\pi G\rho.
\]

Q: Newton's Law for gravitation
A: Consider a total mass $M$ distributed with a spherical symmetry about the origin $\mathbf{O}$, with all the mass contained within some radius $r = a$. By spherical symmetry, we have $\mathbf{g}(\mathbf{r}) = g(\mathbf{r})\hat{\mathbf{r}}$.
  Consider Gauss' law with $S$ being a sphere of radius $r = R > a$. Then $\hat{\mathbf{n}} = \hat{\mathbf{r}}$. So
  \[
    \int_S \mathbf{g}\cdot \d \mathbf{S} = \int_S g(R)\hat{\mathbf{r}}\cdot \hat{\mathbf{r}}\;\d S = \int g(R)\d S = 4\pi R^2 g(R).
  \]
  By Gauss' law, we obtain
  \[
    4\pi R^2 g(R) = -4\pi GM.
  \]
  So
  \[
    g(R) = -\frac{GM}{R^2}
  \]
  for $R > a$.
  Therefore the gravitational force on a mass $m$ at $\mathbf{r}$ is
  \[
    \mathbf{F}(\mathbf{r}) = -\frac{GMm}{r^2}\hat{\mathbf{r}}.
  \]
  If we take the limit as $a\to 0$, we get a point mass $M$ at the origin. Then we recover Newton's law of gravitation for point masses.
Then $\vec{F}=-\nabla\varphi$ implies
\[
  \varphi(r) = -\frac{GM}{r}
\]
for $r > a$.

Q: Electric field
A: \begin{defi}[Electric field]
  The force produced by electric charges on another charge $q$ is $\mathbf{F} = q\mathbf{E}(\mathbf{r})$, where $\mathbf{E}(\mathbf{r})$ is the \emph{electric field}, or force per unit charge.
\end{defi}
Again, this is conservative. So
\[
  \oint_C \mathbf{E}\cdot \d \mathbf{r} = 0
\]
for any closed curve $C$.

Q: Gauss' law for electrostatic forces
A: \begin{law}[Gauss' law for electrostatic forces in differential form]
  \[
    \nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0}.
  \]
\end{law}
\begin{law}[Gauss' law for electrostatic forces in integral form]
  \[
    \int_S \mathbf{E}\cdot \d \mathbf{S} = \frac{1}{\varepsilon_0} \int_V \rho\;\d V=\frac{Q}{\varepsilon_0},
  \]
\end{law}
$\varepsilon_0$ is the \emph{permittivity of free space}, or \emph{electric constant}.
Assuming no changing magnetic field, $\vec{E}$ is conservative. Then $\mathbf{E} =- \nabla \varphi$ where $\varphi$ is the \emph{electrostatic potential}, and
  \[
    \nabla^2 \varphi = \frac{\rho}{\varepsilon_0}.
  \]

Q: Coulomb's Law
A: Take a spherically symmetric charge distribution about $O$ with total charge $Q$. Suppose all charge is contained within a radius $r = a$. By spherical symmetry, we have $\mathbf{E}(\mathbf{r}) = E(\mathbf{r})\hat{\mathbf{r}}$.
Consider Gauss' law with $S$ being a sphere of radius $r = R > a$. Then $\hat{\mathbf{n}} = \hat{\mathbf{r}}$. So
  \[
    \int_S \mathbf{E}\cdot \d \mathbf{S} = \int_S E(R)\hat{\mathbf{r}}\cdot \hat{\mathbf{r}}\;\d S = \int E(R)\d S = 4\pi R^2 E(R).
  \]
  By Gauss' law, we obtain
  \[
    4\pi R^2 E(R) = \frac{Q}{\varepsilon_0}.
  \]
so
  \[
    \mathbf{E}(\mathbf{r}) = \frac{Q\hat{\mathbf{r}}}{4\pi \varepsilon_0 r^2},
  \]
  and
  \[
    \varphi(\mathbf{r}) = \frac{-Q}{4\pi\varepsilon_0 r}.
  \]
 As $a \to 0$, we get \emph{point charges}. From $\mathbf{E}$, we can recover Coulomb's law for the force on another charge $q$ at $\mathbf{r}$:
  \[
    \mathbf{F} = q\mathbf{E} =\frac{qQ\hat{\mathbf{r}}}{4\pi \varepsilon_0 r^2}.
  \]

Q: Electric field due to a line charge
A: Consider an infinite line with uniform charge density \emph{per unit length} $\sigma$.
  We use cylindrical polar coordinates. By symmetry, the field is radial, ie.
  \[
    \mathbf{E}(r) = E(r) \hat{\mathbf{r}}.
  \]
  Pick $S$ to be a cylinder of length $L$ and radius $r$. We know that the end caps do not contribute to the flux since the field lines are perpendicular to the normal. Also, the curved surface has area $2\pi r L$. Then by Gauss' law in integral form,
  \[
    \int_S\mathbf{E}\cdot \d \mathbf{S} = E(r)2\pi rL = \frac{\sigma L}{\varepsilon_0}.
  \]
  So
  \[
    \mathbf{E}(r) = \frac{\sigma}{2\pi \varepsilon_0 r} \hat{\mathbf{r}}.
  \]

Q: Poisson's Equation
A: \begin{defi}[Poisson's equation]
  The \emph{Poisson's equation} is
  \[
    \nabla^2 \varphi = -\rho,
  \]
  where $\rho$ is given and $\varphi(\mathbf{r})$ is to be solved.
\end{defi}
This is the form of the equations for gravity and electrostatics, with $-4\pi G \rho$ and $\rho/\varepsilon_0$ in place of $\rho$ respectively.
The solution is the same as for Laplace's equation but with the obvious addition of a particular integral. Alternatively, it can be solved by the Gauss Flux method:
If we want to solve $\nabla^2 \varphi = -\rho$ with $\rho$ and $\varphi$ sufficiently symmetric, we can consider the flux of $\nabla \varphi$ out of a surface $S = \partial V$:
  \[
    \int_S \nabla \varphi \cdot \d \mathbf{S} = -\int_V \rho \;\d V,
  \]
  by divergence theorem.

Q: Laplace's equation
A: When one side of Poisson's equation vanishes we get Laplace's equation
  \[
    \nabla^2 \varphi = 0.
  \]
Solutions are known as \emph{harmonic functions}. We're concerned here mainly with cases exhibiting spherical or cylindrical symmetry (use $r$ for radial coordinate here). ie. when $\varphi(\mathbf{r})$ has spherical or cylindrical symmetry. Write $\varphi (\vec{r})= \varphi(r)$. Then
\[
  \nabla \varphi = \varphi'(r)\hat{\mathbf{r}}.
\]
Then Laplace's equation $\nabla^2 \varphi = 0$ becomes an ordinary differential equation.
\begin{itemize}
  \item For spherical symmetry, using the Leibniz identity for div, we have
    \[
      \nabla^2 \varphi = \varphi'' + \frac{2}{r}\varphi' = \frac{1}{r^2}(r^2\varphi')' = 0.
    \]
    Then the general solution is
    \[
      \varphi = \frac{A}{r} + B.
    \]
  \item For cylindrical symmetry, we have
    \[
      \nabla^2 \varphi = \varphi'' + \frac{1}{r}\varphi' = \frac{1}{r}(r\varphi')' = 0.
    \]
    Then
    \[
      \varphi = A\ln r + B.
    \]
\end{itemize}
To determine $A, B$, we must specify boundary conditions. If $\varphi$ is defined on all of $\R^3$, we often require $\varphi \to 0$ as $|\mathbf{r}| \to \infty$. If $\varphi$ is defined on a bounded volume $V$, then there are two kinds of common boundary conditions on $\partial V$:
\begin{itemize}
  \item Specify $\varphi$ on $\partial V$ --- a \emph{Dirichlet} condition
  \item Specify $\mathbf{n}\cdot \nabla \varphi$ (sometimes written as $\frac{\partial \varphi}{\partial \mathbf{n}}$): a \emph{Neumann} condition. ($\mathbf{n}$ is the outward normal on $\partial V$).
\end{itemize}

Q: Uniqueness theorem for Poisson's equation
A: \begin{thm}
  Consider $\nabla^2 \varphi = - \rho$ for some $\rho (\mathbf{r})$ on a bounded volume $V$ with $S = \partial V$ being a closed surface, with an outward normal $\mathbf{n}$.
  Suppose $\varphi$ satisfies either
  \begin{enumerate}
    \item Dirichlet condition, $\varphi(\mathbf{r}) = f(\mathbf{r})$ on $S$
    \item Neumann condition $\frac{\partial \varphi(\mathbf{r})}{\partial \mathbf{n}} = n\cdot \nabla \varphi = g(\mathbf{r})$.
  \end{enumerate}
  where $f, g$ are given. Then
  \begin{enumerate}
    \item $\varphi(\mathbf{r})$ is unique
    \item $\varphi(\mathbf{r})$ is unique up to a constant.
  \end{enumerate}
\end{thm}
\begin{proof}
  Let $\varphi_1(\mathbf{r})$ and $\varphi_2(\mathbf{r})$ satisfy Poisson's equation, each obeying the boundary conditions (N) or (D). Then $\Psi(\mathbf{r}) = \varphi_2(\mathbf{r}) - \varphi_1(\mathbf{r})$ satisfies $\nabla^2\Phi = 0$ on $V$ by linearity, and
  \begin{enumerate}
    \item $\Psi = 0$ on $S$; or
    \item $\frac{\partial \Psi}{\partial \mathbf{n}} = 0$ on $S$.
  \end{enumerate}
  Thus $\Psi\frac{\partial \Psi}{\partial \mathbf{n}} = 0$ on $S$. So using the divergence theorem,
  \[
  0= \int_S (\Psi\nabla\Psi)\cdot \d \mathbf{S} =\int_V \nabla\cdot (\Psi\nabla \Psi).
  \]
  But
  \[
    \nabla\cdot(\Psi\nabla \Psi) = (\nabla\Psi)\cdot (\nabla\Psi) + \Psi\underbrace{\nabla^2\Psi}_{=0} = |(\nabla\Psi)|^2.
  \]
  So
  \[
    \int_V |\nabla \Psi|^2\;\d V = 0.
  \]
 So $\nabla\Psi = 0$. So $\Psi = c$ on $V$. So
  \begin{enumerate}
    \item $\Psi = 0$ on $S$ $\Rightarrow c = 0$. So $\varphi_1 = \varphi_2$ on $V$.
    \item $\varphi_2(\mathbf{r}) = \varphi_1(\mathbf{r}) + C$.
  \end{enumerate}
\end{proof}

Q: Necessary condition for existence of solutions to Poisson's equation
A: \textbf{Dirichlet condition}
If $\nabla^2 \varphi = -\rho$ on $V$ with the condition $\varphi(\vec r)=f(\vec r)$ on $S$, then by the divergence theorem,
\[
  \int_V \nabla^2\varphi \;\d V = \int_{\partial V} \nabla\varphi\cdot \;\d \vec S.
\]
Using Poisson's equation and the boundary conditions, we have
\[
  \int_V \rho \;\d V + \int_{\partial V} \nabla f\cdot \;\d \vec S = 0
\]
\textbf{Neumann condition}
If $\nabla^2 \varphi = -\rho$ on $V$ with the condition $\frac{\partial \varphi}{\partial \mathbf{n}} = g$, then by the divergence theorem,
\[
  \int_V \nabla^2\varphi \;\d V = \int_{\partial V} \frac{\partial \varphi}{\partial \mathbf{n}}\;\d S.
\]
Using Poisson's equation and the boundary conditions, we have
\[
  \int_V \rho \;\d V + \int_{\partial V} g\;\d S = 0
\]

Q: Green's identities
A: \begin{prop}[Green's first identity]
  \[
    \int_S (u\nabla v)\cdot \vec{\d S} = \int_V (\nabla u)\cdot (\nabla v)\;\d V + \int_V u\nabla^2 v\;\d V,
  \]
\end{prop}
\begin{proof}
\begin{align*}
\int_S (u\nabla v)\cdot \vec{\d S} &=\int_V \nabla\cdot(u\nabla v) \;\d V \\
&=\int_V \nabla u \cdot \nabla v + u\nabla^2 v \;\d V \\
&= \int_V (\nabla u)\cdot (\nabla v)\;\d V + \int_V u\nabla^2 v\;\d V
\end{align*}
\end{proof}
\begin{prop}[Green's second identity]
  \[
    \int_S (u\nabla v - v\nabla u)\cdot\d \mathbf{S} = \int_V (u\nabla^2 v - v\nabla^2 u)\;\d V.
  \]
\end{prop}
\begin{proof}
Subtracting symmetric forms of Green's first identity:
\begin{align*}
\int_S (u\nabla v)\cdot \vec{\d S} &= \int_V (\nabla u)\cdot (\nabla v)\;\d V + \int_V u\nabla^2 v\;\d V \\
\int_S (v\nabla u)\cdot \vec{\d S} &= \int_V (\nabla v)\cdot (\nabla u)\;\d V + \int_V v\nabla^2 u\;\d V \\
\implies \int_S (u\nabla v - v\nabla u)\cdot\d \mathbf{S} &= \int_V (u\nabla^2 v - v\nabla^2 u)\;\d V
\end{align*}
\end{proof}

Q: Mean value property
A: Suppose $\varphi(\mathbf{r})$ is harmonic on region $V$ containing a solid sphere defined by $|\mathbf{r} - \mathbf{a}| \leq R$, with boundary $S_R = |\mathbf{r} - \mathbf{a}| = R$. Define
  \[
    \bar\varphi (R) = \frac{1}{4\pi R^2}\int_{S_R}\varphi(\mathbf{r})\;\d S.
  \]
  Then $\varphi(\mathbf{a}) = \bar\varphi (R)$.
\begin{proof}
  Note that $\bar\varphi (R) \to \varphi(\mathbf{a})$ as $R \to 0$. We take spherical coordinates $(u, \theta, \chi)$ centered on $\mathbf{r} = \mathbf{a}$. The scalar element (when $u = R$) on $S_R$ is
  \[
    \d S = R^2 \sin \theta\;\d \theta\;\d \chi.
  \]
  So $\frac{\d S}{R^2}$ is independent of $R$. Write
  \[
    \bar\varphi(R) = \frac{1}{4\pi}\int \varphi(u)\;\frac{\d S}{R^2}.
  \]
  Differentiate this with respect to $R$, noting that $\d S/R^2$ is independent of $R$. Then we obtain
  \[
    \frac{\d}{\d R}\bar\varphi(R) = \frac{1}{4\pi R^2}\int \left.\frac{\partial \varphi}{\partial u}\right|_{u = R}\;\d S
  \]
  But
  \[
    \frac{\partial\varphi}{\partial u} = \mathbf{e}_u \cdot \nabla \varphi = \mathbf{n}\cdot \nabla \varphi = \frac{\partial\varphi}{\partial \mathbf{n}}
  \]
  on $S_R$. So
  \[
    \frac{\d}{\d R}\bar\varphi(R) = \frac{1}{4\pi R^2}\int_{S_R} \nabla \varphi \cdot \d \mathbf{S} = \frac{1}{4\pi R^2}\int_{V_R}\nabla^2 \varphi \;\d V = 0
  \]
  by divergence theorem. So $\bar \varphi(R)$ does not depend on $R$, and the result follows.
\end{proof}

Q: Local maximum
A: We say that $\varphi(\mathbf{r})$ has a \emph{local maximum} at $\mathbf{a}$ if for some $\varepsilon > 0$, $\varphi(\mathbf{r}) < \varphi(\mathbf{a})$ when $0 < |\mathbf{r} - \mathbf{a}| < \varepsilon$.

Q: Maximum principle
A: If a function $\varphi$ is harmonic on a region $V$, then $\varphi$ cannot have a maximum at an interior point of $\mathbf{a}$ of $V$.
\begin{proof}
  Suppose that $\varphi$ had a local maximum at $\mathbf{a}$ in the interior. Then there is an $\varepsilon$ such that for any $\mathbf{r}$ such that $0 < |\mathbf{r} - \mathbf{a}| < \varepsilon$, we have $\varphi(\mathbf{r}) < \varphi (\mathbf{a})$.
 Now consider the sphere $ |\mathbf{r} - \mathbf{a}|=R$ with $R>0$ sufficiently small that the sphere lies within $V$ (possible since $\mathbf{a}$ lies in the interior of $V$) and $R<\varepsilon$.
  Then for any $\mathbf{r}$ such that $|\mathbf{r} - \mathbf{a}| = \varepsilon$, we have $\varphi(\mathbf{r}) < \varphi(\mathbf{a})$. So
  \[
    \bar\varphi (R) = \frac{1}{4\pi R^2}\int_{S_R}\varphi(\mathbf{r})\;\d S < \varphi(\mathbf{a}),
  \]
  which contradicts the mean value property for a harmonic function.
\end{proof}
Consider a stationary point of $\varphi$, i.e. a point $\mathbf{r} = \mathbf{a}$ with $\nabla\varphi = 0$. Let the eigenvalues of the Hessian matrix $H_{ij} = \frac{\partial^2}{\partial x_i \partial x_j}$ be $\lambda_i$. But since $\varphi$ is harmonic, we have $\nabla^2 \varphi = 0$, ie. $\frac{\partial^2\varphi}{\partial x_i\partial x_i} = H_{ii} = 0$. But $H_{ii}$ is the trace of the Hessian matrix, which is the sum of eigenvalues. So $\sum \lambda_i = 0$.
Recall that a maximum or minimum occurs when all eigenvalues have the same sign. This clearly cannot happen if the sum is 0. Therefore we can only have saddle points.
(note we ignored the case where all $\lambda_i = 0$, where this analysis is inconclusive)

Q: Integral solution of Poisson's equation
A: \textbf{Discrete case.} If there is a single point source of strength $\lambda_\alpha$, the potential $\varphi$ is
\[
  \varphi = \frac{\lambda}{4\pi} \frac{1}{|\mathbf{r} - \mathbf{a}|}.
\]
(we have $\lambda = -4\pi GM$ for gravitation and $Q/\varepsilon_0$ for electrostatics)
If we have many sources $\lambda_\alpha$ at positions $\mathbf{r}_\alpha$, the potential is a sum of terms
\[
  \varphi(\mathbf{r}) = \sum_{\alpha} \frac{1}{4\pi}\frac{\lambda_\alpha}{|\mathbf{r} - \mathbf{r}_\alpha|}.
\]
\textbf{Continuous case.}
  The solution to Poisson's equation $\nabla^2 \varphi = -\rho$, with boundary conditions $|\varphi (\mathbf{r})| = O(1/|\mathbf{r}|)$ and $|\nabla\varphi(\mathbf{r})| = O(1/|\mathbf{r}|^2)$, is
  \[
    \varphi(\mathbf{r}) = \frac{1}{4\pi}\int_{V'} \frac{\rho(\mathbf{r}')}{|\mathbf{r} - \mathbf{r}'|}\;\d V'
  \]
  For $\rho(\mathbf{r}')$ non-zero everywhere, but suitably well-behaved as $|\mathbf{r}'| \to \infty$, we can also take $V' = \R^3$.
\begin{proof}
\begin{align*}
  \nabla^2 \varphi(\mathbf{r}) &= \nabla^2\left(\frac{1}{4\pi}\int_{V'}\frac{\rho(\mathbf{r}')}{|\mathbf{r} - \mathbf{r}'|}\;\d V'\right)\\
  &= \frac{1}{4\pi}\int_{V'} \rho(\mathbf{r}')\nabla^2\left(\frac{1}{|\mathbf{r} - \mathbf{r}'|}\right)\;\d V'\\
  &= -\int_{V'} \rho(\mathbf{r}') \delta(\mathbf{r} - \mathbf{r}')\;\d V'\\
  &= -\rho (\mathbf{r}),
\end{align*}
\end{proof}

Q: Divergence at a point source
A: Recall that
\[
  \Psi = \frac{\lambda}{4\pi |\mathbf{r} - \mathbf{a}|}
\]
is our potential for a point source. When $\mathbf{r}\not = \mathbf{a}$, we have (by the Leibniz property)
\[
  \nabla \Psi = -\frac{\lambda}{4\pi}\frac{\mathbf{r} - \mathbf{a}}{|\mathbf{r} - \mathbf{a}|^3},\quad\nabla^2\Psi = 0.
\]
What about when $\mathbf{r} = \mathbf{a}$? $\Psi$ is singular at this point, but can we say anything about $\nabla^2 \Psi$?
For any sphere with center $\mathbf{a}$, we have
\[
  \int_S \nabla \Psi\cdot \d \mathbf{S} = -\lambda.
\]
By the divergence theorem, we have
\[
  \int_V\nabla^2\Psi \;\d V = -\lambda.
\]
for $V$ being a solid sphere with $\partial V = S$. Since $\nabla^2\Psi$ is zero at any point $\mathbf{r} \not = \mathbf{a}$, we must have
\[
  \nabla^2\Psi = -\lambda \delta(\mathbf{r} - \mathbf{a}),
\]
where $\delta$ is the 3d delta function, which satisfies
\[
  \int_V f(\mathbf{r}) \delta (\mathbf{r} - \mathbf{a})\;\d V = f(\mathbf{a})
\]
for any volume containing $\mathbf{a}$.
In short, we have
\[
  \nabla^2\left(\frac{1}{|\mathbf{r} - \mathbf{r}'|}\right) = -4\pi\delta(\mathbf{r} - \mathbf{r}').
\]

Q: Lorentz force law
A: \begin{law}[Lorentz force law]
  A point charge $q$ experiences a force of
  \[
    \mathbf{F} = q(\mathbf{E} + \dot{\mathbf{r}} \times \mathbf{B}).
  \]
\end{law}

Q: Gauss's law for magnetism
A: \begin{law}[Differential form]
\[
\nabla\cdot \mathbf{B} = 0
\]
\end{law}
\begin{law}[Integral form]
\[
  \int_S \mathbf{B}\cdot \d \mathbf{S} = 0
\]
\end{law}

Q: Maxwell-Farady equation (Faraday's law of induction)
A: \begin{law}[Differential form]
\[
\nabla\times \mathbf{E} + \frac{\partial \mathbf{B}}{\partial t} = 0
\]
\end{law}
\begin{law}[Integral form]
\[
  \int_{C = \partial S} \mathbf{E}\cdot \d \mathbf{r}=  -\frac{\d }{\d t}\int_S \mathbf{B}\cdot \d \mathbf{S}
\]
\end{law}

Q: Amp\`{e}re-Maxwell circuital law
A: \begin{law}[Differential form]
\[
 \nabla\times \mathbf{B} - \mu_0\varepsilon_0 \frac{\partial \mathbf{E}}{\partial t} = \mu_0 \mathbf{j}
\]
\end{law}
\begin{law}[Integral form]
\[
  \int_{C = \partial S} \mathbf{B}\cdot \d \mathbf{r}  -\mu_0\varepsilon_0 \frac{\d }{\d t}\int_S \mathbf{E}\cdot \d \mathbf{S}=\mu_0 I
\]
\end{law}
$\mu_0$ is the magnetic constant or permeability of free space.

Q: Conservation of electric charge
A: Taking the divergence of the Amp\`{e}re-Maxwell circuital law gives
\[
  \underbrace{\nabla\cdot (\nabla\times \mathbf{B})}_{=0} - \mu_0\varepsilon_0\frac{\partial}{\partial t} \underbrace{(\nabla\cdot \mathbf{E})}_{=\rho/\varepsilon_0} = \mu_0 \nabla\cdot \mathbf{j}.
\]
So
\[
  \frac{\partial \rho}{\partial t} + \nabla\cdot \mathbf{j} = 0.
\]
Or in integral form
\[
  \frac{\partial Q}{\partial t} + I = 0.
\]

Q: Solution of Maxwell's equations for static charges and steady currents
A: If $\rho, \mathbf{j}, \mathbf{E}, \mathbf{B}$ are all independent of time, then $\mathbf{E}$ and $\mathbf{B}$ are no longer linked.
\textbf{Electric field}
\begin{align*}
  \nabla\cdot \mathbf{E} &= \rho/\varepsilon_0\\
  \nabla\times \mathbf{E} &= \mathbf{0}
\end{align*}
The second equation gives $\mathbf{E} = -\nabla \varphi$. Substituting into first gives $\nabla^2 \varphi = -\rho/\varepsilon_0$.
\textbf{Magnetic field}
\begin{align*}
  \nabla\cdot \mathbf{B} &= 0\\
  \nabla\times \mathbf{B} &= \mu_0 \mathbf{j}
\end{align*}
The first equation gives $\vec{B} = \nabla \times \mathbf{A}$ for some \emph{vector potential} $\mathbf{A}$. But the vector potential is not well-defined. Making the transformation $\mathbf{A}\mapsto \mathbf{A} + \nabla \chi(\mathbf{x})$ produces the same $\mathbf{B}$, since $\nabla\times (\nabla \chi) = 0$. So choose $\chi$ such that $\nabla\cdot \mathbf{A} = 0$. Then
\[
  \nabla^2 \mathbf{A} = \nabla(\underbrace{\nabla\cdot \mathbf{A}}_{=0}) - \nabla\times (\underbrace{\nabla\times \mathbf{A}}_{\mathbf{B}}) = -\mu_0 \mathbf{j}.
\]

Q: Solution of Maxwell's equations for empty space
A: Let $\rho = 0$, $\mathbf{j} = \mathbf{0}$. Then
\begin{align*}
  \nabla^2 \mathbf{E} &= \nabla(\nabla\cdot \mathbf{E}) - \nabla\times (\nabla\times \mathbf{E}) \\
&=\nabla\left(\frac{\rho}{\epsilon_0}\right)- \nabla\times \left(-\frac{\partial \mathbf{B}}{\partial t}\right) \\
&= \nabla\times \frac{\partial \mathbf{B}}{\partial t} \\
&= \frac{\partial}{\partial t} (\nabla \times \mathbf{B}) \\
&= \mu_0\varepsilon_0 \frac{\partial^2 \mathbf{E}}{\partial t^2}.
\end{align*}
Define $c = \frac{1}{\sqrt{\mu_0\varepsilon_0}}$. Then the equation gives
\[
  \left(\nabla^2 - \frac{1}{c^2}\frac{\partial^2}{\partial t^2}\right)\mathbf{E} = 0.
\]
This is the wave equation describing propagation with speed $c$. Similarly, we can obtain
\[
  \left(\nabla^2 - \frac{1}{c^2}\frac{\partial^2}{\partial t^2}\right)\mathbf{B} = 0.
\]
So Maxwell's equations predict that there exists electromagnetic waves in free space, which move with speed $c = \frac{1}{\sqrt{\varepsilon_0 \mu_0}} \approx \SI{3.00e8}{\meter\per\second}$, which is the speed of light! Maxwell then concluded that light is electromagnetic waves!

Q: Tensor
A: A \emph{tensor} of rank $n$ has components $T_{ij\cdots k}$ (with $n$ indices) with respect to each basis $\{\mathbf{e}_i\}$ or coordinate system $\{x_i\}$, and satisfies the change of basis rule
  \[
    T_{ij\cdots k}' = R_{ip}R_{jq}\cdots R_{kr}T_{pq\cdots r}
  \]
where $R$ is a special orthogonal matrix.

Q: Tensor addition
A: \begin{defi}[Tensor addition]
  Tensors $T$ and $S$ of the same rank can be \emph{added}; $T + S$ is also a tensor of the same rank, defined as
  \[
    (T + S)_{ij\cdots k} = T_{ij \cdots k} + S_{ij\cdots k}.
  \]
  in any coordinate system.
\end{defi}
To check that this is a tensor, we check the transformation rule. e.g. for $n = 2$:
\[
  (T + S)_{ij}' = T_{ij}' + S_{ij}' = R_{ip}R_{jq}T_{pq} + R_{ip}R_{jq}S_{pq} = (R_{ip}R_{jq})(T_{pq} + S_{pq}).
\]

Q: Scalar multiplication of tensors
A: \begin{defi}[Scalar multiplication]
  A tensor $T$ of rank $n$ can be multiplied by a scalar $\alpha$. $\alpha T$ is a tensor of the same rank, defined by
  \[
    (\alpha T)_{ij\dots k} = \alpha T_{ij\dots k}.
  \]
\end{defi}
We just have to confirm that it is indeed a tensor: \[
  (\alpha T)_{ij\dots k}' = \alpha T_{ij\dots k}' = \alpha R_{ip}R_{jq}\dots R_{kr}T_{pq\dots r} =R_{ip}R_{jq}\dots R_{kr}(\alpha T)_{pq\dots r}.
\]

Q: Tensor product
A: Let $T$ be a tensor of rank $n$ and $S$ be a tensor of rank $m$. The \emph{tensor product} $T\otimes S$ is a tensor of rank $n + m$ defined by
  \[
    (T\otimes S)_{x_1 x_2\cdots x_n y_1y_2\cdots y_m} = T_{x_1x_2\cdots x_n}S_{y_1y_2\cdots y_n}.
  \]
We just have to check this is a tensor
\vspace{-0.5cm}
\begin{align*}
  &(T\otimes S)'_{x'_1 x'_2\cdots x'_n y'_1y'_2\cdots y'_m} \\
 =& T'_{x'_1x'_2\cdots x'_n}S_{y'_1y'_2\cdots y'_m} \\
=&  (R_{x'_1x_1}R_{x'_2x_2}\dots R_{x'_nx_n}T_{x_1x_2\dots x_n} ) (R_{y'_1y_1}R_{y'_2y_2}\dots R_{y'_my_m}S_{y_1y_2\dots y_m} ) \\
=&R_{x'_1x_1}R_{x'_2x_2}\dots R_{x'_nx_n}R_{y'_1y_1}R_{y'_2y_2}\dots R_{y'_my_m} (T\otimes S)_{x_1 x_2\cdots x_n y_1y_2\cdots y_m}.
\end{align*}

Q: Tensor contraction
A: \begin{defi}[Tensor contraction]
  For a tensor $T$ of rank $n$ with components $T_{ijp\cdots q}$, we can \emph{contract on} the indices $i, j$ to obtain a new tensor of rank $n - 2$:
  \[
    S_{p\cdots q} = \delta_{ij}T_{ij p\cdots q} = T_{iip\cdots q}
  \]
  Note that we don't have to always contract on the first two indices. We can contract any pair we like.
\end{defi}
We have to check that contraction produces a tensor e.g. for $n=2$: contracting gives $T_{ii}$, a rank-0 scalar. We have $T_{ii}' = R_{ip}R_{iq}T_{pq} = \delta_{pq}T_{pq} = T_{pp} = T_{ii}$, since $R$ is an orthogonal matrix.

Q: Symmetric and anti-symmetric tensors
A: \begin{defi}[Symmetric and anti-symmetric tensors]
  A tensor $T$ of rank $n$ is \emph{symmetric} in the indices $i,j$ if it obeys
  \[
    T_{ijp\cdots q} = T_{jip\cdots q}.
  \]
  It is \emph{anti-symmetric} if
  \[
    T_{ijp\cdots q} = -T_{jip\cdots q}.
  \]
A tensor can be symmetric or anti-symmetric in any pair of indices, not just the first two.
\end{defi}
This property is well-defined, i.e. holds in any coordinate system if it holds in one, since
\begin{align*}
  T_{k\ell r\ldots s}' &= R_{ki}R_{\ell j}R_{rp}\cdots R_{sq}T_{ijp\cdots q} \\
& = \pm R_{ki} R_{\ell j} R_{rp}\cdots R_{sq}T_{jip\cdots q} \\
&= \pm T_{\ell kr\cdots s}'.
\end{align*}
\begin{defi}[Totally symmetric and anti-symmetric tensors]
  A tensor is \emph{totally (anti-)symmetric} if it is (anti-)symmetric in every pair of indices.
\end{defi}

Q: Multilinear map
A: A map $T$ that maps $n$ vectors $\mathbf{a}, \mathbf{b}, \cdots, \mathbf{c}$ to $\R$ is multi-linear if it is linear in each of the vectors $\mathbf{a}, \mathbf{b}, \cdots, \mathbf{c}$ individually.

Q: Tensors vs. multi-linear maps
A: Let
\[
 S(\mathbf{a}, \mathbf{b}, \cdots, \mathbf{c}) = T_{ij \cdots k} a_ib_j\cdots c_k.
\]
If $T$ is a tensor, then $S$ is a multi-linear map.
\begin{proof}
If $S$ is a map, then clearly by summation $S$ is multi-linear. So we are rtp all such maps are well-defined, i.e. the same regardless of the basis chosen.
 $T_{ij \cdots k} a_ib_j\cdots c_k$ is a combination of tensor products and contractions so retains tensor-ness. In particular, it is a rank 0 tensor, ie. a scalar, which is independent of the basis.
\end{proof}
If $S$ is a multi-linear map, then $T$ is a tensor.
\begin{proof}
$S$ is a multi-linear map so it must be independent of the basis, i.e.
\[
  T_{ij \cdots k} a_ib_j\cdots c_k = T_{pq\cdots r}' a_q' b_q' \cdots c_r'.
\]
By tensor transformation rules, $\vec{v}=R^T\vec{v'}$ so $v_i = R_{pi} v_p'$. Substituting in gives
\[
  T_{ij\cdots k} (R_{pi}a_p')(R_{qj}b_q')\cdots (R_{kr}c_r') = T_{pq\cdots r}' a_p' b_q' \cdots c_r'.
\]
Since this is true for all $\mathbf{a}, \mathbf{b}, \cdots \mathbf{c}$, we must have
\[
  T_{ij\cdots k}R_{pi}R_{qj}\cdots R_{rk} = T'_{pq\cdots r}
\]
Hence $T_{ij\cdots k}$ obeys the tensor transformation rule, and is a tensor.
\end{proof}

Q: Product and quotient rules for tensors
A: \begin{prop}[Product rule]
If $T_{\underbrace{i\cdots j}_n\underbrace{p\cdots q}_m}$ is a tensor of rank $n+ m$, and $u_{p\cdots q}$ is a tensor of rank $m$ then
\[
  v_{i, \cdots j}= T_{i\cdots j p\cdots q}u_{p\cdots q}
\]
is a tensor of rank $n$.
\end{prop}
\begin{proof}
$v$ is a tensor product of $T$ and $u$, followed by contraction of $p\cdots q$. Thus it is a tensor of rank $[(n+m)+m]-2m=n$.
\end{proof}
\begin{prop}[Quotient rule]
  Suppose that $T_{i\cdots jp\cdots q}$ is an array defined in each coordinate system, and that $v_{i\cdots j} = T_{i\cdots jp\cdots q} u_{p\cdots q}$ is also a tensor for any tensor $u_{p \cdots q}$. Then $T_{i\cdots j p\cdots q}$ is also a tensor.
\end{prop}
\begin{proof}
 Let $u_{p \cdots q} = c_p \cdots d_q$ for any vectors $\mathbf{c}, \cdots \mathbf{d}$. By assumption,
  \[
    v_{i\cdots j} = T_{i\cdots jp\cdots q}c_p\cdots d_q
  \]
  is a tensor. Then
  \[
    S(\vec a,\cdots \vec b,\vec c, \cdots \vec d)=v_{i\cdots j}a_i \cdots b_j = T_{i\cdots jp\cdots q}a_i\cdots b_jc_p\cdots d_q
  \]
   is a multi-linear map since $v$ is a tensor. So $T$ is a tensor.
\end{proof}

Q: Tensor field
A: A \emph{tensor field} is a tensor at each point in space \[
T_{ij\cdots k}(\mathbf{x})=T_{ij\cdots k}(x_\ell). \]

Q: Derivative of a tensor field
A: \begin{prop}
  \[
    \underbrace{\frac{\partial}{\partial x_p}\cdots \frac{\partial}{\partial x_q}}_{m}T_{\underbrace{ij\cdots k}_n},\tag{$*$}
  \]
  is a tensor of rank $n + m$.
\end{prop}
\begin{proof}
  Since $x_i' = R_{iq}x_q$, we have
  \[
    \frac{\partial x_i'}{\partial x_p} = R_{ip}.
  \]
 Similarly, as $x_q=R_{jq}x_j'$:
  \[
    \frac{\partial x_q}{\partial x_i'} = R_{iq}.
  \]
  Hence by the chain rule,
  \[
    \frac{\partial}{\partial x_i'} = \left(\frac{\partial x_q}{\partial x_i'}\right)\frac{\partial}{\partial x_q} = R_{iq} \frac{\partial}{\partial x_q}.
  \]
Using this result
\begin{align*}
&\underbrace{\frac{\partial}{\partial x_i'}\cdots \frac{\partial}{\partial x_j'}}_{m}T'_{\underbrace{uv\cdots w}_n} \\
=&\underbrace{R_{ip}\cdots R_{jq}}_m\frac{\partial}{\partial x_p}\cdots \frac{\partial}{\partial x_q}\underbrace{R_{ux}R_{vy}\cdots R_{wz}}_nT_{xy\cdots z} \\
=&\underbrace{R_{ip}\cdots R_{jq}}_m\underbrace{R_{ux}R_{vy}\cdots R_{wz}}_n \frac{\partial}{\partial x_p}\cdots \frac{\partial}{\partial x_q}T_{xy\cdots z}.
\end{align*}
\end{proof}

Q: Divergence theorem for tensors
A: Let $V$ be a volume bounded by a surface $S=\partial V$ and $T_{ij\cdots k\ell}$ be a smooth tensor field. Then
  \[
    \int_S T_{ij\cdots k\ell}n_\ell\;\d S = \int_V \frac{\partial}{\partial x_\ell}(T_{ij\cdots k\ell})\;\d V,
  \]
  with $\mathbf{n}$ being an outward pointing normal.
\begin{proof}
  Apply the usual divergence theorem to the vector field $\mathbf{v}$ defined by $v_\ell = a_i b_j \cdots c_k T_{ij\cdots k\ell }$, where $\mathbf{a}, \mathbf{b}, \cdots, \mathbf{c}$ are fixed constant vectors.
  Then
  \[
    \nabla\cdot \mathbf{v} = \frac{\partial v_\ell}{\partial x_\ell} = a_i b_j \cdots c_k \frac{\partial}{\partial x_\ell}T_{ij\cdots k\ell},
  \]
  and
  \[
    \mathbf{n}\cdot \mathbf{v} = n_\ell v_\ell = a_i b_j \cdots c_k T_{ij\cdots k\ell }n_\ell.
  \]
  Since $\mathbf{a}, \mathbf{b}, \cdots, \mathbf{c}$ are arbitrary, therefore they can be eliminated.
\end{proof}

Q: Inertia tensor
A: Consider masses $m_\alpha$ with positions $\mathbf{r}_\alpha$, all rotating with angular velocity $\boldsymbol\omega$ about $\mathbf{0}$. So the velocities are $\mathbf{v}_\alpha = \boldsymbol\omega\times \mathbf{r}_\alpha$. The total angular momentum is
\begin{align*}
  \mathbf{L} &= \sum_{\alpha} \mathbf{r}_\alpha \times m_\alpha \mathbf{v}_\alpha \\
  &= \sum_\alpha m_\alpha \mathbf{r}_\alpha \times (\boldsymbol\omega\times \mathbf{r}_\alpha)\\
  &= \sum_\alpha m_\alpha( |\mathbf{r}_\alpha|^2\boldsymbol\omega - (\mathbf{r}_\alpha \cdot \boldsymbol\omega)\mathbf{r}_\alpha).
\end{align*}
by vector identities. In components, we have
\[
  L_i = I_{ij}\omega_j,
\]
where
\begin{defi}[Inertia tensor]
  The \emph{inertia tensor} is
  \[
    I_{ij} = \sum_\alpha m_\alpha [|\mathbf{r}_\alpha|^2 \delta_{ij} - (\mathbf{r}_\alpha)_i (\mathbf{r}_\alpha)_j].
  \]
\end{defi}
For a rigid body occupying volume $V$ with mass density $\rho(\mathbf{r})$, we replace the sum with an integral to obtain
\[
  I_{ij} = \int_V \rho (\mathbf{r})(x_kx_k \delta_{ij} - x_i x_j)\;\d V.
\]
By inspection, $I$ is a symmetric tensor.

Q: Diagonalization of a symmetric second rank tensor
A: Recall that using matrix notation,
\[
  T = (T_{ij}),\quad T' = (T_{ij}'),\quad R = (R_{ij}),
\]
and the tensor transformation rule $T'_{ij} = R_{ip}R_{jq}T_{pq}$ becomes
\[
  T' = RTR^T = RTR^{-1}.
\]
If $T$ is symmetric, it can be diagonalized by such an orthogonal transformation. This means that there exists a basis of orthonormal eigenvectors $\mathbf{e}_1, \mathbf{e}_2, \mathbf{e}_3$ for $T$ with real eigenvalues $\lambda_1, \lambda_2, \lambda_3$ respectively. The directions defined by $\mathbf{e}_1, \mathbf{e}_2, \mathbf{e}_3$ are the \emph{principal axes} for $T$, and the tensor is diagonal in Cartesian coordinates along these axes.

Q: Invariant and isotropic tensors
A: A tensor $T$ is \emph{invariant} under a particular rotation $R$ if
  \[
    T_{ij\cdots k}' = R_{ip}R_{jq}\cdots R_{kr}T_{pq\cdots r} = T_{ij\cdots k},
  \]
  ie. every component is unchanged under the rotation.
  A tensor $T$ which is invariant under every rotation is \emph{isotropic}, ie. the same in every direction.

Q: Isotropic tensors of rank 1
A: \begin{thm}\leavevmode
There are no isotropic tensors of rank 1, except the zero tensor.
\end{thm}
\begin{proof}
 Suppose $T_i$ is rank-1 isotropic. Consider a rotation about $x_3$ through $\pi$:
      \[
        (R_{ij}) =
        \begin{pmatrix}
          -1 & 0 & 0\\
          0 & -1 & 0\\
          0 & 0 & 1
        \end{pmatrix}.
      \]
      We want $T_1 = R_{1p}T_p = R_{11} T_1 = -T_1$. So $T_1 = 0$. Similarly, $T_2 = 0$. By consider a rotation about, say $x_1$, we have $T_3 = 0$.
\end{proof}

Q: Isotropic tensors of rank 2
A: \begin{thm}\leavevmode
The most general rank 2 isotropic tensor is $T_{ij} = \alpha \delta_{ij}$ for some scalar $\alpha$.
\end{thm}
\begin{proof}
  Suppose $T_{ij}$ is rank-2 isotropic. Consider
      \[
        (R_{ij}) =
        \begin{pmatrix}
          0 & 1 & 0\\
          -1 & 0 & 0\\
          0 & 0 & 1
        \end{pmatrix},
      \]
      which is a rotation through $\pi/2$ about the $x_3$ axis. Then
      \[
        T_{13} = R_{1p}R_{3q} T_{pq} = R_{12}R_{33}T_{23} = T_{23}
      \]
      and
      \[
        T_{23} = R_{2p}R_{3q} T_{pq} = R_{21}R_{33}T_{13} = -T_{13}
      \]
      So $T_{13} = T_{23} = 0$. Similarly, we have $T_{31} = T_{32} = 0$.
      We also have
      \[
        T_{11} = R_{1p} R_{1q} T_{pq} = R_{12} R_{12}T_{22} = T_{22}.
      \]
      So $T_{11} = T_{22}$.
      By picking a rotation about a different axis, we have $T_{21} = T_{12}$ and $T_{22} = T_{33}$.
      Hence $T_{ij} = \alpha \delta_{ij}$.
\end{proof}

Q: Isotropic tensors of rank $3$
A: \begin{thm}\leavevmode
 The most general rank 3 isotropic tensor is $T_{ijk} = \beta \varepsilon_{ijk}$ for some scalar $\beta$.
\end{thm}
\begin{proof}
Suppose that $T_{ijk}$ is rank-3 isotropic. Using the rotation by $\pi$ about the $x_3$ axis, we have
      \[
        T_{133} = R_{1p}R_{3q}R_{3r}T_{pqr} = -T_{133}.
      \]
      So $T_{133} = 0$. We also have
      \[
        T_{111} = R_{1p}R_{1q}R_{1r}T_{pqr} = -T_{111}.
      \]
      So $T_{111} = 0$. We have similar results for $\pi$ rotations about other axes and other choices of indices.
      Then we can show that $T_{ijk} = 0$ unless all $i, j, k$ are distinct.
      Now consider
      \[
        (R_{ij}) =
        \begin{pmatrix}
          0 & 1 & 0\\
          -1 & 0 & 0\\
          0 & 0 & 1
        \end{pmatrix},
      \]
      a rotation about $x_3$ through $\pi/2$. Then
      \[
        T_{123} = R_{1p}R_{2q}R_{3r}T_{pqr} = R_{12}R_{21}R_{33}T_{213} -T_{213}.
      \]
      So $T_{123} = -T_{213}$. Along with similar results for other indices and axes of rotation, we find that $T_{ijk}$ is totally antisymmetric, and $T_{ijk} = \beta \varepsilon_{ijk}$ for some $\beta$.
\end{proof}

Q: Invariant integrals
A: \begin{thm}
  Let
  \[
    T_{ij\cdots k} = \int_V f(\mathbf{x}) x_i x_j \cdots x_k\;\d V.
  \]
  where $f(\mathbf{x})$ is a scalar function and $V$ is some volume.
  Given a rotation $R_{ij}$, consider an \emph{active} transformation: $\mathbf{x} = x_i \mathbf{e}_i$ is mapped to $\mathbf{x}' = x_i' \mathbf{e}_i$ with $x_i' = R_{ij} x_i$, ie. we map the components but not the basis, and $V$ is mapped to $V'$.
  Suppose that under this active transformation,
  \begin{enumerate}
    \item $f(\mathbf{x}) = f(\mathbf{x}')$,
    \item $V' = V$ (eg. if $V$ is all of space or a sphere).
  \end{enumerate}
  Then $T_{ij\cdots k}$ is invariant under the rotation.
\end{thm}
\begin{proof}
  First note that the Jacobian of the transformation $R$ is $1$, since it is simply the determinant of $R$ ($x_i' = R_{ip}x_p \Rightarrow \frac{\partial x_i'}{\partial x_p} = R_{ip}$), which is special orthogonal. So $\d V = \d V'$.
  Then we have
  \begin{align*}
    R_{ip}R_{jq}\cdots R_{kr} T_{pq\cdots r} &= \int_V f(\mathbf{x})x_i' x_j' \cdots x_k' \;\d V\\
 \text{using (i)}\rightarrow   &= \int_V f(\mathbf{x}')x_i' x_j' \cdots x_k'\;\d V\\
  \text{using (ii)}\rightarrow  &= \int_{V'} f(\mathbf{x}') x_i' x_j' \cdots x_k' \;\d V'\\
  \text{since $x_i$ and $x_i'$ are dummy}\rightarrow  &= \int_{V} f(\mathbf{x}) x_i x_j \cdots x_k \;\d V\\
    &= T_{ij\cdots k}
  \end{align*}
\end{proof}