% vim: tw=50
% 16/02/2022 10AM

\subsection{Orthogonal Curvilinear Coordinates}

We want to find expressions for $\nabla$ in
different coordinates systems. \myskip
Introduce coordinates $u, v, w$ so
\[ \bf{x} = \bf{x}(u, v, w) \]
A change of $(u, v, w)$ changes the point $\bf{x}$
to $\bf{x} + \dd \bf{x}$
\[ \dd \bf{x} = \pfrac{\bf{x}}{u} \dd u +
\pfrac{\bf{x}}{v} \dd v + \pfrac{\bf{x}}{w} \dd w \]
(where $\pfrac{\bf{x}}{u} \dd u$ is the tangent
vector to $v, w = \text{constant}$)
These are good coordinates at a point provided
\[ \pfrac{\bf{x}}{u} \cdot \left(
\pfrac{\bf{x}}{v} \times \pfrac{\bf{x}}{w} \right)
\neq 0 \]
If the three tangent vectors are mutually
orthogonal then $(u, v, w)$ are said to be
\emph{orthogonal curvilinear}. \myskip
For such coordinates, we introduce normalised
tangent vectors, i.e.
\begin{align*}
    \pfrac{\bf{x}}{u}
    &= h_u \bf{e}_u \\
    \pfrac{\bf{x}}{v}
    &= h_v \bf{e}_v \\
    \pfrac{\bf{x}}{w}
    &= h_w \bf{e}_w
\end{align*}
with $h_u, h_v, h_w > 0$ and $\bf{e}_u, \bf{e}_v,
\bf{e}_w$ are a right-handed orthonormal basis
\[ \bf{e}_u \times \bf{e}_v = \bf{e}_w \]
so
\[ \dd \bf{x} = h_u \bf{e}_u \dd u + h_v \bf{e}_v
\dd v + h_w \bf{e}_w \dd w \]
\[ \implies \dd \bf{x}^2 = h_u^2 \dd u^2 + h_v^2
\dd v^2 + h_w^2 \dd w^2 \]
(scale factors tell us the change in length)

\subsubsection*{Examples}

\begin{enumerate}[(1)]
    \item Cartesian coordinates $\bf{x} = (x, y,
        z)$ with $h_y = h_v = h_w = 1$ and
        \[ \bf{e}_x = \hat{\bf{x}}, \qquad
        \bf{e}_y = \hat{\bf{y}}, \qquad \bf{e}_z =
        \hat{\bf{z}} \]
    \item Cylindrical polar coordinates have
        \[ \bf{x} = (\rho \cos\phi, \rho \sin\phi,
        z) \]
        ($\rho \ge 0$, $\phi \in [0, 2\pi)$) or
        $\rho = \sqrt{x^2 + y^2}$ and $\tan\phi =
        \frac{y}{x}$.
        \begin{align*}
            \bf{e}_\rho
            &= \hat{\bf{\rho}} = (\cos\phi,
            \sin\phi, 0) \\
            \bf{e}_\phi
            &= \hat{\bf{\phi}} = (-\sin\phi,
            \cos\phi, 0) \\
            \bf{e}_z
            &= \hat{\bf{z}} = (0, 0, 1)
        \end{align*}
        and $h_\rho = h_z = 1$ and $h_\phi =
        \rho$.
        \begin{center}
            \includegraphics[width=0.6\linewidth]
            {images/c61bc4da8ff111ec.png}
        \end{center}
    \item Spherical polar coordinates have
        \[ \bf{x} = (r\sin\theta \cos\phi,
        r\sin\theta \sin\phi, r\cos\theta) \]
        with $r \ge 0$, $\theta \in [0, \pi]$,
        $\theta \in [0, 2\pi)$.
        \[ \implies r = \sqrt{x^2 + y^2 + z^2},
        \qquad \tan\theta = \frac{\sqrt{x^2 +
        y^2}}{z}, \qquad \tan\phi = \frac{y}{x} \]
        We have
        \begin{align*}
            \bf{e}_r
            &= \hat{\bf{r}} = (\sin\theta
            \cos\phi, \sin\theta \sin\phi,
            \cos\theta) \\
            \bf{e}_\theta
            &= \hat{\bf{\theta}} = (\cos\theta
            \cos\phi, \cos\theta \sin\phi,
            -\sin\theta) \\
            \bf{e}_\phi
            &= \hat{\bf{\phi}} = (-\sin\phi,
            \cos\phi, 0)
        \end{align*}
        with $h_r = 1$, $h_\theta = r$, $h_\phi =
        r\sin\theta$.
        \begin{center}
            \includegraphics[width=0.6\linewidth]
            {images/ed12ce088ff111ec.png}
        \end{center}
\end{enumerate}

\subsubsection*{Grad}

If we shift $\bf{x} \to \bf{x} + \dd \bf{x}$ then
a scalar field $f(\bf{x})$ changes as
\[ \dd f = \nabla f \cdot \dd \bf{x} \]
In a general coordinate system
\begin{align*}
    \dd f
    &= \pfrac{f}{u} \dd u + \pfrac{f}{v} \dd v +
    \pfrac{f}{w} \dd w \\
    &= \nabla f \cdot (h_u \bf{e}_u \dd u + h_v
    \bf{e}_v \dd v + h_w \bf{e}_w \dd w) \\
    \implies \nabla f
    &= \frac{1}{h_u} \pfrac{f}{u} \bf{e}_u +
    \frac{1}{h_v} \pfrac{f}{v} \bf{e}_v +
    \pfrac{1}{h_w} \pfrac{f}{w} \bf{e}_w
