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

\subsection{Green's Theorem in the Plane}

\begin{theorem*}[Green's Theorem]
    Let $P(x, y)$ and $Q(x, y)$ be smooth functions on
    $\RR^2$. Then
    \[ \int_A \left( \pfrac{Q}{x} - \pfrac{P}{y}
    \right) \dd A = \oint_C P \dd x + Q \dd y \]
    with $C = \partial A$ traversed anti-clockwise.
\end{theorem*}

\begin{proof}
    Let $\bf{F} = (Q, -P)$ so
    \[ \int_A \nabla \cdot \bf{F} \dd A = \int_A
    \left( \pfrac{Q}{x} - \pfrac{P}{y} \right) \dd
    A = \oint_C \bf{F} \cdot \bf{n} \dd s \]
    by 2D divergence theorem. \\
    Parametrise $C$ by
    \[ \bf{x}(s) = (x(s), y(s)) \]
    so the tangent vector is
    \[ \bf{t} = (x'(s), y'(s)) \]
    and the normal is
    \[ \bf{n} = (y'(s), -x'(s)) \]
    so that $\bf{n} \cdot \bf{t} = 0$.
    \begin{center}
        \includegraphics[width=0.6\linewidth]
        {images/33bb969e999511ec.png}
    \end{center}
    If $s$ increases in an anti-clockwise
    direction, then $\bf{n}$ is outward pointing
    normal.
    \[ \bf{F} \cdot \bf{n} = Q \dfrac{y}{s} + P
    \dfrac{x}{s} \]
    \[ \implies \oint_C \bf{F} \cdot \bf{n} \dd s
    = \oint_C P \dd x + Q \dd y \]
\end{proof}

\begin{note*}
    We can also use this theorem when $C =
    \partial A$ has disconnected components.
    \begin{center}
        \includegraphics[width=0.6\linewidth]
        {images/ce988488999511ec.png}
    \end{center}
    The two line integrals across the gap cancel.
\end{note*}

\begin{example*}
    $P = x^2y$ and $Q = xy^2$. Integrate over
    \begin{center}
        \includegraphics[width=0.6\linewidth]
        {images/fb719954999511ec.png}
    \end{center}
    \begin{claim*}
        \[ \int_A (y^2 - x^2) \dd A = \oint_C x^2y
        \dd x + xy^2 \dd y \]
    \end{claim*}
    \begin{proof}
        This is Example Sheet 1, Question 9 (both
        sides are equal to $\frac{104}{105}a^4$).
    \end{proof}
\end{example*}

\subsection{Stokes Theorem}

\begin{theorem*}[Stokes Theorem]
    Let $S$ be a smooth surface in $\RR^3$ with
    boundary $C = \partial S$. Then for a smooth
    vector field $\bf{F}(\bf{x})$
    \[ \int_S \nabla \times \bf{F} \cdot \bf{\dd
    s} = \oint_C \bf{F} \cdot \bf{\dd x} \]
\end{theorem*}

\noindent
To fix the orientation, if $\bf{n}$ is a normal to
$S$ and $\bf{t}$ is tangent to $C$ then $\bf{t}
\times \bf{n}$ should point out of $S$.
\begin{center}
    \includegraphics[width=0.6\linewidth]
    {images/a03bc0b8999611ec.png}
\end{center}
If $\bf{n}$ points towards you, then orientation
of $C$ is anti-clockwise.

\begin{note*}
    Stokes theorem gives a meaning to curl. For
    suitably small $S$, $\nabla \times \bf{F}
    \approx \text{ constant}$ and
    \[ \int_S \nabla \times \bf{F} \cdot \bf{\dd
    s} \approx A \bf{n} \cdot (\nabla \times
    \bf{F}) \]
    where $A$ is the area of $S$ and $\bf{n}$ is
    the normal to $S$.
    \[ \implies \bf{n} \cdot (\nabla \times
    \bf{F}) = \lim_{A \to 0} \frac{1}{A} \int_C
    \bf{F} \cdot \bf{\dd x} \]
    i.e. curl in direction $\bf{n}$ is circulation
    in plane normal to $\bf{n}$. This also gives
    some intuition for Stokes' theorem:
    \begin{center}
        \includegraphics[width=0.6\linewidth]
        {images/575b0c9a999711ec.png}
    \end{center}
    At each point in $S$, $\nabla \times \bf{F}$
    is circulation. But this cancels in the
    interior, leaving only the boundary
    contribution.
\end{note*}

\begin{corollary*}
    Irrotational $\implies$ conservative:
    \[ \nabla \cdot \bf{F} = 0 \implies \oint_C
    \bf{F} \cdot \bf{\dd x} = 0 \qquad \forall
    \text{ closed $C$} \]
    \[ \implies \bf{F} = \nabla \phi \]
    from Section 1.
\end{corollary*}

\begin{example*}
    $S$ is a hemispherical cap of radius $R$ with
    $0 \le \theta \le \alpha$.
    \begin{center}
        \includegraphics[width=0.3\linewidth]
        {images/fc342fee999711ec.png}
    \end{center}
    \[ \bf{F} = (0, xz, 0) \]
    \[  \implies \nabla \times \bf{F} = (-x, 0, z) \]
    and
    \[ \int_S \nabla \times \bf{F} \cdot \bf{\dd
    s} = \pi R^3 \cos \alpha \sin^2 \alpha \]
    from Section 2. \\
    For the line integral, let
    \[ \bf{x}(\phi) = R(\sin\alpha \cos\phi,
    \sin\alpha\sin\phi, \cos\alpha) \]
    where $\phi \in [0, 2\pi)$.
    \[ \implies \bf{\dd x} = R(-\sin\alpha
    \sin\phi, \sin\alpha \cos\phi, 0) \dd \phi \]
    and
    \begin{align*}
        \oint_C \bf{F} \cdot \bf{\dd x}
        &= \int_0^{2\pi} \dd \phi Rxz \sin\alpha
        \cos\phi \\
        &= \int_0^{2\pi} \dd \phi R^3 \sin^2\alpha
        \cos\alpha \cos^2 \phi \\
        &= \pi R^3 \sin^2 \alpha \cos\alpha
    \end{align*}
\end{example*}

\begin{example*}
    Cone $z^2 = x^2 + y^2$ and $a \le z \le b$,
    $a, b > 0$.
    \begin{center}
        \includegraphics[width=0.6\linewidth]
        {images/29057bd6999811ec.png}
    \end{center}
    surface is
    \[ \bf{x}(\rho, \phi) = (\rho\cos\phi,
    \rho\sin\phi, \rho) \]
    where $0 \le \phi < 2\pi$ and $a \le \rho \le
    b$. Tangent vectors:
    \[ \pfrac{\bf{x}}{\rho} = (\cos\phi, \sin\phi,
    1) \]
    \[ \pfrac{\bf{x}}{\phi} = \rho(-\sin\phi,
    \cos\phi, 0) \]
    \[ \implies \bf{n} = \pfrac{\bf{x}}{\rho}
    \times \pfrac{\bf{x}}{\phi} = (-\rho\cos\phi,
    -\rho\sin\phi, \rho) \]
    (points inwards).
    \[ \implies \bf{\dd s} = \rho(-\cos\phi,
    -\sin\phi, 1) \dd \rho \dd \phi \]
    Again integrate $\bf{F} = (0, xz, 0)$
    \begin{align*}
        \implies \nabla \times \bf{F} \cdot
        \bf{\dd s}
        &= (x\cos\phi + z) \rho \dd \rho \dd \phi
        \\
        &= \rho^2(1 + \cos^2\phi) \dd \rho \dd
        \phi \\
        \implies \int_S \nabla \times \bf{F} \cdot
        \bf{\dd s}
        &= \int_a^b \dd \rho \int_0^{2\pi} \dd
        \phi \rho^2 (1 + \cos^2\phi) \\
        &= \pi(b^3 - a^3)
    \end{align*}
    Compare to line integral over $\partial S =
    C_b - C_a$.
\end{example*}
