\ifdefined\inmaster\else\def\subonly{\jobname}\input{complex}\fi

\chapter{A crash course in differential forms}

In your previous calculus classes, you may or may not have encountered \emph{differential forms} by name.
However, you've certainly met them, even if you didn't realize it.
When you write
\[ \itint x a b {f(x)} \]
the thing being integrated, ``$f(x) \,\dx$'', is a differential form.
Similarly, when in multivariable calculus you calculate line integrals
\[ \lint{\curve} f(\ptx) \, \dl \quad\text{or}\quad \lint{\curve} \dotp{\vc{F}}{\dpx} \]
or surface integrals
\[ \lint{\surf} f(\ptx) \,\dA \quad\text{or}\quad \lint{\surf} \dotp{\vc{F}}{\dn} \]
in each case the thing being integrated is a differential form.

You may have been told that the ``$\dx$'' (or $\dl$, $\dA$, etc.)\ is simply a notation that indicates which variable we're integrating, or what sort of integration we're doing, but this is a lie.
In fact, differential forms are a powerful tool; they are essentially the ``modern'' way to do vector calculus.
Unfortunately, they are still not often taught in multivariable calculus classes, so here we will give a brief summary.

\section{What are differential forms?}
\label{sec:what-are-forms}

Differential forms are objects similar to functions or vector fields, which involve one or more functions defined on a line, in a plane, or in space (or more generally, in an $n$-dimensional space).
In $n$-dimensional space, there are $(n+1)$ kinds of differential forms, called \emph{0-forms}, \emph{1-forms}, \dots, up to \emph{$n$-forms}.
The following are not the ``actual'' definitions, but they will suffice for us.

\begin{defn}
  In one dimension, with coordinate $x$:
  \begin{itemize}
  \item A \textbf{differential 0-form} is a function of $x$.
  \item A \textbf{differential 1-form} is an expression of the form $A\,\dx$, where $A$ is a function of $x$.
  \end{itemize}
\end{defn}

\begin{defn}
  In two dimensions, with coordinates $x$ and $y$:
  \begin{itemize}
  \item A \textbf{differential 0-form} is a function of $x$ and $y$.
  \item A \textbf{differential 1-form} is an expression of the form $A\,\dx+B\,\dy$, where $A$ and $B$ are functions of $x$ and $y$.
  \item A \textbf{differential 2-form} is an expression of the form $A\,\dx\wedge\dy$, where $A$ is a function of $x$ and $y$.
  \end{itemize}
\end{defn}

\begin{defn}
  In three dimensions, with coordinates\footnote{Confusingly, $z$ is traditionally used both for the third coordinate in three real dimensions and for a complex variable.  In this chapter there will be no complex variables, so $z$ will always be the third real coordinate.  However, after the very brief \cref{sec:forms-in-3D} below, we will never mention three dimensions again, since they are not very relevant to complex analysis; thus for the rest of the course $z$ will continue to denote a complex variable.} $x$, $y$, and $z$:
  \begin{itemize}
  \item A \textbf{differential 0-form} is a function of $x$, $y$, and $z$.
  \item A \textbf{differential 1-form} is an expression of the form $A\,\dx+B\,\dy+C\,\dz$, where $A$, $B$, and $C$ are functions of $x$, $y$, and $z$.
  \item A \textbf{differential 2-form} is an expression of the form $A\,\dx\wedge\dy + B \,\dy\wedge\dz + C \,\dz\wedge\dx$, where $A$, $B$, and $C$ are functions of $x$, $y$, and $z$.
  \item A \textbf{differential 3-form} is an expression of the form $A \,\dx\wedge\dy\wedge\dz$, where $A$ is a function of $x$, $y$, and $z$.
  \end{itemize}
\end{defn}

