
\section{Flux Integrals}

\subsection{Oriented Surfaces}
A smooth surface $\mathcal{S} \subset \mathbb{R}^3$ is \textbf{orientable} if we can define a \textit{continuous} vector field $\mathbf{N} : \mathbb{R}^3 \rightarrow \mathbb{R}^3$ on $\mathcal{S}$ so that $\vert \mathbf{N} \vert = 1$ and $\mathbf{N}$ is normal to $\mathcal{S}$ at each point. 
If such a field exists, it is unique up to the choice of sign (if $\mathbf{N}$ has the above property, then so does $- \mathbf{N}$). The \textbf{orientation} of $\mathcal{S}$ is the choice of one of $\mathbf{N}$ and $- \mathbf{N}$. Assuming that we choose $\mathbf{N}$, the \textbf{positive side} of $\mathcal{S}$ is the side out of which $\mathbf{N}$ is pointing.
An \textbf{oriented surface} is an orientable surface $\mathcal{S}$ together with a choice of $\mathbf{N}$.


\begin{figure}[h]
\begin{minipage}{\linewidth}
\centering
\includegraphics[width = .25\linewidth]{figures/32fig1.png}
\caption{An example of an oriented surface.  We have demarcated a uniformly-spaced collection of points $P \in \mathcal{S}$ as well as the associated normal vector $\mathbf{N}(P)$ at each point.}
\end{minipage}
\end{figure}


Some common types of orientable surfaces are:

\begin{itemize}
\item All \textit{closed surfaces} are orientable. When $\mathcal{S}$ is closed, there is a natural notion of ``inside'' and ''outside''.
Unless stated otherwise, the default orientation will always be with $\mathbf{N}$ pointing outward (to the outside of $\mathcal{S}$). 

\smallskip

\item If $\mathcal{S} = \mathcal{S}_g$ is the \textit{graph of a $C^1$ function} $g : \mathbb{R}^2 \rightarrow \mathbb{R}$, then $\mathcal{S}_g$ is also orientable.  This follows because a formula for the (non-normalized!) normal vector is given by
$$
\mathbf{n}(x,y) : = -g_x (x,y) \mathbf{i} - g_y (x,y) \mathbf{j} + \mathbf{k},
$$
which is continuous (since $g$ is smooth) and nonzero because the last component is always 1.  In this situation, the defaut orientation has $\mathbf{N}$ pointing in the same direction as the vector $\mathbf{n}(x,y)$ defined above, ``upward'' in the sense that the $\mathbf{k}$-component of $\mathbf{N}$ is positive.
\end{itemize}





\begin{figure}[h]
\centering
\begin{subfigure}{.5\textwidth}
  \centering
  \includegraphics[width=.5\linewidth]{figures/32fig2b.png}
  \caption{A closed surface.}
  \label{fig:sub1}
\end{subfigure}%
\begin{subfigure}{.5\textwidth}
  \centering
  \includegraphics[width=.65\linewidth]{figures/32fig2.png}
  \caption{The graph of a function.}
  \label{fig:sub2}
\end{subfigure}
\caption{Two pictures of the examples above.}
\label{fig:test}
\end{figure}




\subsection{Orientation and Boundary Curves} If $\mathcal{S}$ is oriented \textit{and also} has a boundary (i.e. a curve $\mathcal{C}$), then the orientation on $\mathcal{S}$ induces an orientation on $\mathcal{C}$.
The induced orientation is as follows: if we imagine a person standing on the curve $\mathcal{C}$ with their head pointing in the direction of the normal vector ${\bf N}$, looking forward in the direction indicated by the orientation of $\mathcal{C}$, then their right hand should point away from $\mathcal{S}$. For example, if $\mathcal{S}$ is the unit disc in the $xy$-plane with the orientation provided by ${\bf N}=\kk$, then $\mathcal{C}$ is the unit circle oriented counterclockwise. 

\begin{figure}[h]
\begin{minipage}{\linewidth}
\centering
\includegraphics[width = .4\linewidth]{figures/32fig4.pdf}
\caption{In the above picture, $\mathcal{S}$ is the part of the plane that lies between two curves $\mathcal{C}_1$ (``on the outside'') and $\mathcal{C}_2$ (``on the inside''). If $\mathcal{S}$ is oriented so that the normal vectors $\mathbf{N}$ (in red) point towards the viewer, then the matching boundary orientation is counterclockwise on $\mathcal{C}_1$ (the outside) and clockwise  on $\mathcal{C}_2$ (the inside). }
\end{minipage}
\end{figure}

