
\section{Generalized Stokes's Theorem} 
{\bf Generalized Stokes's Theorem} states that, with all the assumptions and notation we have introduced,
\begin{equation}\label{e1}
\int_{\partial \mathcal{M}} \omega = \int_{\mathcal{M}} d\omega,
\end{equation}
where $\omega$ is a differential form, $d\omega$ is its exterior derivative, $\mathcal{M}$ 
is an oriented manifold, and $ \partial \mathcal{M}$ is the boundary of $\mathcal{M}$ with orientation
inherited from $M$.

We will skip the proof of the theorem; if your Calculus textbook covers differential forms, it will likely include a sketch of it. In general terms, the proof has the same main ingredients as the cases we have seen in 2 and 3 dimensions: break up the manifold (and therefore the integrals) into smaller pieces where one can use a single local coordinate system, write out the iterated integrals, use the Fundamental Theorem of Calculus in one of the variables, and cancel out the 
integrals along the new boundary pieces that we introduced in the subdivision of the manifold.

Instead, we will revisit the integral theorems we have seen so far and take a look at how they fit into the framework of the Generalized Stokes Theorem.



\subsection{\bf Stokes's Theorem} We can obtain our classical Stokes's Theorem from Generalized Stokes's Theorem by specializing to the case when $n=3$, $\mathcal{M}=\calS$ is a 2-dimensional surface, and its boundary $\partial \mathcal{M} =\mathcal{C}$ is a closed curve.  We also assume that $\mathcal{C}$ is oriented consistently with $\mathcal{M}$. We have already seen that the general definition of ``inherited orientation" for manifolds is consistent with how we previously oriented $\mathcal{S}$ and $\mathcal{C}$.




Let $\Phi = F_1 dx + F_2 dy + F_3 dz$. Then
$$
\int_{\partial \mathcal{M}} \Phi= \int_C F_1 dx + F_2 dy + F_3 dz
= \int_C {\bf F}\cdot  d{\bf r},
$$
where ${\bf F}=F_1\ii + F_2 \jj + F_3 \kk$.

In the Worked Problems of Section 5.2, we verified that $$d\Phi=\Psi = G_1 dy\wedge dz + G_2 dz \wedge dx + G_3 dx \wedge dy,$$
where ${\bf G} = G_1\ii + G_2\jj + G_3\kk= {\curl {\bf F}}$. We also checked in Section \ref{sec:lecture52} that
$$
\int_{\mathcal{M}} \Psi =
\int_\calS {\bf G}\cdot d{\bf S}.
$$
Hence, the Generalized Stokes Theorem tells us that
$$
\int_C {\bf F}\cdot  d{\bf r} = \int_\calS {\bf G}\cdot d{\bf S},
$$
which is Stokes's Theorem for surfaces. Of course, as discussed in Chapter 4, Green's Theorem is just a special case where $\calS$ is a domain in the $xy$-plane.

\begin{remark}
For 2-dimensional surfaces in $\rr^n$ with boundary $\mathcal{C}$, equation (\ref{e1}) in Generalized Stokes's Theorem relates the line integral 
$\int_{\mathcal{C}} {\bf F}\cdot  d{\bf x}$ (now with $n$ components) to the surface integral of the 2-form $d\Phi$---a differential form which can be viewed as an $n$-dimensional generalization of curl.
\end{remark}

\subsection{\bf Divergence Theorem.} Let $\mathcal{M}=D$ be a domain in $\rr^3$ bounded by a closed surface
$\calS$. Apply (\ref{e1}) to the form
$$
\Psi = G_1 dy\wedge dz + G_2 dz \wedge dx + G_3 dx \wedge dy.
$$
We get that
$$
 \int_\calS {\bf G}\cdot d{\bf S} = \int_{\partial \mathcal{M}} \Psi = 
 \int_{\mathcal{M}} d\Psi.
 $$
In the Worked Problems of Section 5.2, we saw that $d\Psi = \divg {\bf G} \, dx \wedge dy \wedge dz$,
so that the above identity recovers the Divergence Theorem. The $n$-dimensional case can be set up similarly if we apply the Generalized Stokes Theorem to an appropriate differential $(n-1)$-form with the same components as our vector field.


\medskip

\subsection{\bf Line integrals of conservative vector fields.} Let $\mathcal{M}$  be a smooth curve in $\rr^n$, parametrized by ${\bf x}(t)$ with $t\in[a,b]$. Also, let $\theta=f$ be a 0-form (a smooth function). Then
$$
d\theta = df=\sum_{i=1}^n  \frac{\partial f}{\partial x_i} dx_i
$$
and
$$
\int_\mathcal{M} d\theta  = \int_C  \sum_{i=1}^n  \frac{\partial f}{\partial x_i} dx_i
= \int_C \nabla f \cdot d{\bf x} = f({\bf x}(b)) - f ({\bf x}(a)).
$$
This is consistent with the identity (\ref{e1}) if we think of the endpoints of the curve as its boundary, ``oriented" in the sense that the initial point ${\bf x}(a)$ comes with a $-$ sign and the terminal point ${\bf x}(b)$ comes with a $+$ sign. The ``integration" in 0 dimension just means evaluating a function at a point.





\subsection{One final example} Finally, we give an example in $4$-dimensions which fully goes beyond anything covered by the previous three ``classical'' theorems, showing indeed that the Generalized Stokes Theorem supersedes the previous results (in the sense that it includes them as special cases, but also provides new results in higher dimensions).

\begin{example}
In $\mathbb{R}^4$, consider the $3$-form
$$\Phi=x_1^3 dx_2\wedge dx_3 \wedge dx_4   - x_2^3 dx_3 \wedge dx_4\wedge dx_1 +
x_3  dx_4 \wedge dx_1\wedge dx_2.$$
We use the Generalized Stokes Theorem to evaluate the integral of $\Phi$ on the oriented boundary on $D$, where 
$$
D=\{ x\in\rr^4: \ x_1^2+x_2^2 \leq 4,\ x_3^2 + x_4^2 \leq 9\}.
$$
Note that $D$ ``looks'' something like the intersection of two ``hyper-cylinders'' of radii $r_1 = 2$ and $r_2 = 3$.  This plays into our final calculation (which is most easily done in polar coordinates).
\end{example}

\medskip

We start by applying the identity \eqref{e1} to obtain that:
$$
\int_{\partial D} \Phi = \int_{D} d\Phi.
$$
For the integral of $d \Phi$ over $D$, we then proceed with standard integration of a differential form over a manifold.  Namely, a calculation shows that
\begin{align*}
\int_{D} d\Phi
&= \int_D 3x_1^2 dx_1\wedge  dx_2\wedge dx_3 \wedge dx_4
- 3x_2^2 dx_2 \wedge dx_3 \wedge dx_4\wedge dx_1 \\
&\qquad \qquad
+ dx_3\wedge  dx_4 \wedge dx_1\wedge dx_2
\\
&= \int_D \left( 3x_1^2 + 3x_2^2 +1 \right) dx_1\wedge  dx_2\wedge dx_3 \wedge dx_4
\\
&= \int\dots\int_D \left( 3x_1^2 + 3x_2^2 +1 \right) dx_1  dx_2 dx_3dx_4
\end{align*}
(Make sure that you can explain each step of this calculation in detail!)

We now write the integral on $D$ as an 
iterated integral. The integral in $x_1$ and $x_2$ can be evaluated using polar coordinates
$x_1=r\cos\theta,x_2=r\sin\theta$:
\begin{align*}
\iint_{x_1^2+x_2^2 \leq 4} \left( 3x_1^2 + 3x^2 +1 \right) dx_1  dx_2
&= \int_0^2 \int_0^{2\pi} (3r^2+1)r d\theta dr
\\
&= 2\pi \int_0^2 (3r^3+r)dr = 2\pi\left( \frac{3r^4}{4} + \frac{r^2}{2} \right) \Big|_0^2
\\
&= 2\pi (12+2) = 28\pi.
\end{align*}
We finish with
$$
\iint_{x_3^2+x_4^2 \leq 9} 28\pi dx_3 dx_4 = 9\pi\cdot 28\pi = 252 \pi^2.
$$