\end{align*}
using $\bf{e}_u \cdot \bf{e}_v = 0$, etc. \\
For example in cylindrical polar
\begin{flashcard}[cylindrical-grad]
\prompt{Gradient in cylindrical polar}
\[ \nabla f = \cloze{\pfrac{f}{\rho} \hat{\bf{\rho}} +
\frac{1}{\rho} \pfrac{f}{\phi} \hat{\bf{\phi}} +
\pfrac{f}{z} \hat{\bf{z}}} \]
\end{flashcard}
In spherical polar
\begin{flashcard}[spherical-grad]
\prompt{Gradient in spherical polar}
\[ \nabla f = \cloze{\pfrac{f}{r} \hat{\bf{r}} +
\frac{1}{r} \pfrac{f}{\theta} \hat{\bf{\theta}} +
\frac{1}{r\sin\theta} \pfrac{f}{\phi}
\hat{\bf{\phi}}} \]
\end{flashcard}

\subsubsection*{Div and Curl}

In general coordinates we have
\[ \nabla = \frac{1}{h_u} \bf{e}_u \pfrac{}{u} +
\frac{1}{h_v} \bf{e}_v \pfrac{}{v} + \frac{1}{h_w}
\bf{e}_w \pfrac{}{w} \]
This now acts on vector fields
\[ \bf{F} = F_u \bf{e}_u + F_v \bf{e}_v + F_w
\bf{e}_w \]
But now $\{\bf{e}_u, \bf{e}_v, \bf{e}_w\}$ depend
on $(u, v, w)$ and are hit by derivatives
$\implies$ a little messy.

\begin{claim*}
    \[ \nabla \cdot \bf{F} = \frac{1}{h_u h_v h_w}
    \left( \pfrac{}{u} (h_v h_w F_u) + \pfrac{}{v}
    (h_u h_w F_v) + \pfrac{}{w} (h_u h_v F_w) \right) \]
    \[ \nabla \times \bf{F} = \left|
    \begin{matrix}
        h_u \bf{e}_u & h_v \bf{e}_v & h_w \bf{e}_w \\
        \pfrac{}{u} & \pfrac{}{v} & \pfrac{}{w} \\
        h_u F_u & h_v F_v & h_w F_w
    \end{matrix}
    \right| \times \frac{1}{h_u h_v h_w} \]
\end{claim*}

\begin{proof}
    Nope!
\end{proof}

\myskip
For cylindrical polar
\begin{flashcard}[cylindrical-div]
\prompt{Divergence in cylindrical polar}
\[ \nabla \cdot \bf{F} = \cloze{\frac{1}{\rho}
\pfrac{(\rho F_\rho)}{\rho} + \frac{1}{\rho}
\pfrac{F_\phi}{\phi} + \pfrac{F_z}{z}} \]
\end{flashcard}
\[ \nabla \times \bf{F} = \left( \frac{1}{\rho}
\pfrac{F_z}{\phi} - \pfrac{F_\phi}{z} \right)
\hat{\bf{\rho}} + \left( \pfrac{F_\rho}{z} -
\pfrac{F_z}{\rho} \right) \hat{\bf{\phi}} +
\frac{1}{\rho} \left( \pfrac{(pF_\phi)}{\rho} -
\pfrac{F_\rho}{\phi} \right) \hat{\bf{z}} \]
\begin{align*}
    \nabla^2 f
    &= \nabla \cdot \nabla f \\
    &= \frac{1}{\rho} \pfrac{}{\rho} \left( \rho
    \pfrac{f}{\rho} \right) + \frac{1}{\rho^2}
    \pfrac[2]{f}{\phi} + \pfrac[2]{f}{z}
\end{align*}
\begin{hiddenflashcard}[cylindrical-laplacian]
\prompt{Laplacian in cylindrical polar}
\[
    \nabla^2 f
    = \cloze{\frac{1}{\rho} \pfrac{}{\rho} \left( \rho
    \pfrac{f}{\rho} \right) + \frac{1}{\rho^2}
    \pfrac[2]{f}{\phi} + \pfrac[2]{f}{z}}
\]
\end{hiddenflashcard}
\myskip
For spherical polar
\begin{flashcard}[spherical-div]
\prompt{Divergence in spherical polar}
\[ \nabla \cdot \bf{F} = \cloze{\frac{1}{r^2}
\pfrac{(r^2 F_r)}{r} + \frac{1}{r\sin\theta}
\pfrac{(\sin\theta F_\theta)}{\theta} +
\frac{1}{r\sin\theta} \pfrac{F_\phi}{\phi}} \]
\end{flashcard}
\[ \nabla \times \bf{F} = \frac{1}{r\sin\theta}
\left( \pfrac{(\sin\theta F_\phi)}{\theta} -
\pfrac{F_\theta}{\phi} \right) \hat{\bf{r}} +
\frac{1}{r} \left( \frac{1}{\sin\theta}
\pfrac{F_r}{\phi} - \pfrac{(rF_\phi)}{r} \right)
\hat{\bf{\theta}} + \frac{1}{r} \left(
\pfrac{(rF_\theta)}{r} - \pfrac{F_r}{\theta}
\right) \hat{\bf{\theta}} \]
\begin{flashcard}[spherical-laplacian]
\prompt{Laplacian in spherical polar}
\[ \nabla^2 f = \cloze{\frac{1}{r^2} \pfrac{}{r} \left(
r^2 \pfrac{f}{r} \right) + \frac{1}{r^2\sin\theta}
\pfrac{}{\theta} \left( \sin\theta
\pfrac{f}{\theta} \right) +
\frac{1}{r^2\sin^2\theta} \pfrac[2]{f}{\phi}} \]
\end{flashcard}