\begin{figure}[h]
\begin{minipage}{\linewidth}
\centering
\includegraphics[width = .4\linewidth]{figures/32fig5.png}
\caption{The cube is a piecewise smooth surface. If we choose the normal vectors $\mathbf{N}_1$, $\mathbf{N}_2$ and $\mathbf{N}_3$ (in blue) to point outward, the associated boundary curves have compatible (i.e. opposite) orientations!}
\end{minipage}
\end{figure}




A \textbf{piecewise smooth} surface $\mathcal{S}$ can be broken up into finitely many smooth pieces $\mathcal{S}_1$,...,$\mathcal{S}_J$, joined along shared boundary curves. Assume that each piece is orientable, with the corresponding normal vectors $\mathbf{N}_1$,...$\mathbf{N}_J$. If the choices of normal vectors on each of the smooth parts are compatible, in the sense that they point out of the same side of the surface, then they define a ``global" orientation on $\mathcal{S}$. The compatibility condition can be checked using the induced orientation on joint boundary curves: the induced curve orientations should be \textit{opposite} to each other.



\subsection{Flux Integrals}
Now suppose that $\mathbf{F}$ is the velocity of a gas or fluid flowing through a porous membrane $\mathcal{S}$.  Our question is: how much gas or fluid passes from one side of $\mathcal{S}$ to the other side in a given unit of time? Notice that, in order for this question to make sense, we need to assume that $\mathcal{S}$ is \textit{orientable}. This is so that the notion of ``one side'' and ``the other side'' have a well-defined meaning.

For a small patch of $\mathcal{S}$, the fluid flowing through that patch in unit time forms a cylinder (usually non-rectangular); the base area of this cylinder is $dS$ and its height is given by $h = \mathbf{F} \cdot \mathbf{N}$, so that the volume is $\mathbf{F} \cdot \mathbf{N}\,dS$.

\begin{figure}[h]
\begin{minipage}{\linewidth}
\centering
\includegraphics[width = .75\linewidth]{figures/32fig6.png}
\end{minipage}
\end{figure}

Summing up over all such cylinders and passing to the limit as $dS \rightarrow 0$, we obtain the flux integral:
\begin{eqnarray}
\textrm{(Flux Integral)} & \quad & \iint_{\mathcal{S}} \mathbf{F} \cdot \mathbf{N} \, dS = \iint_{\mathcal{S}} \mathbf{F} \cdot d \mathbf{S},
\end{eqnarray}
where $d \mathbf{S} = \mathbf{N} d S$ is simply a notation we use to supress the orientation vector $\mathbf{N}$. Often, if $\mathcal{S}$ is a closed surface with orientation $\mathbf{N}$ pointing outward, we may use the notation $\oiint_{\mathcal{S}}$ instead of $\iint_{\mathcal{S}}$. 

\subsection{Calculating Flux Integrals} We will now spend some time learning how to calculate flux integrals. This can be done using geometric considerations, a suitable parametrization of the surface, or some combination of both. 

\begin{enumerate}
\item \underline{Using geometric considerations.} This often works if $\mathbf{F} \cdot \mathbf{N}$ is particularly simple or easy to compute.  Other times, it can be combined with our second approach below (using a parametrization) to simplify the calculations. Let's see an example.

\begin{example}
Evaluate $\oiint \mathbf{F} \dot d \mathbf{S}$ if $\mathbf{F} (\mathbf{r}) = \frac{c \mathbf{r}}{\vert \mathbf{r} \vert^3}$ and $\mathcal{S}$ is the sphere $x^2 + y^2 + z^2 = a^2$, for $a > 0$.

\medskip
The unit normal vector pointing outward is $\mathbf{N}(\mathbf{r}) = \frac{\mathbf{r}}{\vert \mathbf{r} \vert} = \frac{\mathbf{r}}{a}$.  We also notice that $\mathbf{F}$ is radial, therefore parallel to $\mathbf{N}$. So,
$$
 \mathbf{F} \cdot \mathbf{N}  = \frac{c\mathbf{r}}{a^3} \cdot \frac{\mathbf{r}}{a} = \frac{c \vert \mathbf{r} \vert^2}{a^4} = \frac{c}{a^2}.
