# Surface Integrals

This unit covers the following ideas. In preparation for the quiz and exam, make sure you have a lesson plan containing examples that explain and illustrate the following concepts.

1. Explain how to setup surface integrals, and use them to compute surface area, average value, centroids, center of mass, moments of inertia, and radii of gyration.
2. Use surface integrals to compute flux across a surface, in a given direction.
3. Explain how to use Stokes's theorem to compute circulation.
You'll have a chance to teach your examples to your peers prior to the exam.

# Surface Area and Surface Integrals

In first-semester calculus, we learned how to compute integrals $\int_a^b f dx$ along straight (flat) segments $[a,b]$. This semester, in the line integral unit, we learned how to change the segment to a curve, which allowed us to compute integrals $\int_C fds$ along any curve $C$, instead of just along curves (segments) on the $x$-axis. The integral $\int_a^b dx=b-a$ gives the length of the segment $[a,b]$. The integral $\int_C ds$ gives the length $s$ of the curve $C$. In the double integral unit we learned how to compute double integrals $\iint_R fdA$ along flat regions $R$ in the plane. We'll now learn how to change the flat region $R$ into a curved surface $S$, and then compute integrals of the form $\iint_S fd\sigma$ along curved surfaces. The differential $d\sigma$ stands for a little bit of surface area. We already know that $\iint_R dA$ gives the area of $R$. We'll define $\iint_S d\sigma$ so that it gives the surface area of $S$.
Consider the surface $S$ given by $z=9-x^2-y^2$ (we've seen this surface many times). A parametrization of this surface is $$\vec r(x,y) = (x,y,9-x^2-y^2).$$
1. \instructor{See Sage.}% Draw the surface $S$. Add to your surface plot the parabolas given by $\vec r(x,0)$, $\vec r(x,1)$, and $\vec r(x,2)$, as well as the parabolas given by $\vec r(0,y)$, $\vec r(1,y)$, and $\vec r(2,y)$. You should have an upside down paraboloid, with at least 6 different parabolas drawn on the surface. These parabolas should divide the surface up into a bunch of different patches. Our goal is to find the area of each patch, where each patch is almost like a parallelogram.
2. Find $\ds \frac{\partial \vec r}{\partial x}$ and $\ds\frac{\partial \vec r}{\partial y}$. At the point $(2,1)$, draw both vectors. These vectors form the edges of a parallelogram. Add that parallelogram to your picture.
3. Show that the area of a parallelogram whose edges are the vectors $\ds\frac{\partial \vec r}{\partial x}(x,y)$ and $\ds\frac{\partial \vec r}{\partial y}$ is $\sqrt{1+4x^2+4y^2}$. [Hint: think about the cross product.]
4. Find the area of the parallelogram whose edges are the vectors $\ds\frac{\partial \vec r}{\partial x}dx$ and $\ds\frac{\partial \vec r}{\partial y}dy$, where $dx$ and $dy$ are to be determined.
In the previous problem, you showed that the area of the parallelogram with edges given by $\frac{\partial \vec r}{\partial x}dx$ and $\frac{\partial \vec r}{\partial y}dy$ is $$d\sigma =\left |\frac{\partial \vec r}{\partial x} \times \frac{\partial \vec r}{\partial y}\right| dxdy.$$ This little bit of area approximates the area of a tiny patch on the surface. If we add all these areas up, we should obtain the surface area.
Let $S$ be a surface. Let $\vec r(u,v)=(x,y,z)$ be a parametrization of the surface, where the bounds on $u$ and $v$ form a region $R$ in the $uv$ plane. Then the surface area element (representing a little bit of surface) is $$d\sigma =\left |\frac{\partial \vec r}{\partial u} \times \frac{\partial \vec r}{\partial v}\right| dudv = \left|\vec r_u\times\vec r_v\right|dudv.$$ The surface integral of a continuous function $f(x,y,z)$ along the surface $S$ is $$\iint_S f(x,y,z) d\sigma = \iint_R f(\vec r(u,v)) \left |\frac{\partial \vec r}{\partial u} \times \frac{\partial \vec r}{\partial v}\right| dudv.$$ If we let $f=1$, then the surface area of $S$ is simply $$\sigma = \iint_S d\sigma = \iint_R \left |\frac{\partial \vec r}{\partial u} \times \frac{\partial \vec r}{\partial v}\right| dudv.$$
This definition tells us how to compute any surface integral. The steps are almost identical to the line integral steps.
1. Start by getting a parametrization $\vec r$ of the surface $S$ where the bounds form a region $R$.
2. Find a little bit of surface area by computing $d\sigma =\left |\frac{\partial \vec r}{\partial u} \times \frac{\partial \vec r}{\partial v}\right| dudv.$
3. Multiply $f$ by $d\sigma$, and replace each $x$, $y$, $z$ with what they equals from the parametrization.
4. Integrate the previous function along $R$, your parameterization's bounds.
Consider the surface $S$ given by $z=9-x^2-y^2$, for $z\geq 0$. A parametrization of this surface is $$\vec r(x,y) = (x,y,9-x^2-y^2),\quad \text{where } 9-x^2-y^2\geq 0.$$
1. Give a set of inequalities for $x$ and $y$ that describe the region $R$ over which we need to integrate. The inequalities you give should be in a form that you can use them as the bounds of a double integral.
2. Find $d\sigma = \left|\vec r_x\times \vec r_y\right|dxdy$.
3. Set up the surface integral $\iint_S d\sigma$ as an iterated double integral over $R$.
4. Convert the integral above to an integral in polar coordinates (don't forget the Jacobian).
Consider the surface $S$ given by $z=9-x^2-y^2$, for $z\geq 0$. A different parametrization of this surface is $$\vec r(r,\theta) = (r\cos\theta,r\sin\theta,9-r^2),\quad \text{where } 9-r^2\geq 0.$$
1. Give a set of inequalities for $r$ and $\theta$ that describe the region $R_{r\theta}$ over which we need to integrate. The inequalities you give should be in a form that you can use them as the bounds of a double integral.
2. Find $d\sigma = \left|\vec r_r\times \vec r_\theta \right|drd\theta$.
3. Set up the surface integral $\iint_S d\sigma$ as an iterated double integral over $R_{r\theta}$.
Find, actually compute, the surface area of the surface $S$ given by $z=9-x^2-y^2$, for $z\geq 0$. Do this by computing any of the integrals from the previous two problems.
If a surface $S$ is parametrized by $\vec r(x,y) = (x,y,f(x,y))$, show that $d\sigma = \sqrt{1+f_x^2+f_y^2}\ dxdy$ (compute a cross product). If $\vec r(x,z) = (x,f(x,z),z)$, what does $d\sigma$ equal (compute a cross product - you should see a pattern)?
%If $\vec r(y,z) = (f(y,z),y,z)$, what does $d\sigma$ equal?
Use the pattern you've discovered to quickly compute $d\sigma$ for the surface $x=4-y^2-z^2$, and then set up an iterated double integral that would give the surface area of $S$ for $x\geq 0$.
\label{sphere surface area element} Consider the sphere $x^2+y^2+z^2=a^2$. We'll find $d\sigma$ using two different parameterizations.
1. If you use the rectangular parametrization $\vec r(x,y) = (x,y,\sqrt{a^2-x^2-y^2})$, what is $d\sigma$? [Hint, use the previous problem.] Why can this parametrization only be use if the surface has positive $z$-values?
2. You'll want to memorize this result.
If you use the spherical parametrization $$\vec r(\phi,\theta) = (a\sin\phi\cos\theta,a\sin\phi\sin\theta,a\cos\phi),$$ show that $$d\sigma = (a^2|\sin\phi|)d\phi d\theta= (a^2\sin\phi) d\phi d\theta,$$ where we can ignore the absolute values if we require $0\leq \phi\leq \pi$. Along the way, you'll show that $$\vec r_\phi\times \vec r_\theta = a^2\sin \phi (\sin\phi\cos\theta,\sin\phi\sin\theta,\cos\phi).$$
We can compute average value, centroids, center of mass, moments of inertia, and radii of gyration as before. We just replace $dA$ with $d\sigma$, and all the formulas are the same.
Consider the hemisphere $x^2+y^2+z^2=a^2$ for $z\geq 0$.
1. Set up a formula that would give $\bar z$ for the centroid of the hemisphere. I suggest you use a spherical parametrization, as then the bounds are fairly simple, and we know $d\sigma = (a^2\sin\phi) d\phi d\theta$ from the previous problem.
2. Compute the two integrals in your formula. %By doubling the bottom integral, you'll have also shown that the surface area of a sphere of radius $a$ is $\sigma = 4\pi a^2$.
3. Set up an integral formula for $R_z$, the radius of gyration about the $z$ axis, provided the density is constant.

# Flux across a surface

We now want to look at the flux of a vector field across a surface $S$. In the line integral section, we defined the outward flux of a vector field $F$ across a curve $C$ to be the line integral $\ds \int_C \vec F\cdot \vec n ds$, where $\vec n$ is a normal vector point out of region enclosed by a curve $C$. When we want to find the flux of a vector field across a surface, we must state in which direction we want to compute the flux. We then must make sure that normal vector $\vec n$ we choose to use actually points in the desired direction. The flux of a vector field $\vec F$ across a surface $S$ is the surface integral $$\text{Flux}=\Phi = \iint_S \vec F\cdot \vec n d\sigma .$$ The next problem will help us simplify the computation of $\vec nd\sigma$.
Consider again the surface $z=9-x^2-y^2$.
1. Using the parametrization $\vec r(x,y) =(x,y,9-x^2-y^2)$, find a unit normal vector $\vec n$ to the surface so that $\vec n$ points upwards away from the $z$-axis. State what $d\sigma$ equals, as well as $\vec n d\sigma$. Make sure you explain how you know the normal vector you give is pointing upwards away from the $z$ axis.
2. Using the parametrization $\vec r(r,\theta) =(r\cos \theta,r\sin\theta ,9-r^2)$, find a unit normal vector $\vec n$ to the surface so that $\vec n$ points downwards towards the $z$-axis. State what $d\sigma$ equals, as well as $\vec n d\sigma$. Make sure you explain how you know the normal vector you give is pointing downwards towards the $z$ axis.
[For both parts above, the computations involved were actually done in previous problems. You just need to compile the information here.]
In the problem above, we showed that $\vec n d\sigma = \pm(\vec r_x\times\vec r_y)dxdy$ and that $\vec n d\sigma = \pm(\vec r_r\times\vec r_\theta)drd\theta$. We no longer need to find the magnitude of the cross product, but we must determine the correct sign to put on our cross product. This shows us that we can write flux as $$\text{Flux}=\Phi = \iint_S \vec F\cdot \vec n d\sigma = \iint_{R_{uv}} \vec F\cdot (\pm \vec r_u\times \vec r_v) dudv .$$
Consider the cone $z^2=x^2+y^2$ and vector field $\vec F = (2x+3y, x-2y, yz)$. Set up an iterated integral that would give the flux of $\vec F$ outwards (away from the $z$-axis) for the portion of the cone between $z=1$ and $z=3$. [Hint: Start by parameterizing the cone by using a polar parametrization $$x=r\cos\theta, y=r\sin\theta, z=?.$$ You should obtain bounds for $r$ and $\theta$ that are constants. Compute the normal vector and look at the third component to determine if it points up or down. Then just plug everything into the formula.]
When the surface is flat, often you can determine the normal vector without having to perform any cross products. We'll now compute a flux of a vector field outwards across the 6 faces of a cube.
Find the flux of $\vec F=(x+y,y,z)$ outward across the surface of the cube in the first quadrant bounded by {$x=2,y=3,z=5$}. The cube has 6 surfaces, so we have to compute the flux across all 6 surfaces. Fill in the table below to complete the flux across each surface, and then compute each integral to find the total flux.
{|c|c|c|c|c|c|} \hline Surface&$\vec r(u,v)$ & $\vec n$ & $\vec F(\vec r(u,v))$ & $\vec F\cdot \vec n$ & Flux\\\hline Back $x=0$&$\left<0,y,z\right>$ & $\left<-1,0,0\right>$ & $\vec F(0,y,z) = \left<y,y,z\right>$ & $-y$& $\iint_{\text Back} -y d\sigma = -\bar y \sigma=-(\frac{3}{2})(15)$\\\hline Front $x=2$& $\left<2,y,z\right>$ & & $\vec F(2,y,z) = \left<2+y,y,z\right>$ & & \\\hline Left $y=0$& & & & & $0$ (Why?)\\\hline Right $y=3$& $\left<x,3,z\right>$ & $\left<0,1,0\right>$ & $\vec F(x,3,z) = \left<x+3,3,z\right>$ & 3 & 30 (Why?) \\\hline Bottom $z=0$& & & & & \\\hline Top $z=3$& & & & & \\\hline
You should be able to complete each integral by considering centroids and surface area of each of the 6 different flat surfaces. Show that the total flux is 90.
In the double integral chapter, we learned a way to greatly simplify flux computations when working with simple closed curves. Green's theorem stated that $\int_C \vec F\cdot \vec n\ ds = \iint_R M_x+N_y dA$. The divergence of $\vec F$ is the quantity $\text{div}(\vec F) = M_x+N_y$. This generalizes to higher dimensions, and is called the divergence theorem. The next problem illustrates how. We'll study this more in the triple integral unit.
Consider the exact same vector field and box as the previous problem. So we have the vector field $\vec F=(x+y,y,z)$ and $S$ is the surface of the cube in the first quadrant bounded by {$x=2,y=3,z=5$}.
1. Compute the divergence of $\vec F$, which is $\text{div}(\vec F) = M_x+N_y+P_z$.
2. The divergence theorem states that if $S$ is a closed surface (has an inside and an outside), and the inside of the surface is the solid domain $D$, then the flux of $\vec F$ outward across $S$ equals the triple integral $$\iint_S\vec F\cdot \vec n\ d\sigma = \iint\int_D \text{div}(\vec F)dV.$$ Use the divergence theorem to compute the flux of $\vec F$ across $S$. [Hint: Just as the area is found by adding up little bits of area, which is what we mean by $A=\iint_R dA$, the volume is found by adding up little bits of volume.]
In problem TODO, we found $$\vec n d\sigma = \vec r_\phi\times \vec r_\theta d\phi d\theta = a^2\sin \phi (\sin\phi\cos\theta,\sin\phi\sin\theta,\cos\phi)d\phi d\theta$$ for a sphere of radius $a$. Use this to compute the outward flux of $$\ds \vec F=\frac{\left<-x,-y,-z\right>}{(x^2+y^2+z^2)^{3/2}}$$ across a sphere of radius $a$. You should get a negative number since the vector field has all arrows pointing in. [Hint: Remember that for a sphere of radius $a$ we have $a^2=x^2+y^2+z^2$. When you perform the dot product of $\vec F$ and $\vec n$, you'll save yourself a lot of time if you remember that $\vec u\cdot \vec u = |\vec u|^2$; the dot product of a vector with itself is the length squared.]
Repeat the previous problem, but this time don't use the formula from problem TODO. In fact, you don't even need to parametrize the surface. Instead, if you are at the point $(x,y,z)$ on a sphere of radius $a$, give a formula for the outward pointing unit normal vector $\vec n$. Give this formula by only using a geometric argument. Then find the outward flux of {$\ds \vec F=\frac{\left<-x,-y,-z\right>}{(x^2+y^2+z^2)^{3/2}}$} across a sphere of radius $a$. You should find that $\vec F\cdot \vec n$ simplifies to a constant, so that you never actually have to compute $d\sigma$. Then you can use known facts about the surface area of a sphere.
A sizeable amount of text for Stokes' Theorem is commented out in the source. It is not polished up yet, as I have not yet had time to visit the topic in our course. It is an optional topic, that I hope to get to soon.

# Circulation Density and Stokes' Theorem

When we finish the triple integral unit, I will make the next set of problems appear. It is more important that we get to triple integrals. As a final application of surface integrals, we now generalize the circulation version of Green's theorem to surfaces. To start, we need to define the circulation density of a vector field in a specific direction. The direction in which the circulation density is the greatest gives us a physical vector called the curl of the vector vector field. The proofs the facts below are left to an advanced course in mathematics.
Consider the differentiable vector field $\vec F = \left<M,N,P\right>$. Pick a point $P=(x,y,z)$ and a unit direction vector $\vec u$. At a point $P$ in space, create a plane through $P$ with unit normal vector $\vec u$. In that plane, create a circle $C_a$ of radius $a$ centered at $P$, where $\sigma_a$ is the surface area of the region inside $C_a$ on the plane. The quotient $\ds\frac{1}{\sigma_a}\oint_C \vec F d\vec r$ is a ratio of circulation per surface area. We define the circulation density of $\vec F$ at $P$ about $\vec u$ to be $\ds \lim_{a\to 0} \frac{1}{\sigma_a}\oint_{C_a} \vec F d\vec r$.
In a more advanced course, we would prove that the circulation density of $\vec F$ at $P$ about $\vec u$ is $$\lim_{a\to 0} \frac{1}{\sigma_a}\oint_{C_a} \vec F d\vec r = \left<P_y-N_z, M_z-P_x, N_x-M_y\right>\cdot \vec u.$$ We call the vector $\left<P_y-N_z,M_z-P_x,N_x-M_y\right>$ the curl of $\vec F$ and we write \begin{align*} \text{curl}(\vec F) &= \vec \nabla \times \vec F \\ &= \left(\frac{\partial}{\partial x},\frac{\partial}{\partial y},\frac{\partial}{\partial z}\right) \times (M,N,P) \\ &= \left(\frac{\partial P}{\partial y}-\frac{\partial N}{\partial z}, \frac{\partial M}{\partial z}-\frac{\partial P}{\partial x},\frac{\partial N}{\partial x}-\frac{\partial M}{\partial y}\right) \\ &= \left(P_y-N_z,M_z-P_x,N_x-M_y\right) \end{align*} The notation $\vec \nabla \times \vec F$ gives a convenient way to remember the formula, as \begin{align*} \text{curl}(\vec F)=\vec \nabla \times \vec F &=\det \begin{bmatrix} \vec i & \vec j & \vec k\\ \frac{\partial}{\partial x}&\frac{\partial}{\partial y}&\frac{\partial}{\partial z}\\ M&N&P \end{bmatrix} \\&= \left(\frac{\partial}{\partial y}P-\frac{\partial}{\partial z}N,\frac{\partial}{\partial z}M-\frac{\partial}{\partial x}P,\frac{\partial}{\partial x}N-\frac{\partial}{\partial y}M\right) \end{align*}
The circulation density of $\vec F$ at $(x,y,z)$ about $\vec u$, written $\text{curl}\vec F\cdot \vec u$ is largest when $\vec u$ points in the same direction as $\text{curl} F$. The curl of a vector field is the direction of the greatest circulation density, and the magnitude of the curl is the circulation density in that direction. If a vector field causes a large amount of circulation in one direction, then the curl will be a long vector.
Find the curl of each vector field.
See MathInsight.org for a really nice animation of the curl of a vector field.
1. $\vec F(x,y,z) = \left(z,x,y \right)$
2. $\vec F(x,y,z) = \left(-y+x,x,z \right)$
3. $\vec F(x,y,z) = \left(x^2+y^2,x^2+z^2,y^2+z^2 \right)$
4. $\vec F(x,y,z) = \left(x^3+y,\tan^{-1}(1+y^2) + z^2,e^{z^2+\sin z} -2x\right)$
We are now prepared to explain Stokes' Theorem. Let's start by showing how Green's theorem extends to 3D. A vector field in the plane $\vec F = \left(M,N\right)$ can be extended to 3D by writing $\vec F = \left(M,N,0\right)$. The curl is $\text{curl}\vec F = \left<0,0,N_x-M_y\right>$. A normal vector to a surface $S$ in the $xy$ plane is $\vec n = \left<0,0,1\right>$. We can then write Green's theorem as $$\oint_C\vec F\cdot d\vec r = \oint_C Mdx+Ndy = \iint_S \text{curl}\cdot \vec n d\sigma = \iint_R \left(N_x-M_y\right) dA,$$ where $C$ is a simple closed curve in the plane and $S=R$ is the planar region that is inside $C$.
Suppose $\vec F(x,y,z) = (M,N,P)$. Suppose that $S$ is a surface in the plane, whose boundary is the simple closed curve $C$. Suppose that $\vec n$ is a continuous unit normal vector to $S$ along the entire surface, where the orientation of $\vec n$ matches the orientation of $C$ according to the right hand rule (meaning that if you curl your right hand around $\vec n$ with your thumb pointing along $\vec n$, then your fingers will follow the orientation of $\vec C$). Then Stokes' theorem states that $$\int_C\vec F\cdot d\vec r = \iint_S \text{curl}\cdot \vec n d\sigma .$$
Consider the vector field $\vec F = (2z,3y,-4x)$. Let $C$ be the disc $x^2+z^2\leq 9$ in the plane $y=2$. Let $C$ be the boundary of this disc, so the circle $x^2+z^2=9$ in the plane $y=2$. The curve $C$ is oriented in the counterclockwise direction when looked at from the origin.
1. Compute the curl of $\vec F$, and state the unit normal vector $\vec n$ to $S$ that is oriented compatibly with $C$.
2. Give a parametrization $\vec r(t)$ of the curve $C$.
3. Verify Stokes' theorem by computing both sides of the equation $$\int_C\vec F\cdot d\vec r = \iint_S \text{curl}\cdot \vec n d\sigma.$$ The left side will require you to set up and evaluate a line integral. The right side will require you to evaluate a surface integral (though you should be able to reduce this integral to a known quantity).
Consider the vector field $\vec F = \left(x+y, y+z, x+z\right)$. Let $C$ be the space curve which travels around a triangle in $\mathbb{R}^3$ and hits the vertexes $(2,0,0)$, $(0,3,0)$, and $(0,0,6)$, in this order. This triangle lies in the plane $S$ given by $\ds \frac x2+\frac y3 +\frac z6=1$, or equivalently $z=6-3x-2y$.
1. Give bounds for $x$ and $y$ so that $\vec r(x,y)=(x,y,6-3x-2y)$ is a parametrization of $S$.
2. Show that the circulation of $\vec F$ along $C$ is $-18$, by using Stokes' theorem.
Let $\vec F = \left<z,y^2,x^2\right>$. The surface $S$, parametrized by $\vec r(u,v) = \left<u\cos v,u\sin v, u\right>$ for $0\leq u\leq 1$ and $0\leq v\leq 2\pi$ is a cone. The boundary of $S$ is the curve $C$ is a circle of radius one at height $z=1$. If we choose as our normal vector to $S$ the outward normal (away from the $z$-axis), then to use Stokes' theorem we must orient $C$ counterclockwise as seen from below the surface.
1. Find $\vec n d\sigma$ (the product should allow you to ignore magnitudes).
2. Give a parameterization of $C$ that is oriented compatibly with $\vec n$.
3. Set up both integrals in Stokes' theorem. Don't evaluate either.
4. Note that the surface $S_2$, which is the disc $x^2+y^2\leq 1$ at height $z=1$, has the same boundary $C$ as surface $S$. The normal vectors to $S_2$ are $(0,0,\pm 1)$. Use Stokes' theorem to compute both integrals above.
Being creative in your choice of surface can sometimes make a problem trivial.
Let $\vec F(x,y,z)=(M,N,P)$ be a continuously differentiable vector field. Suppose that $\vec F$ has a potential (so that $D\vec F$ is symmetric). Compute the derivative of $F$ as a square matrix. Explain which partial derivatives must be equal. Use this information to find the curl of $\vec F$ if $\vec F$ has a potential. According to Stokes' Theorem, what is the circulation of $\vec F$ along any closed path, provided $\vec F$ has a potential?