The main reasons for introducing these funny objects are the following:
\begin{enumerate}
\item The operation of \emph{differentiation} naturally takes $p$-forms to $(p+1)$-forms;
\item A $p$-form can naturally be integrated over an oriented $p$-dimensional \emph{manifold}; and
\item The two operations are related by the \emph{generalized Stokes' theorem}, which subsumes all the theorems of vector calculus.
\end{enumerate}

What is a ``manifold'', you may ask?
For $p=0$, $1$, and $2$ respectively, examples of $p$-dimensional manifolds are points, curves, and surfaces respectively.
More generally, a manifold could have multiple ``pieces'' each of which looks like a point, curve, or surface.

\section{Differential forms in one dimension}
\label{sec:forms-in-1D}

Let us consider these claims in one dimension first.
In one-variable calculus, you may have encountered a thing called the \emph{differential} of a function:
Namely, if $f$ is a function of one variable $x$, then its differential is
\begin{equation}
  \df = f'(x) \, \dx\label{eq:onevariable-differential}
\end{equation}
where $f'$ is the \emph{derivative} of $f$.
Observe that $\df$ is a differential 1-form in one dimension, as we have defined it above.
(Note also that if $f(x) = x$, then $\df = \dx$, i.e.\ $\dd(x) = \dx$.
Thus the notation is consistent.)

Similarly, when we ``integrate a function'' in one-variable calculus on an interval $[a,b]$, what we actually write is
\[ \itint x a b {f(x)} \]
where the integrand is manifestly a differential 1-form.
The interval $[a,b]$ is a 1-manifold, and we can equivalently write the integral as 
\[ \lint{[a,b]} f(x) \,\dx. \]
In fact, the interval $[a,b]$ is an \emph{oriented} 1-manifold: this means that it comes with a ``direction of traversal'', canonically \emph{from} $a$ \emph{to} $b$.
If we reverse this orientation, we obtain an integral that in one-variable calculus you wrote as
\[ \itint x b a {f(x)} \]
and you probably learned that this is equal to $-\itint x a b {f(x)}$.
We will write this integral instead as
\[ \lint{-[a,b]} f(x) \,\dx. \]
with a minus sign on $[a,b]$ to denote that its orientation is reversed from the ``standard'' one.

Finally, the \emph{fundamental theorem of calculus} relates these two operations; it says that (assuming $f'$ is continuous) we have
\begin{equation}
  \lint{[a,b]} \df = f(b) - f(a).\label{eq:onevar-ftc}
\end{equation}

There is one claim yet to be justified in one dimension: that we can integrate a differential 0-form over an oriented $0$-dimensional manifold.
However, since a 0-form is just a function $f$, and $0$-dimensional manifolds are points, we may expect that this ``integral'' should be just $f(x)$.
This is almost right, but for two caveats.

Firstly, the word ``oriented'' is missing.
An \emph{oriented} $0$-dimensional manifold is not just a point: it's a point together with a ``sign'', plus or minus.
Thus, we define the \emph{integral of a 0-form} $f$ over such an ``oriented point'' to be $\pm f(x)$, with the $\pm$ sign coming from the orientation.
(Even though 0-forms are the same as functions, it's better not to call this ``the integral of a function'' since as we have seen, the ``integral of a function'' from one-variable calculus is actually the integral of a \emph{1-form}.)

Secondly, a general $0$-manifold is not just an oriented point, but a finite collection of oriented points.
The ``integral'' of a 0-form $f$ over such a collection should be the \emph{sum} of its integrals over the individual oriented points.

In particular, the right-hand side of \cref{eq:onevar-ftc} is an integral of the 0-form $f$ over the oriented $0$-manifold with two points: $b$ oriented with $+$, and $a$ oriented with $-$.
This 0-manifold is the \emph{boundary} of the interval $[a,b]$, which is the 1-manifold over which we integrate $\df$ on the left-hand side.
%% TODO: Explain how the boundary inherits an orientation.
Thus, the fundamental theorem of calculus relates \emph{the integral of a 0-form over the boundary of a 1-manifold} with \emph{the integral of its differential over the 1-manifold itself}.
As we will see, this statement generalizes directly to higher dimensions.


\section{Differential 1-Forms in Two Dimensions}
\label{sec:1forms-in-2D}

Now let's consider higher dimensions.
In multivariable calculus you probably learned about \emph{line integrals} in two and three dimensions.
You might in fact have learned how to integrate the exact things that we are calling differential 1-forms, perhaps without giving them that name.

For instance, if $\curve$ is a parametrized curve in two dimensions, with parameter $t$ defined on the interval $[a,b]$, and $f(x,y)\,\dx + g(x,y)\,\dy$ is a 1-form, then its integral over $\curve$ is
\[ \lint{\curve} \Big(f(x,y)\,\dx + g(x,y)\,\dy\Big) = \itint t a b {\Big( f\big(x(t),y(t)\big)\, x'(t) + g\big(x(t),y(t)\big)\,y'(t)\Big)} \]
Note that this formula can be obtained formally simply by substitutition of the functions $x(t)$ and $y(t)$, plus their differentials $\dx = x'(t)\,\dt$ and $\dy = y'(t)\,\dt$.

You might also, or instead, have learned to line-integrate a vector field $\vc{F}(x,y)$ over $\curve$, perhaps written something like
\[ \lint{\curve} \dotp{\vc{F}}{\dpx} \]
However, this is just a special case of the preceding integral.
If we write $\vc{F}(x,y)$ in components as $\vc{F}(x,y) = \vcc{f(x,y),g(x,y)}$, and let $\dpx$ denote the ``formal vector'' $(\dx,\dy)$, then the ``formal dot product'' $\dotp{\vc{F}}{\dpx}$ is just the 1-form $f(x,y)\,\dx + g(x,y)\,\dy$.

(You probably also learned how to ``integrate with respect to arc length''.
This is an integral of a more general sort of ``differential form'' than we will consider here.)

Finally, you might also have learned about the differential of a two- or three-variable function, sometimes called its \emph{total differential} or \emph{total derivative}.
In two dimensions this is
\begin{equation}
  \df = \pder f x \,\dx + \pder f y \,\dy\label{eq:differential-of-a-0form-in-2D}
\end{equation}
where $\pder f x$ and $\pder f y$ are the partial derivatives.
Note that $\df$ is equivalently the dot product $\dotp{\grad{f}}{\dpx}$, where $\grad{f} = \vcc{\pder f x,\pder f y}$ is the \emph{gradient vector} of $f$.

To be precise, we should recall that the partial derivatives $\pder f x$ and $\pder f y$ may exist without $f$ being ``differentiable'', and we should really only speak of $\df$ in the latter case.
However, it is a theorem that if $\pder f x$ and $\pder f y$ exist and are continuous, then $f$ is differentiable.

Viewing the ``total differential'' $\df$ as a differential form also points the way to a ``more correct'' definition of differential forms.
You probably learned that $\df$ represents the \emph{linear approximation} to the change in $f(x,y)$ when $\dx$ and $\dy$ are small changes in the coordinates $x$ and $y$.
More precisely, we can consider $\dx$ and $\dy$ as the coordinates of a vector $\dpx = \vcc{\dx,\dy}$, and a differential 1-form such as $\df$ is a \emph{linear function from vectors to numbers} (which may also depend on the point $\ptx = \ptc{x,y}$).
This point of view also generalizes to $p$-forms for $p>1$, but it is more complicated, so we will not discuss it.

Now we can see that the \emph{fundamental theorem of calculus for line integrals} is
\[ \lint{\curve} \df = f(\curvept(b)) - f(\curvept(a)) \]
(assuming $\df$ is continuous).
This has exactly the same form as the fundamental theorem of calculus for one-variable integrals.
If we use the same conventions regarding 0-manifolds and integrals of 0-forms as we did in one dimension, then this theorem also relates the integral of a 0-form over the boundary of a 1-manifold with the integral of its differential over the 1-manifold itself.

\section{Differential 2-Forms in Two Dimensions}
\label{sec:2forms-in-2D}

In two dimensions, however, we also have differential 2-forms, which can be integrated over 2-dimensional regions.
In multivariable calculus, you learned how to integrate a two-variable function $f(x,y)$ over a region $\region$, and you may have denoted it by
\begin{equation}
  \sint{\region} f(x,y)\,\dA \qquad\text{or}\qquad \sint{\region} f(x,y)\,\dx\,\dy.\label{eq:abs2form-2D-integrals}
\end{equation}
We are concerned instead with an integral that is almost the same, which is denoted
\begin{equation}
  \sint{\region} f(x,y) \,\dx\wedge \dy.\label{eq:2form-2D-integral}
\end{equation}
This is the integral of a differential 2-form (namely $f(x,y) \,\dx\wedge \dy$) over a 2-manifold (namely $\region$).
The slight difference in meaning between \cref{eq:abs2form-2D-integrals} and \cref{eq:2form-2D-integral} is that in the latter, $\region$ is an \emph{oriented} region, whereas in the former it is not.
An \emph{orientation} of a region or surface consists of a consistent choice of a ``direction of rotation'' throughout it.
Just as any interval in one dimension has a canonical orientation (from left to right), any region in two dimensions has a canonical orientation (counterclockwise).
But we could consider instead choosing the opposite orientation, and this would reverse the sign of the integral \cref{eq:2form-2D-integral}.

So what is the deal with this funny symbol $\wedge$?
The short answer is that it's a way to multiply differential forms.
In general, we can multiply a $p$-form by a $q$-form to get a $(p+q)$-form.
We've already seen this when $p=0$: a 1-form like $f(x)\,\dx$ is already written as the product of the 0-form $f(x)$ with the 1-form $\dx$.

Now we are instead multiplying the 1-forms $\dx$ and $\dy$ to get a 2-form.
You might think we should write the result simply as $\dx\,\dy$, but we stick a $\wedge$ symbol in between to remind us that this ``multiplication'' is not exactly like ordinary multiplication.
The main difference is that the generating symbols $\dx$ and $\dy$ do not commute; they \emph{anticommute}:
\begin{equation}
  \dy\wedge\dx = - \dx\wedge \dy.\label{eq:wedge-anticommute}
\end{equation}
A good way to think about this is with reference to orientations.
The 2-form $\dx\wedge\dy$ produces positive results when integrated over \emph{counterclockwisely} oriented regions, in which the direction of rotation is \emph{from} the positive $x$-axis \emph{towards} the positive $y$-axis (because $\dx$ comes before $\dy$ in $\dx\wedge\dy$).
Similarly, $\dy\wedge\dx$ produces positive results when integrated over \emph{clockwisely} oriented regions, in which the direction of rotation is \emph{from} the positive $y$-axis \emph{towards} the positive $x$-axis --- but this is the opposite orientation, so we must have \cref{eq:wedge-anticommute}.

We also have
\[ \dx \wedge \dx = 0 \qquad\text{and}\qquad \dy\wedge \dy = 0. \]
This is analogous to \cref{eq:wedge-anticommute}; the direct analogy would be $\dx\wedge\dx = - \dx\wedge\dx$, but of course this implies $\dx\wedge\dx=0$.

Finally, according to our general claims, there should be a way to ``differentiate'' a 1-form and get a 2-form.
To define this, note that a 1-form such as $f(x)\,\dx$ is already written as the product of a 0-form and a 1-form.
We'd like this kind of ``differentiation'' to satisfy a product rule, with respect to the $\wedge$ product of differential forms; thus the differential of $f(x)\,\dx$ should be
\[ \dd(f(x)\,\dx) =  \df \wedge\dx + f(x)\, \dd(\dx). \]
Actually, since we are using the $\wedge$ product in the product rule, it's better to include the symbol $\wedge$ as a reminder in the notation for this differential as well.
Thus we will write instead
\[ \ed(f(x)\,\dx) =  \df \wedge\dx + f(x)\, \ed\dx. \]
We already know how to find the differential of a 0-form (\cref{eq:differential-of-a-0form-in-2D}), so all we need is to define is $\ed\dx$.
It turns out that we should define $\ed\dx=0$; a mnemonic for this is that just as $\dx\wedge \dx = 0$, so also ``$\ed\dd = 0$''.

Now we can compute the differential of a general 1-form $f(x,y)\,\dx + g(x,y)\,\dy$ in two dimensions:
\begin{align*}
  \ed(f\,\dx + g\,\dy)
  &= \df \wedge \dx + \dg \wedge\dy\\
  &= (\pder f x\, \dx + \pder f y\, \dy) \wedge \dx + (\pder g x \,\dx+\pder g y\,\dy)\wedge\dy \\
  &= \pder f x\, \dx\wedge\dx + \pder f y\, \dy\wedge \dx + \pder g x \,\dx \wedge\dy + \pder g y\,\dy\wedge\dy \\
  &= (\pder g x - \pder f y)\, \dx\wedge\dy.
\end{align*}

Now if there is to be a version of the fundamental theorem of calculus for integrals of 2-forms, it should say that the integral of a 1-form over the boundary of a 2-manifold is equal to the integral of its differential over the 2-manifold itself.
Thus, if $\region$ is a region with boundary $\bdry\region$, we should have
\[ \sint{\region} (\pder g x - \pder f y)\, \dx\wedge\dy = \lint{\bdry\region} f\,\dx + g\,\dy. \]
This is true (assuming $f$ and $g$ have continuous partial derivatives): it is exactly \emph{Green's theorem} from vector calculus.

\section{Differential Forms in Three Dimensions}
\label{sec:forms-in-3D}

All the same ideas apply fairly directly to three dimensions.
This is not important for a first course in complex analysis, but I will sketch the ideas briefly, so you can get a sense for how differential forms unify all the theorems of vector calculus.

We have differential 0-forms (functions), which can be ``integrated'' over points and more general oriented 0-manifolds.
We have differential 1-forms such as $f\,\dx + g\,\dy + h\,\dz$, which can be line-integrated over oriented curves.
Every 0-form $f$ has a differential $\df = \pder f x \,\dx + \pder f y\,\dy + \pder f z\,\dz$, and we have a fundamental theorem of calculus for its line integral.

Now we have more general differential 2-forms such as $A\,\dx\wedge\dy + B\,\dy\wedge\dz + C \,\dz\wedge\dx$.
Any two 1-forms have a $\wedge$ product, which satisfies identities such as $\dy\wedge\dz = -\dz\wedge\dy$ and $\dy\wedge\dy=0$, and so on.
Every 1-form has a differential, computed as
\begin{align*}
  \ed(f\,\dx + g\,\dy + h\,\dz)
  &= \df\wedge\dx + \dg\wedge\dy + \dh\wedge\dz\\
  &= (\pder f x \,\dx + \pder f y \,\dy + \pder f z\,\dz)\wedge\dx + (\pder g x \,\dx + \pder g y \,\dy + \pder g z\,\dz)\wedge\dy\\
  &\qquad + (\pder h x \,\dx + \pder h y \,\dy + \pder h z\,\dz)\wedge\dz\\
  &= \pder f y \,\dy\wedge\dx + \pder f z\,\dz\wedge\dx + \pder g x \,\dx\wedge\dy + \pder g z\,\dz \wedge\dy \\
  &\qquad + \pder h x\,\dx\wedge\dz + \pder h y \,\dy\wedge\dz\\
  &= (\pder g x - \pder f y)\,\dx\wedge\dy + (\pder h y - \pder g z) \,\dy\wedge\dz + (\pder f z - \pder h x)\,\dz\wedge\dx.
\end{align*}
We can integrate a 2-form over an oriented surface $\surf$, and Green's theorem generalizes to say that the integral of a 1-form over the boundary of such a surface is equal to the integral of its differential over the surface itself (assuming the differential to be continuous):
\begin{equation}
  \sint{\surf} \ed(f\,\dx + g\,\dy + h\,\dz) = \lint{\bdry\surf} f\,\dx + g\,\dy + h\,\dz\label{eq:stokes-theorem}
\end{equation}

We also have 3-forms such as $f(x,y,z)\, \dx\wedge\dy\wedge\dz$.
Every 2-form has a differential, computed as
\begin{align*}
  \ed(A\,\dx\wedge\dy + & B\,\dy\wedge\dz + C \,\dz\wedge\dx)\\
  &= \dd A \wedge \dx \wedge \dy + \dd B \wedge \dy \wedge \dz + \dd C \wedge \dz \wedge \dx\\
  &= \pder A z\, \dz \wedge \dx \wedge \dy + \pder B x \,\dx \wedge \dy \wedge \dz + \pder C y \,\dy\wedge \dz \wedge \dx\\
  &= (\pder A z + \pder B x + \pder C y)\, \dx\wedge\dy\wedge \dz
\end{align*}
(since $\dz \wedge \dx \wedge \dy = -\dx \wedge \dz \wedge \dy = \dx \wedge \dy \wedge \dz$ and similarly).

Finally, a 3-form can be integrated over any oriented 3-dimensional region $\region$, giving essentially the ordinary three-dimensional integral that you learned in multivariable calculus (except for orientations).
And we have the corresponding fundamental theorem, relating the integral of a 2-form over the boundary of a region to the integral of its differential over the region itself (assuming, as always, the partial derivatives to be continuous):
\begin{equation}
  \vint{\region} (\pder A z + \pder B x + \pder C y)\, \dx\wedge\dy\wedge \dz = \sint{\bdry\region} A\,\dx\wedge\dy + B\,\dy\wedge\dz + C \,\dz\wedge\dx.\label{eq:divergence-theorem}
\end{equation}

These formulas are related to three-dimensional vector calculus as follows.
As was the case in two dimensions, every vector field $\vc{F}=\vcc{f,g,h}$ gives rise to a 1-form $\dotp{\vc{F}}{\dpx} = f\,\dx + g\,\dy + h\,\dz$.
Conversely, any 1-form can be reinterpreted as a vector field, and the differential of a 0-form corresponds to the gradient of a function.
In fact, this is true in any number of dimensions.

However, in three dimensions, a vector field can also be interpreted as a \emph{2-form}, namely $f\,\dy\wedge\dz + g \,\dz\wedge\dx + h \,\dx\wedge\dy$: each component is associated to the $\wedge$ of all the $\dd?$s for the \emph{other} variables.
The differential of this 2-form is the 3-form $(\div{\vc{F}})\,\dx\wedge\dy\wedge\dz$, where $\div{\vc{F}}$ is the \emph{divergence} from vector calculus.
Thus, \cref{eq:divergence-theorem} is just the \emph{divergence theorem} from vector calculus.

In fact, in any number $n$ of dimensions greater than $2$, we can similarly interpret a vector field as an $(n-1)$ form, and we have the divergence theorem.
The special thing about $n=3$ is that ``$3-1 = 1+1$''.
This means two things:
\begin{enumerate}
\item If we have two vector fields $\vc{F}$ and $\vc{G}$, we can interpret them as 1-forms, take their $\wedge$ product, then \emph{reinterpret} the resulting 2-form as a vector field.
  The result is the \emph{cross product} $\crossp{\vc{F}}{\vc{G}}$ of vectors, which only makes sense in three dimensions.
\item If we have a vector field $\vc{F}$, we can interpret it as a 1-form, take its differential $\ed(\dotp{\vc{F}}{\dpx})$, then \emph{reinterpret} the resulting 2-form as a vector field.
  The result is the \emph{curl} of the vector field, $\curl{\vc{F}}$, which also only makes sense in three dimensions.
\end{enumerate}
Thus, we see finally that \cref{eq:stokes-theorem} is just \emph{Stokes' theorem} from vector calculus.

The most general ``fundamental theorem of calculus for differential forms'' is that if $\omega$ is a differential $p$-form in $n$ dimensions, and $\surf$ is an oriented $p$-dimensional manifold, then
\[ \int_{\surf} \dd\omega = \int_{\bdry\surf} \omega. \]
This is usually called the \emph{(generalized) Stokes' theorem}, and it includes the usual fundamental theorem of calculus as well as Green's theorem, the classical Stokes' theorem, and the divergence theorem.