$$
At the end, we used once more  that $|\bfr|=a$ on $\mathcal{S}$.
In particular, we see that $\mathbf{F} \cdot \mathbf{N}$ is constant on the sphere $\mathcal{S}$. Hence,
\begin{eqnarray*}
\oiint_{\mathcal{S}} \mathbf{F} \cdot d \mathbf{S} & = & \iint_{\mathcal{S}} \mathbf{F} \cdot \mathbf{N} d S = \iint_{\mathcal{S}} \frac{c}{a^2} d S \\
\quad & = & \frac{c}{a^2} \big( \textrm{Area of } \mathcal{S} \big) = 4 \pi c.
\end{eqnarray*}
Note that the flux of $\mathbf{F}$ over $\mathcal{S}$ does not depend upon the radius $a$!
\end{example}

\smallskip

\item \underline{Using parametrization.} If $\mathcal{S}$ is a parametric surface given by $\mathbf{r}(u,v)$ for $(u,v) \in D$, we know that a normal vector is given by $\mathbf{n} = \mathbf{r}_u \times \mathbf{r}_v$, so that $dS = \vert \mathbf{n} \vert du dv$.  As long as ${\bf n}\neq {\bf 0}$, the \textit{unit} normal is given by $\mathbf{N} =  \pm \frac{\mathbf{n}}{\vert \mathbf{n} \vert}$ (where the $\pm$ is chosen to match the orientation). So,
\begin{eqnarray*}
\iint_{\mathcal{S}} \mathbf{F} \cdot d \mathbf{S} & = & \iint_{\mathcal{S}} \mathbf{F} \cdot \mathbf{N} d S = \iint_{D} \mathbf{F} \cdot \bigg(\pm \frac{\mathbf{n}}{\vert \mathbf{n} \vert} \bigg) \vert \mathbf{n} \vert du dv \\[1ex]
\quad & = & \pm \iint_{D} \mathbf{F} \cdot \mathbf{n} \,  dudv
\end{eqnarray*}

\smallskip

\item \underline{Special Case Parametrizations}. 
Assume that $\mathcal{S}$ is the graph of a function $z = g(x,y)$, with $\mathbf{N}$ pointing up. Previously, we found the normal vector ${\bf n} = -g_x \mathbf{i} - g_y \mathbf{j} + \mathbf{k}$. Then ${\bf N}=\frac{\bf n}{|{\bf n}|}$ (why does this give the correct orientation?), so that
$$
d \mathbf{S} = {\bf N} \,dS= \frac{\bf n}{|{\bf n}|} |{\bf n}| \, dxdy
=\big(-g_x \mathbf{i} - g_y \mathbf{j} + \mathbf{k}\big) \, dxdy.
$$

More generally, if $\mathcal{S}$ is given by the equation $G(x,y,z) = 0$ and $G_z = \frac{\partial G}{\partial z} \neq 0$ on $\mathcal{S}$, then we proved that
$$
\mathbf{n} = \frac{\nabla G}{\vert G_z \vert}, \quad dS = \frac{\vert \nabla G \vert}{\vert G_z \vert} \, dx dy.
$$
For the unit normal, we use $\mathbf{N} = \pm \frac{\nabla G}{\vert \nabla G \vert}$. This is just a unit vector in the direction of the vector $\nabla G$ perpendicular to the level surface of $G$, with the $\pm$ sign again depending on the choice of orientation. Hence
$$
d \mathbf{S} = \mathbf{N} dS = \pm \frac{\nabla G}{\vert \nabla G \vert} \cdot \frac{\vert \nabla G \vert}{\vert G_z \vert} \, dxdy = \pm \frac{\nabla G}{\vert G_z \vert} \, dxdy,
$$

\end{enumerate}


\section*{Worked Problems}
\begin{enumerate}[1.]
\item
{\it Evaluate $\iint_{\mathcal{S}} \mathbf{F} \cdot d \mathbf{S}$, if $\mathbf{F}(x,y) = x \mathbf{i} + z \mathbf{k}$ and $\mathcal{S}$ is parametrized by $\langle x,y,z \rangle = \langle u^2, uv, \frac{v^2}{2} \rangle$ and $0 \leq u,v \leq 1$, with $\mathbf{N}$ pointing up.}

\medskip

