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

\begin{corollary*}
    For a scalar field $\phi$
    \[ \int_V \nabla \phi \dd V = \int_{\partial
    V} \phi \bf{\dd s} \]
\end{corollary*}

\begin{proof}
    Use divergence theorem with
    \[ \bf{F} = \phi \bf{a} \]
    with $\bf{a}$ a constant.
    \[ \int_V \nabla \cdot (\phi \bf{a}) \dd V =
    \int_{\partial V} \phi \bf{a} \cdot \bf{\dd s} \]
    \[ \implies \bf{a} \cdot \left[ \int_V \nabla
    \phi \dd V - \int_{\partial V} \phi \bf{\dd s}
    \right] = 0 \]
    But true $\forall\,\,\bf{a}$ implies the result.
\end{proof}

\subsection{An Application: Conservation Laws}

Many things are conserved, for example energy,
momentum, angular momentum, electric charge.
Importantly, all of these are conserved
\emph{locally}. This means that stuff moves
continuously to nearby points. \myskip
Let $\rho(\bf{x}, t)$ be the density of the
conserved object, for example electric charge.
Then
\[ Q = \int_V \rho \dd V \]
is the charge in a region $V$. Conservation of $Q$
means that there exists a vector $\bf{J}(\bf{x},
t)$, known as a \emph{current density} such that
\[ \pfrac{\rho}{t} + \nabla \cdot \bf{J} = 0 \]
This is the \emph{continuity equation}. \myskip
The change of $Q$ in some fixed region $V$ is
\begin{align*}
    \dfrac{Q}{t}
    &= \int_V \pfrac{\rho}{t} \dd V \\
    &= -\int_V \nabla \cdot \bf{J} \dd V \\
    &= -\int_S \bf{J}  \cdot \bf{\dd s}
\end{align*}
($\bf{J}$ is current flowing in/out of $V$).
If $\bf{J}(\bf{x}) = 0$ on $S$ then $\dot{Q} = 0$.
Often consider $V = \RR^3$ and $\dot{Q} = 0$
provided that $J(\bf{x}) \to 0$ suitably quickly
as $|\bf{x}| \to \infty$.

\begin{example*}
    A fluid has mass density $\rho(\bf{x}, t)$ and
    mass current $\bf{J} = \rho \bf{u}$ with
    $\bf{u}(\bf{x}, t)$ the velocity field. \\
    Mass is conserved
    \[ \implies \pfrac{\rho}{t} + \nabla \cdot
    \bf{J} = 0 \]
    But many fluids are incompressible with $\rho
    = \text{ constant}$. Then continuity equation
    gives
    \[ \nabla \cdot \bf{u} = 0 \]
\end{example*}

\begin{example*}[Diffusion]
    Consider a gas with energy density
    $\eps(\bf{x}, t)$. Energy is conserved
    \[ \implies \pfrac{\eps}{t} + \nabla \cdot
    \bf{J} = 0 \]
    ($\bf{J}$ is \emph{heat current}) \\
    \ul{Fact 1}:
    \[ \eps(\bf{x}, t) = c_v T(\bf{x}, t) \]
    where $c_v$ is heat capacity and $T$ is
    temperature. \\
    \ul{Fact 2}: (Fick's law) Heat current is due
    to temperature differences
    \[ \bf{J} = -\kappa \nabla T \]
    ($\kappa$ is thermal conductivity)
    \[ \implies \pfrac{T}{t} = D\nabla^2 T \]
    i.e. the heat equation with $D =
    \frac{\kappa}{c_v}$.
\end{example*}
