\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{enumerate}
\usepackage{ifthen}
\usepackage{ulem} % for strikethrough \sout{...} command
\usepackage{color}
\setlength{\oddsidemargin}{-0.5in}
\setlength{\evensidemargin}{-0.5in}
\setlength{\topmargin}{-0.5in}
\setlength{\headheight}{0.0in}
\setlength{\headsep}{0.0in}
\setlength{\topskip}{0.0in}
\setlength{\textheight}{9.75in}
\setlength{\textwidth}{7.5in}

\usepackage{tikz,pgfplots}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{arrows.meta}


\newcommand{\bdot}{\, {\scriptstyle{\bullet}} \,}
\newcommand{\B}[1]{{\bf {#1}}}
\newcommand{\la}{\langle}
\newcommand{\ra}{\rangle}

\newcommand{\myspace}{\parbox[c][0.2in]{0.2in}{\hfill}}
\newcommand{\varspace}[2]{\mbox{\parbox[c][#1]{#2}{\hfill}}}
\newcommand{\force}{{$\mbox{\,\!}$}}

\begin{document}

%\pagestyle{empty}

\noindent
\parbox{1.5in}{\bf Math 2130}
\hfill {\Large \bf A Bit about Curl, Divergence, and Forms} \hfill
\parbox{1.5in}{\bf \hfill Supplement}

\vspace{0.2in}

The calculus of vector fields can be generalized and extended in several surprising ways. Here we will present how to compute curl and divergence, briefly explain what these derivatives do geometrically, and then sketch out the notion of differential forms and the exterior derivative. We conclude by discussing how to find a potential function for a conservative vector field.

\vspace{0.1in}

\noindent {\bf\large Calculation:}

\vspace{0.05in}

To begin consider the symbol: $\nabla$ (called nabla or del or the gradient operator). We are already familiar with the gradient of a scalar valued function. Let us reconsider ``how'' it is computed. Define: $\nabla = \left\langle \dfrac{\partial}{\partial x}, \dfrac{\partial}{\partial y}, \dfrac{\partial}{\partial z} \right\rangle$. We need to be careful here. The symbol $\nabla$ does {\it not} stand for a vector of functions which are partials of something, it is shorthand for a vector of partial derivative {\it operators}. So $\nabla$ is a vector of operators not a vector of functions (i.e., not a vector field).

Let $f(x,y,z)$ be a scalar valued function. Then $\nabla f = \left\langle \dfrac{\partial}{\partial x}, \dfrac{\partial}{\partial y}, \dfrac{\partial}{\partial z} \right\rangle f = \left\langle \dfrac{\partial f}{\partial x}, \dfrac{\partial f}{\partial y}, \dfrac{\partial f}{\partial z} \right\rangle$ (i.e., the gradient of $f$). Notice that ``$\nabla f$'' is sort of scaling $\nabla$ by $f$. However, instead of multiplying the components of $\nabla$ by $f$, we are applying the operators inside of $\nabla$ to the function $f$.

\vspace{0.05in}

\noindent {\bf Example:} If $f(x,y,z) = xy^2z^3+x^5y+7z$, then $\nabla f = \langle f_x, f_y, f_z \rangle = \langle y^2z^3+5x^4y,2xyz^3+x^5,3xy^2z^2+7 \rangle$.

\vspace{0.05in}

Next, if we try to fit $\nabla$ into a dot and/or cross product, we get divergence and curl. First, the easier one: divergence. To use a dot product we need two vectors. Let $\B F = \langle M,N,P \rangle$. Then we define the divergence of $\B F$ by:
$$ \nabla \bdot \B F = \left\langle \dfrac{\partial}{\partial x}, \dfrac{\partial}{\partial y}, \dfrac{\partial}{\partial z} \right\rangle \bdot \langle M, N, P \rangle = \dfrac{\partial M}{\partial x} + \dfrac{\partial N}{\partial y} + \dfrac{\partial P}{\partial z}$$
Again, notice that $\nabla$ is not filled with functions. We are not computing partials of components of $\B F$, sticking them into $\nabla$, and then computing a dot product. Instead, $\nabla \bdot \B F$ is telling us which partials of which components of $\B F$ to compute and how to add them up. In particular, when computing the dot product, $\dfrac{\partial}{\partial x} \cdot M$ doesn't mean multiplying $\partial/\partial x$ by $M$ but instead it means applying this operator to $M$.

\vspace{0.05in}

\noindent {\bf Example:} If $\B F(x,y,z) = \left\langle x^2+yz, x^3y^2z, \sin(x^3y^5)+10z \right\rangle$, then $$\nabla \bdot \B F = \dfrac{\partial}{\partial x}\left[ x^2+yz \right] + \dfrac{\partial}{\partial y}\left[ x^3y^2z \right] + \dfrac{\partial}{\partial z}\left[ \sin(x^3y^5)+10z \right]=2x+2x^3yz+10.$$

\vspace{0.05in}

Our last new operation, curl, is built from the cross product. To use a cross product, again, we need two vectors. Let $\B F = \langle M,N,P \rangle$. Then we define the curl of $\B F$ as follows:
$$ \nabla \times \B F = \begin{vmatrix} \B i & \B j & \B k \vspace{0.05in} \\ \frac{\partial}{\partial x} & \frac{\partial}{\partial y} & \frac{\partial}{\partial z}  \vspace{0.05in} \\ M & N & P \end{vmatrix} = 
 \begin{vmatrix} \frac{\partial}{\partial y} & \frac{\partial}{\partial z}  \vspace{0.05in} \\ N & P \end{vmatrix}\B i -
 \begin{vmatrix} \frac{\partial}{\partial x} & \frac{\partial}{\partial z}  \vspace{0.05in} \\ M & P \end{vmatrix}\B j +
 \begin{vmatrix} \frac{\partial}{\partial x} & \frac{\partial}{\partial y}  \vspace{0.05in} \\ M & N \end{vmatrix}\B k =
 \left( \dfrac{\partial P}{\partial y} - \dfrac{\partial N}{\partial z} \right)\B i -
 \left( \dfrac{\partial P}{\partial x} - \dfrac{\partial M}{\partial z} \right)\B j +
 \left( \dfrac{\partial N}{\partial x} - \dfrac{\partial M}{\partial y} \right)\B k$$
Briefly, $\nabla \times \B F = \left\langle P_y-N_z, \  -(P_x-M_z), \  N_x-M_y \right\rangle$. Again, notice that we are not populating the middle row of the determinant mnemonic with partials of components, but instead the middle row is filled with partial {\it operators}. When computing the $2 \times 2$ subdeterminants, we aren't multiplying operators and component functions, but instead are {\it applying} the appropriate operator to the appropriate component function.

\vspace{0.05in}

\noindent {\bf Example:} If $\B F(x,y,z) = \left\langle x^2+yz, x^3y^2z, \sin(x^3y^5)+10z \right\rangle$, then $$\nabla \times \B F = 
 \begin{vmatrix} \B i & \B j & \B k \vspace{0.05in} \\ \frac{\partial}{\partial x} & \frac{\partial}{\partial y} & \frac{\partial}{\partial z}  \vspace{0.05in} \\ x^2+yz & x^3y^2z & \sin(x^3y^5)+10z \end{vmatrix} = 
 \begin{vmatrix} \frac{\partial}{\partial y} & \frac{\partial}{\partial z}  \vspace{0.05in} \\ x^3y^2z & \sin(x^3y^5)+10z \end{vmatrix}\B i - 
 \begin{vmatrix} \frac{\partial}{\partial x} & \frac{\partial}{\partial z}  \vspace{0.05in} \\ x^2+yz &  \sin(x^3y^5)+10z \end{vmatrix}\B j +
 \begin{vmatrix} \frac{\partial}{\partial x} & \frac{\partial}{\partial y}  \vspace{0.05in} \\ x^2+yz & x^3y^2z \end{vmatrix}\B k$$

$$=
\left(\dfrac{\partial}{\partial y}\left[ \sin(x^3y^5)+10z \right] - \dfrac{\partial}{\partial z}\left[ x^3y^2z \right]\right)\B i -
\left(\dfrac{\partial}{\partial x}\left[ \sin(x^3y^5)+10z \right] - \dfrac{\partial}{\partial z}\left[ x^2+yz \right]\right)\B j+
\left(\dfrac{\partial}{\partial x}\left[ x^3y^2z \right] - \dfrac{\partial}{\partial y}\left[ x^2+yz \right]\right)\B k$$

$$=\Big\langle 5x^3y^4\cos(x^3y^5)-x^3y^2, -\left(3x^2y^5\cos(x^3y^5)-y\right), 3x^2y^2z-z \Big\rangle.$$

\noindent
{\it Note on notation:} While I typically stick to the $\nabla$-notation, it is also very common to see authors use abbreviated names to label the above operations. For example, $\mathrm{grad}(f) = \nabla f$ for gradient, $\mathrm{curl}(\B F) = \nabla \times \B F$ for curl, and $\mathrm{div}(\B F) = \nabla \bdot \B F$ for divergence. 

\newpage 

\vspace{0.1in}

\noindent {\bf\large Interpretation:}

\vspace{0.05in}

We have already seen that divergence is easier to compute than curl. It is also easier to explain what it is computing geometrically and physically. Divergence is computing an infinitesimal rate of flux per unit volume whereas curl computes an axis of rotation capturing infinitesimal circulation per unit area. 

First, divergence. Consider the following vector fields:

\vspace{0.05in}

\force
\hfill
\begin{tikzpicture}[scale=0.4]
\begin{axis}[
    axis lines=none,
    view={0}{90},
    domain=-4:4,
    y domain=-4:4,
    xmax=5, ymax=5,
    samples=6,
    color=red
]
\addplot3 [black, quiver={u={x}, v={y}, scale arrows=0.25, every arrow/.append style={-latex}}] (x,y,0);

\draw plot [mark=*, mark size=4] coordinates{(axis cs: 0,0,0)}; 
%\node at (axis cs:0,0,0) [label=-90:{\color{black}$\nabla \bdot \B F >0$}] {};
\end{axis}
\end{tikzpicture}
\hfill \hfill
\begin{tikzpicture}[scale=0.4]
\begin{axis}[
    axis lines=none,
    view={0}{90},
    domain=-4:4,
    y domain=-4:4,
    xmax=5, ymax=5,
    samples=6,
    color=red
]
\addplot3 [black, quiver={u={-x}, v={-y}, scale arrows=0.25, every arrow/.append style={-latex}}] (x,y,0);

\draw plot [mark=*, mark size=4] coordinates{(axis cs: 0,0,0)}; 
%\node at (axis cs:0,0,0) [label=-90:{\color{black}$\nabla \bdot \B F >0$}] {};
\end{axis}
\end{tikzpicture}
\hfill \hfill
\begin{tikzpicture}[scale=0.4]
\begin{axis}[
    axis lines=none,
    view={0}{90},
    domain=-4:4,
    y domain=-4:4,
    xmax=5, ymax=5,
    samples=6,
    color=red
]
\addplot3 [black, quiver={u={0}, v={3}, scale arrows=0.25, every arrow/.append style={-latex}}] (x,y,0);

\draw plot [mark=*, mark size=4] coordinates{(axis cs: 0,0,0)}; 
%\node at (axis cs:0,0,0) [label=-90:{\color{black}$\nabla \bdot \B F >0$}] {};
\end{axis}
\end{tikzpicture}
\hfill
\force

%\vspace{0.1in}

\force 
\hfill
$\nabla \bdot \B F>0$ \hfill \hfill
$\nabla \bdot \B F<0$ \hfill \hfill
$\nabla \bdot \B F=0$ 
\hfill
\force

\vspace{0.05in}

Imagine our vector fields indicate a fluid flowing. In field on the left, notice fluid flows out from the center. This diverges from the center point and so we have positive divergence there. Likewise, the middle field flows into the center and so we have negative divergence (one might say ``convergence''?). Now consider the final vector field on the right. Everything is flowing upward, but importantly, the amount flowing into the center dot is the same as the amount flowing out of the center dot. Thus the net divergence at that point (and every other one) is zero.

In science one makes many simplifying assumptions to make calculations tractable. For example, if $\B F$ measures fluid flow, one might assume that $\nabla \bdot \B F = 0$. Such a vector field is said to be divergence free and the fluid is {\bf incompressible} (there's no net flow in or out of any point). 

{}[Assuming we already know about flux integrals\dots] Before moving on to curl, let us mention a more physical/geometric definition of divergence. This definition isn't really helpful for calculation, but it does better justify our above interpretation. Let $E$ be a reasonably nice solid containing a point $p$. Recall that $\iint\limits_{\partial E} \B F \bdot \B n \,d\sigma$ computes the flux of $\B F$ out through the boundary of $E$ (i.e., ``how much of $\B F$ flows through the surface of $E$''). Then
 
 \vspace{-0.2in}
 
\force \hfill
$\displaystyle (\nabla \bdot \B F)(p) = \lim\limits_{E \to \{p\}} \dfrac{1}{\mathrm{vol}(E)} \iint\limits_{\partial E} \B F \bdot \B n \,d\sigma$ \qquad\force

where the ``limit'' is taken over all ``reasonably nice'' solids containing the point $p$ and is limiting so that $\mathrm{vol}(E) \to 0$. Thus the divergence of $\B F$ at the point  $p$ is $\B F$'s infinitesimal flux per unit volume at $p$. 

\vspace{0.05in}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Now, curl. Consider the following vector fields:

\vspace{0.05in}

\force
\hfill
\begin{tikzpicture}[scale=0.4]
\begin{axis}[
    axis lines=none,
    view={0}{90},
    domain=-4:4,
    y domain=-4:4,
    xmax=5, ymax=5,
    samples=6,
    color=red
]
\addplot3 [black, quiver={u={-2*y}, v={2*x}, scale arrows=0.25, every arrow/.append style={-latex}}] (x,y,0);

\draw plot [mark=*, mark size=4] coordinates{(axis cs: 0,0,0)}; 
%\node at (axis cs:0,0,0) [label=-90:{\color{black}$\nabla \bdot \B F >0$}] {};
\end{axis}
\end{tikzpicture}
\hfill \hfill
\begin{tikzpicture}[scale=0.4]
\begin{axis}[
    axis lines=none,
    view={0}{90},
    domain=-4:4,
    y domain=-4:4,
    xmax=5, ymax=5,
    samples=6,
    color=red
]
\addplot3 [black, quiver={u={-y}, v={x}, scale arrows=0.25, every arrow/.append style={-latex}}] (x,y,0);

\draw plot [mark=*, mark size=4] coordinates{(axis cs: 0,0,0)}; 
%\node at (axis cs:0,0,0) [label=-90:{\color{black}$\nabla \bdot \B F >0$}] {};
\end{axis}
\end{tikzpicture}
\hfill \hfill
\begin{tikzpicture}[scale=0.4]
\begin{axis}[
    axis lines=none,
    view={0}{90},
    domain=-4:4,
    y domain=-4:4,
    xmax=5, ymax=5,
    samples=6,
    color=red
]
\addplot3 [black, quiver={u={y}, v={-x}, scale arrows=0.25, every arrow/.append style={-latex}}] (x,y,0);

\draw plot [mark=*, mark size=4] coordinates{(axis cs: 0,0,0)}; 
%\node at (axis cs:0,0,0) [label=-90:{\color{black}$\nabla \bdot \B F >0$}] {};
\end{axis}
\end{tikzpicture}
\hfill \hfill
\begin{tikzpicture}[scale=0.4]
\begin{axis}[
    axis lines=none,
    view={0}{90},
    domain=-4:4,
    y domain=-4:4,
    xmax=5, ymax=5,
    samples=6,
    color=red
]
\addplot3 [black, quiver={u={x}, v={y}, scale arrows=0.25, every arrow/.append style={-latex}}] (x,y,0);

\draw plot [mark=*, mark size=4] coordinates{(axis cs: 0,0,0)}; 
%\node at (axis cs:0,0,0) [label=-90:{\color{black}$\nabla \bdot \B F >0$}] {};
\end{axis}
\end{tikzpicture}
\hfill
\force

%\vspace{0.1in}

\force 
\hfill
$\nabla \times \B F=4\B k$ \hfill \hfill
$\nabla \times \B F=2\B k$ \hfill \hfill
$\nabla \times \B F=-2\B k$ \hfill \hfill
$\nabla \times \B F=\B 0$ 
\hfill
\force

\vspace{0.05in}

Imagine dropping a small object like a paddle wheel in the middle of one of these vector fields. The field pushes on the paddles and it starts to spin around. Curl gives the axis of rotation (obeying a right hand rule) and its length relates to how fast the paddle wheel spins around. Notice the first two vector fields push on the central point in a counter-clockwise manner. This means that we rotate around the $\B k$ vector (i.e., have a vertical axis of rotation). The first field has longer arrows than the second, so it is causing faster rotations. That is why the first field's curl is $4\B k$ while the second field's curl is only $2\B k$. 

Consider the third field from the left. It is the same as the second field except the arrows flow in a clockwise direction. This means that our imaginary object in the center of the field would rotate about the same axis as in the second field but it would rotate in the opposite direction. Thus the curls of the middle two fields should differ by a minus sign. Take your right hand and let your fingers flow in the vector field direction. You will see that the second field makes your thumb point up out of the page (axis $2\B k$) while the third field causes your thumb to point down into the page (axis $-2\B k$). 

Finally, the last field (which is also our first divergence example) pushes on our dot in a way that no rotation would occur. Thus curl is zero. The same is true for the other divergence examples (they are all zero curl). Assuming a field has zero curl is often a useful assumption. If $\nabla \times \B F = \B 0$, we say $\B F$ is {\bf irrotational}. 

Like divergence, curl can be defined in a less calculational and more physical/geometric fashion. But this is far trickier than divergence. Let $p$ be a point and $\B n$ be some fixed unit vector. Then 

\vspace{-0.15in}

\force \hfill
$\displaystyle (\nabla \times \B F)(p) \bdot \B n = \lim\limits_{S_1 \to \{p\}} \dfrac{1}{\mathrm{area}(S_1)} \int\limits_{\partial S_1} \B F \bdot d\B r$
\quad \force

where the ``limit'' is taken over all smooth surfaces $S_1$ which contain the point $p$ with orientation matching $\B n$ at $p$. Recall that $\partial S_1$ is the appropriately oriented boundary of $S_1$. Also, our limit (much like with divergence) forces $\mathrm{area}(S_1) \to 0$. Notice that the line integral is computing circulation, so curl is infinitesimal circulation per unit area.

This doesn't actually calculate curl directly. It merely calculates the $\B n$-component of curl. If one does this for $\B n=\B i$, $\B j$, and $\B k$, they could determine $(\nabla \times \B F)(p)$. But again, this (implicit) definition is for interpretation not for computation.

\vspace{0.05in}

\noindent {\bf\large Differential Forms and the Exterior Derivative:}

\vspace{0.05in}

While gradient, curl, and divergence may look very different on the surface, they are all special cases of a more general kind of derivative known as an {\it exterior derivative}. Let's take a little space to give a bird's eye view of differential forms and the exterior derivative. {\it Notation:} We will assume that $f$, $M$, $N$, and $P$ are all scalar valued functions with  continuous second partial derivatives.

We have seen objects like $dx$, $dy$, and $dz$ before. Without worrying about what these thing {\it really} are, imagine we can multiply (``wedge'') them together and create products like: $dx \wedge dy$ or $dx \wedge dz \wedge dy$. Properly defined, the $\wedge$-product is function-multilinear (we can break up at $+$ signs and pull out scalar valued functions): $(f\,dx-3\,dy) \wedge (g\,dz) = fg\,dx \wedge dz -3g\,dy\wedge dz$. It is also alternating and thus skew-symmetric: $dx \wedge dx=0$ and $dx \wedge dy = - dy \wedge dx$. We call a scalar valued function like $f(x,y)=x^3y+5x$ a $0$-form, things like $x^2y\,dx+3xy\,dy$ are $1$-forms, and $dx \wedge dy$ is a $2$-form. 

In $\mathbb{R}^3$, we have $0$-forms: $f$, $1$-forms: $M\,dx+N\,dy+P\,dz$, $2$-forms: $M\,dy\wedge dz+N\,dz\wedge dx+P\,dx\wedge dy$, and $3$-forms: $f\,dx\wedge dy\wedge dz$. Notice that we don't need to include $dx\wedge dx=0$ or $dy\wedge dx = -dx\wedge dy$ in our $2$-forms ($dy\wedge dz$, $dz\wedge dx$, and $dx\wedge dy$ cover everything). Likewise, any $3$-form built from $dx$, $dy$, and $dz$ is either $0$ or a multiple or $dx\wedge dy \wedge dz$. Here is a dictionary:

%\vspace{-0.1in}

%\force \hfill \hfill
\force \hfill
\begin{tabular}{|rclc|crcl|} \hline
function &                                      & 0-form & & &
vector field &                                      & 1-form {\Large\strut} \\
$f$         &  $\Longleftrightarrow$ & $f$      & & &
$\langle M,N,P\rangle$         &  $\Longleftrightarrow$ & $M\,dx+N\,dy+P\,dz$    {\Large\strut} \\  \hline {\Large\strut}
vector field &                                      & 2-form & & &
function &                                      & 3-form  {\Large\strut} \\
$\langle M,N,P\rangle$         &  $\Longleftrightarrow$ & $M\,dy\wedge dz+N\,dz\wedge dx+P\,dx\wedge dy$      & & &
$f$         &  $\Longleftrightarrow$ & $f\,dx \wedge dy \wedge dz$      \\ \hline
\end{tabular}
\hfill \force

\vspace{0.05in}

The exterior derivative is a certain linear map that turns an $n$-form into an $(n+1)$-form. In particular, start with a $0$-form: $f(x,y,z)$ (i.e., a scalar valued function in $\mathbb{R}^3$). The exterior derivative of $f$ is defined to be $df = f_x\,dx+f_y\,dy+f_z\,dz$. In other words, $df$ is basically just $\nabla f$ written in terms of a differential form. Exterior derivatives of higher order forms follow from the formula: $d(f\omega) = df \wedge d\omega$ for any $0$-form $f$ and $n$-form $\omega$.

$d(M\,dx+N\,dy+P\,dz) = dM \wedge dx + dN \wedge dy + dP \wedge dz = (M_x\,dx+M_y\,dy+M_z\,dz)\wedge dx + \text{etc.} = M_x \,dx\wedge dx + M_y\,dy \wedge dx + M_z\,dz\wedge dx + \text{etc.} = -M_y\,dx\wedge dy+M_z\,dz\wedge dx+\text{etc.}$. If we worked out all of the details, we would find that $d(M\,dx+N\,dy+P\,dz)$ is a 2-form which corresponds to the vector field $\nabla \times \langle M,N,P \rangle$. Likewise, $d(M\,dy\wedge dz+N\,dz\wedge dx+P\,dx\wedge dy)=\cdots=(M_x+N_y+P_z)\,dx \wedge dy \wedge dz$. In other words, when working in $\mathbb{R}^3$, the exterior of a 0-form essentially computes a gradient, the exterior of a 1-form essentially computes a curl, and the exterior of a 2-form essentially computes a divergence.  For any differential form $\omega$ (with sufficiently differentiable component functions) it turns out that \fbox{$d^2\omega = d(d\omega)=0$}. This means that \fbox{$\nabla \times \nabla f = \B 0$ and $\nabla \bdot (\nabla \times \B F) = 0$}. 

This really flows from Clairaut's Theorem and alternation/skew-symmetry used in defining the exterior deriative. In our ``classical'' notation, let us see why these properties hold. Let $f$, $M$, $N$, and $P$ all have continuous mixed partials. Then

\vspace{-0.1in}

$$\nabla \times \nabla f = \begin{vmatrix} \B i & \B j & \B k \\ \frac{\partial}{\partial x} & \frac{\partial}{\partial y} & \frac{\partial}{\partial z} \\ f_x & f_y & f_z \end{vmatrix} = \langle f_{zy}-f_{yz}, -(f_{zx}-f_{xz}), f_{yx}-f_{xy} \rangle = \langle 0,0,0\rangle$$ 

\vspace{-0.1in}

and

\vspace{-0.15in}

$$\nabla \bdot (\nabla \times \B F) = \nabla \bdot \langle P_y-N_z,-(P_x-M_z), N_x-M_y \rangle = P_{yx}-N_{zx}-P_{xy}+M_{zy}+N_{xz}-M_{yz}=0$$

\vspace{-0.05in}

There is another composition that makes sense but is trickier to relate to our exterior derivative framework, namely $\nabla^2 f = \nabla \bdot \nabla f$. It is not usually the case that $\nabla^2 f=0$. Functions satisfying this equation are called {\bf harmonic functions}, this equation is called {\bf Laplace's equation}, and $\nabla^2$ is the Laplacian operator.

\vspace{0.1in}

\noindent {\bf\large Closed \& Exact Forms vs. Conservative Vector Fields:}

\vspace{0.05in}

There is a fascinating connection between differential forms and topology (i.e., abstract geometry). One defines a differential form $\omega$ to be {\it closed} if $d\omega=0$ and we say $\omega$ is {\it exact} if $\omega=d\nu$ for some differential form $\nu$. In $\mathbb{R}^2$ and $\mathbb{R}^3$, closed $1$-forms are essentially just vector fields $\B F$ such that $\nabla \times \B F=\B 0$ (they are irrotational). Exact $1$-forms are essentially vector fields $\B F$ such that $\B F=\nabla f$ for some scalar valued function $f$ (they are conservative).

Recalling that $d^2=0$, we know that exact forms are closed. Are closed forms also exact? It turns out that the answer depends on the space we're working in. If we are working with differential forms defined on all of $\mathbb{R}^n$, the answer is ``Yes'' (this is called Poincare's lemma).  On the other hand, if we work with forms defined on the punctured plane $\mathbb{R}^2-\{(0,0)\}$ (defined everywhere except the origin), there are closed $1$-forms which aren't exact forms. How so? Well, if a $1$-form (i.e., vector field) is exact, then its line integrals must be path independent and so integrals around a closed loops are zero. 

If we consider $\B F(x,y) = \langle M,N \rangle = \langle \frac{-y}{x^2+y^2},\frac{x}{x^2+y^2} \rangle$ (which is not defined at $(0,0)$), then $M_y = \frac{y^2-x^2}{(x^2+y^2)^2}=N_x$. Thus $\B F$ corresponds to a closed $1$-form on the punctured plane. However, if we integrate around the unit circle $C$ (parameterized by $\B r(t)=\langle \cos(t),\sin(t)\rangle$ for $0 \leq t \leq 2\pi$ so $\B r'(t)=\langle -\sin(t),\cos(t)\rangle$), we get:\\
\force\hfill
 $\int_C \B F\bdot d\B r = \int_0^{2\pi} \langle \frac{-\sin(t)}{\cos^2(t)+\sin^2(t)},\frac{\cos(t)}{\cos^2(t)+\sin^2(t)}\rangle \bdot \langle -\sin(t),\cos(t)\rangle\,dt = \int_0^{2\pi} (\sin^2(t)+\cos^2(t))\,dt = \int_0^{2\pi} 1\,dt=2\pi \not =0$! \hfill\force\\
This means $\B F$ is not conservative on the punctured plane and so (thinking of $\B F$ as a $1$-form) we have it is closed but not exact.
What is going on? Recall the theorem\dots

\vspace{0.05in}

\noindent {\bf Theorem:} Criterion for Conservative Vector Fields
\begin{description}
\item[2D] Let $\B F(x,y) = \langle M(x,y),N(x,y) \rangle$ have continuous first partials defined on a {\it simply connected} region $R$ in $\mathbb{R}^2$. Then $\B F$ is conservative in  $R$ if and only if $M_y=N_x$ in $R$.
\item[3D] Let $\B F(x,y,z) = \langle M(x,y,z),N(x,y,z),P(x,y,z) \rangle$ have continuous first partials defined on a {\it simply connected} region $R$ in $\mathbb{R}^3$. Then $\B F$ is conservative in $R$ if and only if $\nabla \times \B F = \B 0$ in $R$.
\end{description}

Notice the assumption ``{\it simply connected region}''. This theorem depends on the topology (i.e., abstract geometry) of our space. The theorem doesn't work if our spaces has ``holes''. Without getting into more detail, let's just mention that the theory that tackles these issues in general is called de Rham cohomology. When the de Rham cohomology is ``trivial'' we have that closed forms and exact forms are the same thing.

\vspace{0.1in}

\noindent {\bf\large Finding Potential Functions:}

\vspace{0.05in}

When $\B F$ is conservative, we have a potential function $f$ (so $\nabla f = \B F$). There is a careful algorithm for constructing such a function. For a conservative vector field $\B F=\langle M,N \rangle$ in $\mathbb{R}^2$, first you compute $f(x,y) = \int M(x,y)\,dx = g(x,y)+\ell(y)$ where $g(x,y)$ is some fixed antiderivative (with respect to $x$) of $M(x,y)$. Since partial differentiation with respect to $x$ kills whole functions of $y$, we add an arbitrary {\it function} of $y$: $\ell(y)$. Next, we need $N = f_y = g_y + \ell'$ so $\ell' = N-g_y$. Thus let $\ell(y) = \int N(x,y)-g_y(x,y)\,dy$. Notice that $(N-g_y)_x = N_x-g_{yx}=N_x-g_{xy}=N_x-M_y$ (since $g$ is an antiderivative of $M$ with respect to $x$). This is zero since $N_x=M_y$ ($\B F$ is conservative). Therefore, $N-g_y$ does not depend on $x$ at all. Our integral, $\int N-g_y\,dy$ is a regular indefinite integral of a single variable (i.e., $y$). Thus $\ell(y) = \int N-g_y\,dy = h(y)+C$ for some fixed antiderivative $h$ and arbitrary constant $C$. If we let $f(x,y) = g(x,y)+h(y)+C$, then $f_x = g_x = M$ and $f_y = g_y+h' = g_y+(N-g_y)=N$. Therefore, $\nabla f = \B F$.

There is a similar (even more involved) algorithm for conservative vector fields in $\mathbb{R}^3$, but instead we offer a shortcut. To find $f$, notice that $f=\int f_x\,dx=\int M\,dx$ and $f=\int f_y\,dy=\int N\,dy$ and $f=\int f_z\,dz=\int P\,dz$. Each integral undoes partial differentiation with respect to some variable. These integrals cannot see functions consisting entirely of the other two variables. For example, $\int M\,dx$ cannot detect functions of only $y$ and $z$. Likewise, $\int N\,dy$ misses functions of only $x$ and $z$ and $\int P\,dz$ misses functions of only $x$ and $y$.

But if we put all three results together we should get every piece of $f$. Thus we compute $\int M\,dx$, $\int N\,dy$, and $\int P\,dz$. Then we only include each ``term'' once. We will find that terms involving $x$ and $y$ and $z$ appear three times. Terms involving only two variables will appear exactly twice (if a term only involves $x$ and $y$, it will appear in both $\int M\,dx$ and $\int N\,dy$ but not in $\int P\,dz$). Finally, terms only involving one variable will appear exactly one time (if a term involves only $x$, it will only appear in $\int M\,dx$). Being careful to only include each distinct term once, we will get our desired potential function.

As a warning, this is not really an algorithm. It's more of a heuristic. We don't find {\it the} antiderivative of a function. Instead we find {\it an} antiderivative. It is possible to integrate in such a way that terms don't exactly line up and our heuristic fails. When integrating {\it by hand}, this won't typically happen. If we were writing software to find a potential function, we would need a careful algorithm (like the one we mentioned for the 2-dimensional case).

\vspace{0.05in}

\noindent {\bf Example:} The vector field $\B F = \langle y^3+5x^4, 3xy^2+2 \rangle$ is conservative since $M_y = 3y^2=N_x$ where $M = y^3+5x^4$ and $N=3xy^2+2$. Let's find potential functions for $\B F$: (i) Using the algorithm and (ii) Using our shortcut.

\vspace{0.05in}
\noindent
(i) $f(x,y) = \int M\,dx = \int y^3+5x^4\,dx = xy^3+x^5 + \ell(y)$. Differentiating $f$ with respect to $y$ yields: $f_y = 3xy^2+0+\ell'(y)$ but it should be $f_y=N=3xy^2+2$. So $\ell'(y) =(3xy^2+2)-(3xy^2) = 2$. Thus $\ell(y) = \int 2\,dy = 2y+C$ ($C$ is an arbitrary constant). Thus $f(x,y) = xy^3+x^5+2y+C$.

\vspace{0.05in}
\noindent
(ii) $\int M\,dx = \int y^3+5x^4\,dx = xy^3+x^5+C_1(y)$ and $\int N\,dy = \int 3xy^2+2\,dy = xy^3+2y+C_2(x)$. Putting these together (including each term only once), we get $f(x,y)=xy^3+x^5+2y$ ($+C$ if we want to account for all possible potential functions). Notice that $xy^3$ appeared twice since it involves two variables while $x^5$ and $2y$ each only appeared once.

\vspace{0.05in}

\noindent {\bf Example:} The vector field $\B F = \langle 2xe^{-y}\sin(z)+3x^2y^2+1, -x^2e^{-y}\sin(z)+2x^3y+z, x^2e^{-y}\cos(z)+y+2z \rangle$ is conservative since $\nabla \times \B F = \B 0$ (you can check). Let's find a potential function.
$$\int 2xe^{-y}\sin(z)+3x^2y^2+1\,dx = x^2e^{-y}\sin(z)+x^3y^2+x+C_1(y,z)$$ 
$$\int -x^2e^{-y}\sin(z)+2x^3y+z\,dy = x^2e^{-y}\sin(z)+x^3y^2+yz+C_2(x,z)$$
$$\int x^2e^{-y}\cos(z)+y+2z\,dz = x^2e^{-y}\sin(z)+yz+z^2+C_3(x,y)$$
Piecing the above antiderivatives together, we get: $f(x,y,z) = x^2e^{-y}\sin(z)+x^3y^2+x+yz+z^2+C$ where $C$ is an arbitrary constant.


%\vspace{0.15in}

\newpage

\noindent {\bf\large Supplemental Problems:}

\vspace{0.05in}

\begin{enumerate}
\item Using only the plots, decide whether divergence is positive, negative, or zero and which way curl points for each of the following vector fields. Then confirm your findings by computing divergence and curl using the vector field formulas below the plots.

\vspace{0.05in}

\force
\hfill
\begin{tikzpicture}[scale=0.65]
\begin{axis}[
    axis lines=none,
    view={0}{90},
    domain=-2:2,
    y domain=-2:2,
    xmin=-2.1, xmax=2.1, ymin=-2.1, ymax=2.1,
    samples=6,
    color=red
]
\addplot3 [black, quiver={u={0}, v={-x}, scale arrows=0.25, every arrow/.append style={-latex}}] (x,y,0);

%\draw plot [mark=*, mark size=4] coordinates{(axis cs: 0,0,0)}; 
%\node at (axis cs:0,0,0) [label=-90:{\color{black}$\nabla \bdot \B F >0$}] {};
\end{axis}
\end{tikzpicture}
\hfill \hfill
\begin{tikzpicture}[scale=0.65]
\begin{axis}[
    axis lines=none,
    view={0}{90},
    domain=-2:2,
    y domain=-2:2,
    xmin=-2.1, xmax=2.1, ymin=-2.1, ymax=2.1,
    samples=6,
    color=red
]
\addplot3 [black, quiver={u={3*x/sqrt(x^2+y^2)}, v={3*y/sqrt(x^2+y^2)}, scale arrows=0.25, every arrow/.append style={-latex}}] (x,y,0);

%\draw plot [mark=*, mark size=4] coordinates{(axis cs: 0,0,0)}; 
%\node at (axis cs:0,0,0) [label=-90:{\color{black}$\nabla \bdot \B F >0$}] {};
\end{axis}
\end{tikzpicture}
\hfill
\force

%\vspace{0.1in}

\force 
\hfill
(i) \quad $\B F(x,y) = -x\B j$
\hfill \hfill
(ii) \quad $\B F(x,y) = \dfrac{1}{\sqrt{x^2+y^2}}\langle x,y \rangle$
\hfill
\force


\item Decide if the following vector fields are conservative or not. If so, find a potential function.

(i) \quad $\B F = \langle y, y \rangle$ \hfill
(ii) \quad $\B F = \langle -2x,2y \rangle$ \hfill
(iii) \quad $\B F = \langle -2y,2x \rangle$ \hfill
(iv) \quad $\B F = \langle 2xy^2+1, 2x^2y+3y^2 \rangle$ \hfill

\item Compute curl and divergence of each of the following vector fields. If conservative, find a potential function.

\force \hfill
(i) \quad $\B F = \langle xyz,0,-x^2y \rangle$ \hfill  
(ii) \quad $\B F = \langle 2xy, x^2+2yz, y^2+3z^2 \rangle$ \hfill 
(iii) \quad $\B F = \langle 1,x+yz,xy-\sqrt{z} \rangle$ \hfill \force

\force \hfill
(iv) \quad $\B F = \langle x^2,-2,yz \rangle$ \hfill
(v) \quad $\B F = \langle y^2z^3+2x, 2xyz^3+z^2, 3xy^2z^2+2yz+1 \rangle$ \hfill \force


\item Let $f$, $g$, and $h$ be differentiable functions. Show that $\B F(x,y,z) = \langle f(x), g(y), h(z) \rangle$ is irrotational. 

 What can be said about $f$, $g$, and $h$ if $\B F$ is incompressible?

\item Let $f$ be a scalar valued function and $\B F=\langle M,N,P \rangle$ be a vector field. Work out for yourself that $\nabla \times \nabla f = \B 0$ and $\nabla \bdot (\nabla \times \B F) =0$. As you calculate, keep track of the exact assumptions made on $f$, $M$, $N$, and $P$. What are they? 

\item Unlike the identities in the previous problem, $\nabla^2 f= \nabla \bdot \nabla f$ may or may not be $0$. We call $\nabla^2 f=0$ {\it Laplace's equation} and any solution $f$ is called a {\it harmonic function}.

Let $f(x,y,z)$ be a scalar valued function. Write Laplace's equation, $\nabla^2 f=0$, in terms of partials of $f$. 

Show that $f(x,y,z)=5x+e^y\sin(z)$ is a solution of Laplace's equation (i.e., $f$ is a harmonic function) while, on the other hand, $g(x,y,z)=xy^2z^3$ is not.

% potential derivation problems: show div/curl are linear     div(fF) = f div(F) + grad(f).F    curl(fF) = f curl(F) + grad(f) x F    div(F x G) = curl(F).G - F.curl(G)    div(grad(f) x grad(g)) =0

\end{enumerate}

\newpage

\vspace{0.05in}

\noindent {\bf\large Answers:}

\vspace{-0.05in}

\begin{enumerate} 

\item Plot interpretation.

(i) Vectors seem to flow equally into and out of each point, so the divergence should be zero. A tiny paddle wheel sitting anywhere in this field, should get pushed around in a clockwise manner, so the curl should be a negative multiple of $\B k$. This is confirmed by the calculations with $\B F = \langle 0,-x\rangle$: $\nabla \bdot F = 0$ and $\nabla \times \B F = -\B k$. 

(ii) Each arrow has the same length. However, if we drew a small circle, we'd see that there are more arrows flowing in than out of our disk. Thus divergence should be positive. Next, if we dropped a paddle wheel in this field, it looks like it would not turn. Thus curl should be zero. 

\vspace{-0.1in}

We confirm these results by calculations using $\B F = \left\langle \dfrac{x}{\sqrt{x^2+y^2}}, \dfrac{y}{\sqrt{x^2+y^2}} \right\rangle$: $\nabla \bdot \B F = \dfrac{1}{\sqrt{x^2+y^2}}>0$ and $\nabla \times \B F = \B 0$.

\item For a 2D vector field defined on all $\mathbb{R}^2$, $\B F=\langle M,N \rangle$ is conservative if and only if $M_y=N_x$.

(i) \quad $\B F = \langle y, y \rangle$ then $M=N=y$ so $M_y=1 \not= 0=N_x$. No, not conservative.

(ii) \quad $\B F = \langle -2x,2y \rangle$ then $M=-2x$, $N=2y$ so $M_y=0=N_x$. Yes, conservative. $\int M\,dx = \int -2x\,dx =-x^2+C_1(y)$ and $\int N\,dy = \int 2y\,dy = y^2+C_2(x)$ so $f(x,y)=-x^2+y^2+C$ is a potential function (for any constant $C$). 

(iii) \quad $\B F = \langle -2y,2x \rangle$ then $M=-2y$, $N=2x$ so $M_y=-2 \not= 2=N_x$. No, not conservative.

(iv) \quad $\B F = \langle 2xy^2+1, 2x^2y+3y^2 \rangle$ then $M=2xy^2+1$, $N=2x^2y+3y^2$ so $M_y=4xy=N_x$. Yes, conservative. 

$\int M\,dx = \int 2xy^2+1\,dx = x^2y^2+x+C_1(y)$ and $\int N\,dx = \int 2x^2y+3y^2\,dy = x^2y^2+y^3+C_2(x)$ so $f(x,y) = x^2y^2+x+y^3+C$ is a potential function (for any constant $C$).

\item  Compute curl and divergence of each of the following vector fields. If conservative, find a potential function.

(i) \quad $\B F = \langle xyz,0,-x^2y \rangle$ then $\nabla \times \B F = \langle -x^2,3xy,-xz \rangle$ and $\nabla \bdot \B F = yz$. No, not conservative ($\nabla \times \B F \not= \B 0$).

(ii) \quad $\B F = \langle 2xy, x^2+2yz, y^2+3z^2 \rangle$ then $\nabla \times \B F = \B 0$ and $\nabla \bdot \B F = 2y+8z$. Yes, conservative ($\nabla \times \B F = \B 0$). 

$\int M\,dx = \int 2xy\,dx = x^2y+C_1(y,z)$, $\int N\,dy = x^2+2yz\,dy = x^2y+y^2z+C_2(x,z)$, $\int P\,dz = \int y^2+3z^2\,dz = y^2z+z^3+C_3(x,y)$. Thus $f(x,y,z) = x^2y+y^2z+z^3+C$ is a potential function for any constant $C$.

(iii) \quad $\B F = \langle 1,x+yz,xy-\sqrt{z} \rangle$ then $\nabla \times \B F = \langle x-y, -y, 1 \rangle$ and $\nabla \bdot \B F = z-1/(2\sqrt{z})$. No, not conservative ($\nabla \times \B F \not= \B 0$).

(iv) \quad $\B F = \langle x^2,-2,yz \rangle$ \hfill then $\nabla \times \B F = \langle z,0,0 \rangle$ and $\nabla \bdot \B F = 2x+y$. No, not conservative ($\nabla \times \B F \not= \B 0$).

(v) \quad $\B F = \langle y^2z^3+2x, 2xyz^3+z^2, 3xy^2z^2+2yz+1 \rangle$ then $\nabla \bdot \B F = 2+2xz^3+6xy^2z+2y$ and yes, conservative ($\nabla \times \B F = \B 0$). 

$\int M\,dx = \int y^2z^3+2x\,dx = xy^2z^3+x^2+C_1(y,z)$, $\int N\,dy = \int 2xyz^3+z^2\,dy = xy^2z^3+yz^2+C_2(x,z)$, $\int P\,dz = \int 3xy^2z^2+2yz+1\,dz = xy^2z^3+yz^2+z+C_3(x,y)$. Thus $f(x,y,z) = xy^2z^3+x^2+yz^2+z+C$ is a potential function for any constant $C$.

\vspace{-0.05in}

\item $\displaystyle \nabla \times \B F = \begin{vmatrix} \B i & \B j & \B k \\ \partial_x & \partial_y & \partial_z \\ f(x) & g(y) & h(z) \end{vmatrix} = 
 \begin{vmatrix} \partial_y & \partial_z \\ g(y) & h(z) \end{vmatrix} \B i -
 \begin{vmatrix} \partial_x & \partial_z \\ f(x) & h(z) \end{vmatrix} \B j +
 \begin{vmatrix} \partial_x & \partial_y \\ f(x) & g(y) \end{vmatrix} \B k =$
 
 $\displaystyle  (\partial_y(h(z))-\partial_z(g(y)))\B i - (\partial_x(h(z))-\partial_z(f(x)))\B j + (\partial_x(g(y))-\partial_y(f(x)))\B k = \B 0$ 
 
 (we are differentiating with respect to the ``wrong'' variable each time). Thus $\B F$ is irrotational.
 
 Incompressible means that $\nabla \bdot \B F =0$ so $f'(x)+g'(y)+h'(z)=0$. Notice $f'(x)=-g'(y)-h'(z)$. Now, $f(x)$ is only a function of $x$, so $f'(x)$ can only depend on $x$. Wait! $f'(x)=-g'(y)-h'(z)$ says it can {\it only} depend on $y$ and $z$. Thus $f'(x)$ must be constant. Likewise, $g'(y)$ and $h'(z)$ must be constant. Thus $\B F$ is {\bf incompressible implies} that $f$, $g$, and $h$ are all {\bf linear functions} (since a function's derivative is constant exactly when it is linear).

\item $\displaystyle \nabla \times \nabla f = \begin{vmatrix} \B i & \B j & \B k \\ \partial_x & \partial_y & \partial_z \\ f_x & f_y & f_z \end{vmatrix} =
 \begin{vmatrix} \partial_y & \partial_z \\ f_y & f_z \end{vmatrix} \B i -
 \begin{vmatrix} \partial_x & \partial_z \\ f_x & f_z \end{vmatrix} \B j +
 \begin{vmatrix} \partial_x & \partial_y \\ f_x & f_y \end{vmatrix} \B k =
 (f_{zy}-f_{yz})\B i - (f_{zx}-f_{xz})\B j + (f_{yx}-f_{xy})\B k = \B 0$

$$\nabla \bdot (\nabla \times \B F) = 
\nabla \bdot \begin{vmatrix} \B i & \B j & \B k \\ \partial_x & \partial_y & \partial_z \\ M & N & P \end{vmatrix} =
\nabla \bdot \langle P_y-N_z, -(P_x-M_z), N_x-M_y \rangle = \partial_x(P_y-N_z)-\partial_y(P_x-M_z)+\partial_z(N_x-M_y)$$

\vspace{-0.25in}

\force \hfill
$=P_{yx}-N_{zx}-P_{xy}+M_{zy}+N_{xz}-M_{yz}=0$

We need to assume that the {\bf mixed second partials} of $f,M,N,$ and $P$ {\bf are all continuous} (to use Clairaut's theorem) since both of these calculations assumed that various mixed partials are equal.

\item $\nabla^2 f= \nabla \bdot \nabla f = \nabla \bdot \langle f_x,f_y,f_z \rangle = f_{xx}+f_{yy}+f_{zz}$. Thus Laplace's equation (in 3D) is $f_{xx}+f_{yy}+f_{zz}=0$. 

When $f(x,y,z)=5x+e^y\sin(z)$, $f_{xx}=0$, $f_{yy}=e^y\sin(z)$, and $f_{zz}=-e^y\sin(z)$ so this $f$ is a solution (i.e., it's a harmonic function). On the other hand, when $g(x,y,z)=xy^2z^3$, we have $g_{xx}=0$, $g_{yy}=2xz^3$, and $g_{zz}=6xy^2z$ so $g_{xx}+g_{yy}+g_{zz}=2xz^3+6xy^2z \not=0$. This is not a solution.

\end{enumerate}

\end{document}