We have
$$
\mathbf{r}_u = \langle 2u, v,  0 \rangle, \, \mathbf{r}_v = \langle 0, u, v \rangle \Rightarrow \mathbf{n}=\mathbf{r}_u \times \mathbf{r}_v = \langle v^2, -2uv, 2 u^2 \rangle.
$$
Notice that, for all $0 < u < 1$, we have $2 u^2 > 0$, so that $\mathbf{n}$  points up everywhere except for part of the boundary curve.  Now, on $\mathcal{S}$, we know that $x = u^2$ and $z = \frac{v^2}{2}$, so that
$$
\mathbf{F} \cdot \mathbf{n} = (u^2 v^2 + \frac{1}{2}v^2 \cdot 2u^2) = 2 u^2 v^2.
$$
Hence,
\begin{eqnarray*}
\iint_{\mathcal{S}} \mathbf{F} \cdot d \mathbf{S} & = & \int_0^1 \int_0^1 \mathbf{F} \cdot \mathbf{n} \, dudv = \int_0^1 \int_0^1 (2 u^2 v^2) \, dudv = 2 \frac{u^3}{3}\Big\vert_0^1 \cdot \frac{v^3}{3} \Big\vert_0^1 \\[1ex]
\quad & = & \frac{2}{9}.
\end{eqnarray*}

\medskip

\item{\it Let $\mathbf{F} = x \mathbf{j} + 2 y \mathbf{k}$, and let $\mathcal{S}$ be the part of the plane $x + y + z = 1$ that lies in the $1$st octant ($x,y,z \geq 0$), with $\mathbf{N}$ pointing up. Evaluate $\iint_{\mathcal{S}} \mathbf{F} \cdot d \mathbf{S}$. }

\medskip
Our surface  can be written as
$$
z = g(x,y), \textrm{ where } g(x,y) = 1 - x -y.
$$
This gives 
$$
d \mathbf{S} =  (-g_x \mathbf{i} - g_y \mathbf{j} + \mathbf{k}) \, dxdy= \big(\mathbf{i} + \mathbf{j} + \mathbf{k} \big) \, dx dy,
$$
so that
$$
\mathbf{F} \cdot d \mathbf{S} = (0 \cdot 1 + x \cdot 1 + 2y \cdot 1) \, dxdy = (x + 2y)dxdy.
$$
We also have $D = \{(x,y): 0 \leq x \leq 1, \, 0 \leq y \leq 1 -x \}$
The calculation then goes as follows:
\begin{eqnarray*}
\iint_{\mathcal{S}} \mathbf{F} \cdot d \mathbf{S} & = & \int_0^1 \int_0^{1 - x} (x + 2y) dy dx = \int_0^1 (xy + y^2)\big\vert_{y=0}^{y=1-x} dx \\
\quad & = & \int_0^1 (1 - x) dx = \bigg[ x - \frac{x^2}{2}\bigg]_{x = 0}^{1} \\
\quad & = & \frac{1}{2}.
\end{eqnarray*}

\medskip

\item{\it Find $\iint_{\mathcal{S}} \mathbf{F} \cdot d \mathbf{S}$, if $\mathbf{F} = y \mathbf{i} - x \mathbf{j}$ and $\mathcal{S}$ is the part of the graph of $z = x + y^2$ that lies above the rectangle $D : = \{(x,y) : 0 \leq x \leq 3, 0 \leq y \leq 2 \}$, oriented with $\mathbf{N}$ pointing up.}

\medskip

Our surface is given by the equation $z=g(x,y)$ with $g(x,y) = x + y^2$. Therefore
$$
d \mathbf{S} = \big(-g_x \mathbf{i} - g_y \mathbf{j} + \mathbf{k} \big) \, dxdy = \big( - \mathbf{i} - 2y \mathbf{j} + \mathbf{k}\big) \, dxdy,
$$
which gives
$$
\mathbf{F} \cdot d \mathbf{S} = (y \cdot (-1) - x (-2y) + 0)dxdy = (2xy - y)dxdy.
$$
The calculation is then
\begin{eqnarray*}
\iint_{\mathcal{S}} \mathbf{F} \cdot d \mathbf{S} & = & \int_0^3 \int_0^2 (2xy - y) \, dy dx = \int_0^3 \big(xy^2 - \frac{y^2}{2} \big) \big\vert_{y=0}^{2} dx \\
\quad & = & \int_0^3 (4x - 2) dx = (2x^2 -2x)\big\vert_0^3 \\
\quad & = & 12.
\end{eqnarray*}

\medskip






\item{\it
Evaluate the integral
$\iint_{\mathcal{S}} {\bf F}\cdot d{\bf S}$, where ${\bf F}= x\ii +y\jj$ and
$\mathcal{S}$ is the half-sphere $x^2+y^2+z^2=1$, $z\geq 0$, with the normal vector pointing up.}


\begin{figure}[h]
\begin{minipage}{\linewidth}
\centering
\includegraphics[width = .28\linewidth]{figures/32fig7.png}
\end{minipage}
\end{figure}


The unit normal vector to the sphere is ${\bf N}=x\ii +y\jj +z\kk$, so that ${\bf F}\cdot {\bf N}
=x^2 + y^2$. In spherical coordinates $(\theta,\phi)$, 
$$
{\bf F}\cdot {\bf N}= (\cos^2 \theta +\sin^2 \theta) \sin^2 \phi = \sin^2 \phi,
$$
so that
\begin{align*}
\int_{\mathcal{S}} {\bf F}\cdot d{\bf S}
&= \int_0^{2\pi} \int_0^{\pi/2} \sin^2 \phi \sin\phi \, d\phi d\theta
\\
&= \int_0^{2\pi} \int_0^{\pi/2} (1-\cos^2 \phi) \sin\phi\, d\phi d\theta
\\
&= 2\pi \left[ -\cos\phi + \frac{\cos^3\phi}{3}\right]_{0}^{\pi/2}
\\
&= 2\pi \Big( 1-\frac{1}{3}\Big) = \frac{4\pi}{3}.
\end{align*}





\end{enumerate}
\section*{Practice Problems}
\begin{enumerate}[1.]
\item
{Let $\mathcal{S}$ be the surface ${\bf r}(u,v)=(u \cos v, u\sin v, 2v)$ with $0\leq u\leq 2$, $0\leq v\leq 2\pi$,
oriented with ${\bf N}$ pointing up.
Evaluate the integral 
$\iint_{\mathcal S} {\bf F}\cdot d{\bf S}$, where ${\bf F}=-y{\bf i}+(x+y^2){\bf j}+z{\bf k}$.}

\bigskip


\item
{Evaluate the integral
$\iint_{\mathcal S} {\bf F}\cdot d{\bf S}$, where ${\bf F}= z{\bf i}+y^2{\bf j} $ and $\mathcal{S}$ is 
the part of the cylinder $x^2+y^2=4$ where $x\geq 0$, $y\geq 0$, $0\leq z\leq 1$, with the normal pointing away
from the $z$-axis.}


\bigskip

\item
{Evaluate the surface integral $\displaystyle{\int\!\!\!\int_{S} {\bf F}\cdot d{\bf S}}$, if ${\bf F}=z\kk$ and $S$ is the rectangle with
vertices $(0,2,0)$, $(0,0,4)$, $(5,2,0)$, $(5,0,4)$, oriented so that the normal vector points upward.}

\bigskip

\item
{Evaluate the surface integral
$\iint_{\mathcal S} {\bf F}\cdot d{\bf S}$, where ${\bf F}= x^2 {\bf i}$ and $\mathcal{S}$ is the part of the
plane $\displaystyle x + \frac{y}{2} + \frac{z}{3} = 1$ that lies in the first octant ($x,y,z\geq 0$),
with the normal vector pointing up.}


\bigskip

\item
{Evaluate the integral
$\iint_{\mathcal S} {\bf F}\cdot d{\bf S}$, where ${\bf F}= {\bf i}+2{\bf j} + 2{\bf k}$ and $\mathcal{S}$ is 
the surface parametrized by 
${\bf r}(u,v)=\langle uv, u^2-v^2,u^2+v^2\rangle $ with $0\leq u\leq 1$, $0\leq v\leq u$, with the normal vector pointing up.}

\bigskip

\item
{Evaluate the integral $\iint_{\mathcal{S}}{\bf F}\cdot d{\bf S}$, where ${\bf F}=x^2\ii+y^4\jj$ and
$\mathcal{S}$ is the part of the surface $xy^2z=3$ that lies above the rectangle $1\leq x\leq 2$, $1\leq y\leq 3$,
with the normal vector pointing up.}
\end{enumerate}







