Multivariable Calculus

Table of Contents

Preface

These are my notes on multivariable calculus. This is by no means an exhaustive list of topics. Rather, it includes selective topics – often information for which I have a need elsewhere on this website. Most of the material on this page is patterned after the Multivariable Calculus Section at Khan Academy.

I. Line Integrals

I.1 Line Integral of a Curve

I.1.1 Derivation

Graph for line integral of curve
Figure 1.1.1.1

In figure 1.1.1.1, we have a blue curve, C. We want to find its length. Our strategy will be to divide the curve up into infinitesimal segments (ds, red) tangent to C, find the length of these segments and add them all up. Mathematically, this amounts to taking an integral:

    \[ L = \int_{x_1}^{x_2} ds  \quad \text{(1.1.1.1)} \]

where

  • L is the total length of C
  • ds is the length of the infinitesimal elements that we want to add

The length of ds is given by the Pythagorean theorem:

    \[  ds^2  =  x^2 + y^2 \quad \Rightarrow \quad ds = \sqrt{dx^2 + dy^2}  \quad \text{(1.1.1.2)} \]

If we’re talking about the a 2D curve in the x-y plane, then we can define our curve as:

    \[ y=f(x)  \quad \text{(1.1.1.3)}  \]

Then our infinitesimal length element is:

    \begin{align*}   ds &= \sqrt{dx^2 + dy^2} \\ &= \sqrt{dx^2 + (f^{\prime}(x)dx)^2} \\ &= \sqrt{(1 + (f^{\prime}(x))^2)dx^2} \\ &= \sqrt{1 + (f^{\prime}(x))^2}dx  \quad \text{(1.1.1.4)}  \end{align*}

And our integral becomes:

    \[  \int _{x_1}^{x_2} \sqrt{1 + (f^{\prime}(x))^2}dx  \quad \text{(1.1.1.5)} \]

I.1.2 Example

Graph of line integral of a parabola
Figure 1.1.2.1

As an example, let’s calculate the length along the parabola pictured in figure 1.1.2.1, from x = -1 to x = +1.

The equation for this parabola is:

    \[  y=x^2 \quad \text{(1.1.2.1)} \]

    \[  dy = 2x \,dx \quad \text{(1.1.2.2)} \]

Our line element is:

    \begin{align*} ds &= \sqrt{dx^2 + dy^2} \\ &= \sqrt{dx^2 + (2x\,dx)^} \\ &= \sqrt{dx^2 + 4x^2\,dx^2} \\ &= \sqrt{1 + 4x^2}dx \quad \text{(1.1.2.3)}  \end{align*}

The integral we need to solve is:

    \begin{align*}  L &= \int_{-1}^{+1} \sqrt{1 + 4x^2}\,dx \quad \text{(1.1.2.4)}   \\ &= \eval{\frac{\text{arcsinh}(2x)}{4} + \frac{x\sqrt{1+4x^2}}{2}}_{-1}^{+1}\\ &= \frac{\text{arcsinh}(2)+2\sqrt{5}}{2}\\ &\approx 2.958 \end{align*}

(The integral is hairy. I used an online calculator to find the answer.)

I.2 Line Integral of a Scalar Function

I.2.1 Derivation

Diagram of line integral fof scalar function
Figure 1.2.1.1

In figure 1.2.1.1, we have a curve C, in orange, in the x-y plane. We also have a surface, shown in light blue specified by a function of x and y, f(x,y). We run lines, along the entire course of C, in the +z direction from C to the blue surface, forming a “curtain” of sorts. We want to find the area of the curtain.

To do this, we divide the curtain up into narrow rectangles, find the area of these rectangles, add up all these areas, and we should have the area of the curtain. The base of these narrow rectangles, along the curve C, is ds. The height of each rectangle is f(x,y). The area of each rectangle is given by F(x,y)\cdot ds. If we take the limit of the sum of all these areas as ds\rightarrow 0, we wind up with an integral that gives us the area of the curtain:

    \[ A_{\text{curtain}}=\int f(x,y) \cdot ds \quad \text{(1.2.1.1)} \]

To solve this integral, we:

  • Find an expression for the differential length element, ds, along C
  • Parameterize the curve C (i.e., express x and y in terms of another variable (parameter), t
  • Express the endpoints of C in terms of t to define the limits of integration

By the Pythagorean theorem, the length of the differential length element is:

    \[  ds^2  =  x^2 + y^2 \quad \Rightarrow \quad ds = \sqrt{x^2 + y^2} \quad \text{(1.2.1.2)} \]

To parameterize C, we let:

x = g(t)
y = h(t)

We define the endpoints of C as t=a and t=b, as shown in figure 2.

Figure 1.2

From this, our integral becomes:

    \[ A_{\text{curtain}}=\int_{t=a}^{t=b} f(x,y)\cdot\sqrt{x^2 + y^2} \quad \text{(1.2.1.3)} \]

But our integral contains x’s, y’s and t’s. We need to get everything in terms of one variable so we do the following:

First, let:

f(x,y) = f(x(t), y(t)) \quad \text{(1.2.1.4)}

Second:

    \begin{align*}  \sqrt{x^2 + y^2}\cdot \displaystyle \frac{dt}{dt} \\ &= \displaystyle \frac{1}{dt}\sqrt{x^2 + y^2}dt\\ &= \sqrt{\displaystyle \frac{1}{dt^2}\cdot(x^2 + y^2)}dt \\ &= \sqrt{\displaystyle \frac{x^2 }{dt^2}+ \displaystyle \frac{x^2 }{dt^2}} dt \quad \text{(1.2.1.5)} \end{align*}

Putting these values into our integral, we get:

    \[  A_{\text{curtain}}=\int_{t=a}^{t=b} f(x(t), y(t)) \cdot  \sqrt{\displaystyle \frac{x^2 }{dt^2}+ \displaystyle \frac{x^2 }{dt^2}} dt  \quad \text{(1.2.1.6)} \]

This is the integral we need to solve to get our area.

I.2.2 Example

Line integral of a quarter circle under a 3D surface z=xy.
Figure 1.2.2.1

Figure 1.2.2.1 shows a surface specified by z=xy in 2 projections. (They’re different colors simply due to technical problems making them the same.) The black curve on the lefthand picture is the curve that we’re going to use for our line integral (we called it C in the derivation section). It’s a quarter of a circle. The diagram on the right shows the area we’re trying to calculate as red lines forming a “curtain,” extending from the quarter circle to the blue surface.

The equations that describe this problem are:

    \[f(x,y) = xy \quad \text{(1.2.2.1)} \]

    \[C: \, x=\cos t \quad y=\sin t, \quad 0\leq t \leq \frac{\pi}{2} \quad \text{(1.2.2.2)} \]

    \[ds = \sqrt{\displaystyle \left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2}\,dt \quad \text{(1.2.2.3)} \]

    \begin{align*} A &= \int_{t=0}^{t=\frac{\pi}{2}}  f(x,y)\,ds \\  &=  \int_{t=0}^{t=\frac{\pi}{2}}  xy\,ds \\ &= \int_{t=0}^{t=\frac{\pi}{2}}  \cos t \cdot \sin t \, \, \sqrt{\displaystyle \left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2}\,dt \quad \text{(1.2.2.4)} \end{align*}

    \[ \frac{dx}{dt} = -\sin t  \quad \frac{dy}{dt} = \cos t  \quad \text{(1.2.2.5)}  \]

Therefore:

    \begin{align*}  A &= \int_{t=0}^{t=\frac{\pi}{2}}  \cos t \cdot \sin t \, \, \sqrt{\underbrace{\displaystyle \left(-\sin t\right)^2 + \left(\cos t\right)^2}_{1}}\,dt  \\ &= \int_{t=0}^{t=\frac{\pi}{2}}  \cos t \cdot \sin t\,dt \quad \text{(1.2.2.6)}  \end{align*}

Let:

u=\sin t
du=\cos t\, dt
\sin\left(\displaystyle \frac{\pi}{2}\right) = 1
\sin\left(\displaystyle 0\right) = 0

So:

    \begin{align*}  A &=   \int_{t=0}^{t=\frac{\pi}{2}}  \underbrace{\sin t}_{u} \cdot \underbrace{\cos t\,dt}_{du} \\ &= \int_{u=0}^{u=1} u\,du \\ &= \eval{\displaystyle \frac{1}{2}u^2}_0^1 \\ &= \frac12 - 0 \\ &= \frac12  \quad \quad \quad \quad \text{(1.2.2.7)} \end{align*}

Note that it doesn’t matter in which direction along curve C we take to calculate the line integral. This makes intuitive sense since scalar values at each segment along the curve are the same whether you’re “going” or “coming.” A more formal proof of this (from Khan Academy) can be found here.

I.3 Line Integral of a Vector Field

Line integral of a vector field
Figure 1.3.1

Figure 1.3.1a shows a curve, C, in blue, and a vector field with force vectors of varying directions and magnitude (shown in red). Our goal is to find the work done on a particle traversing the path specified by C. We know from classical physics that work = force x distance. Thus, to find the total work, we divide up C into tiny increments, ds. We find the component of the force field pointing in the direction of ds, given by the dot product (as shown by figure 1.3.1b). Then we sum all the force components at each of the infinitesimal lengths along C. Mathematically, this can be described as follows:

Force vector field: f(x,y)=P(x,y)\hat{i} + Q(x,y)\hat{j} where P and Q are functions of x and y.

Displacement vectors along C: \vec{r}(t) = x(t)\hat{i} + y(t)\hat{j} where a \leq t \leq b.

Total work: W = \int_C dw = \int_C \vec{f} \cdot d\vec{r}

\displaystyle \frac{d\vec{r}}{dt} = x^{\prime}(t)\hat{i} + y^{\prime}(t)\hat{j}

d\vec{r} = x^{\prime}(t)dt\hat{i} + y^{\prime}(t)dt\hat{j}

So,

    \begin{align*} W &= \int_C dw = \int_C \vec{f} \cdot d\vec{r}  \\ &= P(x,y) \cdot x^{\prime}(t)dt + Q(x,y)\cdot y^{\prime}(t)dt \end{align*}

Note that it makes a difference which way one traverses the curve C to make the calculation of the line integral in a vector field. This makes sense since, in contrast to scalar values, vector values have a direction as well as a magnitude. Thus, since we’re pointing in different directions when we take different paths, the angle between f(x,y) and ds at each infinitesimal segment (which determines the dot product) is bound to be different. Furthermore, the line integral in the positive direction along curve C equals the negative of the line integral we get when we traverse curve C in the opposite direction. A formal proof of this, presented in a Khan Academy video, can be found by clicking here.

The exception is if our vector field is the gradient of a scalar field. Such a scalar field is referred to as a potential. The resulting vector field (i.e., the gradient of a potential) is called a conservative field. In this case, the value of a line integral going from point a to point b is independent of the path taken. This is the case for the electric force and gravitational force – both vector fields – that are defined as the gradients of potential energy fields (which are scalar fields). A proof of this can be found at Khan Academy and can be accessed by clicking here. The following is a quick recap of that .

A final point I should make before leaving this section is that if one traverses a closed curve in a conservative field (i.e., a field formed by the gradient of a scalar field), then the value of the line integral obtained as one traverses the closed loop is zero. This fact has ramifications in physics. To see a proof of this, click .

II. Surface Integrals

II.1 Derivation

Our goal in this section is to find the area of a surface in 3D space.

The equation for this surface is:

    \[  \vec{r}(s,t) = x(s,t)\hat{i} + y(s,t)\hat{j} + z(s,t)\hat{k} \quad \text{(2.1.1)}  \]

where the points at the end of \vec{r} are actually what define the surface, as shown in figure 2.1.1.

Points at end of vector define a 3D surface
Figure 2.1.1

    \begin{align*}  \displaystyle \frac{\partial \vec{r} }{\partial s} &= \lim_{\Delta s \rightarrow 0} \displaystyle \frac{\vec{r}(s+\Delta s,t) - \vec{r}(s,t)}{\Delta s} = \displaystyle \frac{\vec{r}(s+ds,t) - \vec{r}(s,t)}{ds}\quad \text{(2.1.2)} \\ &= \lim_{\Delta s \rightarrow 0} \displaystyle \frac{x(s+\Delta s,t) -x(s,t)}{\Delta s}\hat{i}  + \displaystyle \frac{y(s+\Delta s,t) -y(s,t)}{\Delta s}\hat{j}  + \displaystyle \frac{z(s+\Delta s,t) -z(s,t)}{\Delta s}\hat{k} \\ &= \displaystyle \frac{\partial x}{\partial s}\hat{i} +  \displaystyle \frac{\partial y}{\partial s}\hat{j} +  \displaystyle \frac{\partial z}{\partial s}\hat{k} \quad \text{(2.1.3)} \end{align*}

We can do the same for \displaystyle \frac{\partial \vec{r} }{\partial t}, namely:

    \[  \displaystyle \frac{\partial \vec{r} }{\partial s} &= \lim_{\Delta s \rightarrow 0} \displaystyle \frac{\vec{r}(s+\Delta s,t) - \vec{r}(s,t)}{\Delta s} = \displaystyle \frac{\vec{r}(s+ds,t) - \vec{r}(s,t)}{ds}\quad \text{(2.1.4)} \]

From the above, we can come up with the following 2 equations:

    \[ \displaystyle \frac{\partial \vec{r} }{\partial s} ds = \vec{r}(s+ds,t) - \vec{r}(s,t)\quad \text{(2.1.5)}\]

    \[ \displaystyle \frac{\partial \vec{r} }{\partial t} dt = \vec{r}(s,t+dt) - \vec{r}(s,t)\quad \text{(2.1.6)}\]

Parameterized surface area. (a) Graph of parameters (b) 3D graph of surface
Figure 2.1.2

Figure 2.1.2a shows a graph of the parameters s and t. Points on this graph are mapped to the 3D surface shown in figure 2.1.2b. All the point along the green line in figure 2.1.2a map to the wavy green line in figure 2.1.2b. Similarly, the orange line in (a) maps to the wavy orange line in (b); the point (s,t) in (a) maps to \vec{r}(s,t) in (b); the point (s + ds,t) in (a) maps to \vec{r}(s+ds,t) in (b); and so forth.

In figure 2.1.2b, we can see that the small green vector, d\vec{s} is just vector \vec{r}(s,t) subtracted from vector \vec{r}(s+ds,t). But in eq. (2.1.5), we defined this quantity as \displaystyle \frac{\partial \vec{r} }{\partial s} ds.

Likewise, in figure 2.1.2b, the small purple vector, d\vec{t}, is just \vec{r}(s,t) subtracted from vector \vec{r}(s,t+dt). But in eq. (2.1.6), we defined this quantity as \displaystyle \frac{\partial \vec{r} }{\partial t} dt.

Next we take the cross product of the small green and purple vectors. It’s known that, if we draw copies of the green and purple vectors end to tail with the existing green and purple vectors, they form a parallelogram, the area of which forms an infinitesimal area element which we’ll call d\sigma. If we take the sum of all these infinitesimal area segments, we’ll get the total area of the surface (which is what we seek to find). And it turns out that the magnitude of the cross product of the small green and purple vectors equals that area of the infinitesimal area elements. Thus, we have an expression for d\sigma that we can use to calculate the area. Specifically:

    \begin{align*} d\sigma &= \bigg| \displaystyle \frac{\partial \vec{r} }{\partial s} ds  \times   \displaystyle \frac{\partial \vec{r} }{\partial t} dt\bigg| \\ &=  \bigg| \displaystyle \frac{\partial \vec{r} }{\partial s}  \times   \displaystyle \frac{\partial \vec{r} }{\partial t}\bigg|\, ds\,dt \quad \text{(2.1.7)} \end{align*}

The total area of the surface, then, is given by:

    \[  \underset{\Sigma}{\int \int } d\sigma = \bigg| \displaystyle \frac{\partial \vec{r} }{\partial s}  \times   \displaystyle \frac{\partial \vec{r} }{\partial t}\bigg|\, ds\,dt \quad \text{(2.1.8)} \]

where \underset{\Sigma}{\int \int } means “take the integral over the entire surface.”

II.2 Examples

II.2.1 Surface Area of a Sphere

The goal in this example is to obtain the surface area of a sphere by using the surface integral method. Other methods are certainly easier but we use the surface integral method here to prove see how the method works.

We’re trying to find \displaystyle A = \underset{\Sigma}{\int \int } d\sigma for the surface of a sphere as described by x^2 + y^2 + z^2 = r^2.

We parameterize the x, y and z as shown in figure 2.2.1.1.

Diagram of sphere from side and top for calculation of area by surface integral
Figure 2.2.1.1

Figure 2.2.1.1a is a view of the sphere from the side. Figure 2.2.1.1b is a view of the sphere from the top.In (a), the xy plane goes in and out of the screen and is depicted as a thick red line. The sphere is described by 2 angles: 1) s, the angle made with the x-axis in the xy plane and 2) t, the angle made with the x-axis in the xz plane. The radius of the sphere is r. In (b), the purple vector has length r is given by (r\cos s, r\sin s) at t=0 (i.e., along the “equator” of the sphere). However, if we were to take a horizontal cross section of the sphere at other levels, the radius of the resulting circle would be less than r. Specifically, it would be r^{\prime}=r\cos t, as shown in (a). The teal-colored broken circles depict such a “nonequatorial” circle. Finding the vector that specifies a point on the sphere’s surface on such circles helps us write a general expression for any point on the sphere (shown in green in (b)):

    \[  \vec{r}(s,t) =  (r\cos (t) \cos (s))\, \hat{i} + (r\cos(t)\sin(s))\, \hat{j} + (r\sin t)\,  \hat{k} \quad \text{(2.2.1.1)} \]

The partial derivatives of \vec{r} needed to calculate the cross product required to define d\sigma are:

    \[ \frac{\partial \vec{r}}{\partial s} =  (-r\cos (t)\sin (s))\,  \hat{i} +  (r\cos (t)\cos (s))\,  \hat{j} +  0\,\hat{k} \quad \text{(2.2.1.2)}  \]

and

    \[ \frac{\partial \vec{r}}{\partial t} =  (-r\sin (t)\cos (s))\,  \hat{i} +  (r\sin( t)\sin (s))\,  \hat{j} +  (r\cos (t))\,  \hat{k} \quad \text{(2.2.1.3)}  \]

The cross product between these 2 vectors is:

    \begin{align*} \frac{\partial \vec{r}}{\partial s} \times \frac{\partial \vec{r}}{\partial t} &= \begin{vmatrix} i & j & k \\ -r\cos (t)\sin(s) &  r\cos(t)\cos(s)  & 0 \\ -r\sin(t)\cos(s)& r\sin(t)\sin(s) & r\cos(t)\end{vmatrix} \\ \\ &= \begin{bmatrix}   (r^2\cos^2 (t) \cos (s))\,  \hat{i} \\ (r^2\cos^2( t )\sin (s))\,  \hat{j} \\ (r^2 \cos (t) \sin( t) \sin^2 (s )+  r^2 \cos( t) \sin (t) \cos^2 (s))\, \hat{z}  \end{bmatrix} \\ \\ &=  \begin{bmatrix}   (r^2\cos^2 (t) \cos (s))\,  \hat{i} \\ (r^2\cos^2( t )\sin (s))\,  \hat{j} \\ (r^2 \cos (t) \sin( t)[ \sin^2 (s )  + \cos^2 (s)])\, \hat{z}  \end{bmatrix} \\ \\ &= \begin{bmatrix}   (r^2\cos^2 (t) \cos (s))\,  \hat{i} \\ (r^2\cos^2( t )\sin (s))\,  \hat{j} \\ (r^2 \cos (t) \sin( t))\, \hat{z}  \end{bmatrix} \quad \text{(2.2.1.4)}  \end{align*}

Next, we need to find the magnitude of the cross product. The cross product is a vector. To find its magnitude, we take the dot product of the cross product with itself. We get:

    \begin{align*}  \bigg|  \frac{\partial \vec{r}}{\partial s} \times \frac{\partial \vec{r}}{\partial t} \bigg| &= \sqrt{r^4\cos^4(t)\cos^2(s) + r^4\cos^4(t)\sin^2(s) + r^4\cos^2(t)\sin^2(t) } \\ \\ &= \sqrt{r^4[\cos^4(t)(\underbrace{\cos^2(s) + \sin^2(s)}_{1}) + \cos^2(t)\sin^2(t) ]} \\ \\ &= \sqrt{r^4[\cos^4(t) + \cos^2(t)\sin^2(t) ]} \\ \\ &= r^4\cos^(t)(\underbrace{\cos^2(t) + \sin^2(t)}_{1}) \\ \\ &= \sqrt{r^4\cos^2(t)} \\ \\ &= r^2\cos(t) \quad \quad \quad \quad \quad \text{(2.2.1.5)}  \end{align*}

To find the area, we substitute this value into the integral of eq. (2.1.8):

    \begin{align*} A = \underset{\Sigma}{\int \int } d\sigma &= \bigg| \displaystyle \frac{\partial \vec{r} }{\partial s}  \times   \displaystyle \frac{\partial \vec{r} }{\partial t}\bigg|\, ds\,dt \\ \\ &= \underset{\Sigma}{\int \int } r^2\cos(t)\,ds\,dt \\ \\ &= \int_0^{2\pi} ds \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} r^2\cos(t)\,dt  \\ \\ &= 2 \pi r^2 \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \cos(t)\,dt \\ \\ &= 2 \pi r^2 \eval{\sin(t)} _{-\frac{\pi}{2}}^{\frac{\pi}{2}} \\ \\ &=  2 \pi r^2[1-(-1)] \\ \\ &= 4 \pi r^2  \quad \quad \quad \quad \quad \text{(2.2.1.6)}   \end{align*}

which we know is the correct answer.

II.2.2 Surface Integral of a Scalar Field

We can take the surface integral of a scalar field by summing the value of the scalar field at each infinitesimal area element:

    \[ \underset{\Sigma}{\int \int } F\,d\sigma   \quad \text{(2.2.2.1)}   \]

For example, we can find the surface integral of a scalar field y=x^2 over a unit sphere as follows:

    \[  \underset{\Sigma}{\int \int } x^2 d\sigma  \quad \text{(2.2.2.2)}   \]

Our first step is to express our function in terms of our parameters s and t as given in eq. (2.2.1.1):

    \[ x(s,t)  = \cos(t)\cos(s)  \quad \text{(2.2.2.3)}   \]

so

    \[  x^2(s,t) = \cos^2(t)\cos^2(s)  \quad \text{(2.2.2.4)}   \]

We plug this and the value for d\sigma from eq. (2.2.1.5) into eq. (2.2.2.2), remembering that, since we’re dealing with a unit sphere, r=1:

    \begin{align*}  \underset{\Sigma}{\int \int } x^2\,d\sigma &=  \cos^2(t)\cos^2(s)\, (1)^2\cos(t) \,ds\,dt  \\ \\ &= \int_0^{2\pi} \cos^2(s)\,ds \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \cos^3\,dt  \quad \text{(2.2.2.5)}   \end{align*}

We’ll solve each integral separately then put them back together.

    \[\int_0^{2\pi} \cos^2(s)\,ds\]

We use the trig identity:

    \[ \cos^(s) = \frac12 + \frac12 \cos(2s) \]

Our integral becomes:

    \[  \frac12 \int_0^{2\pi} ds +  \int_0^{2\pi}  \cos(2s)\,ds \]

    \[  \eval{\frac12s}_0^{2\pi} +  \eval{\frac14\sin(2s)}_0^{2\pi} = \pi + 0 = \pi\]

    \[  \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \cos^3\,dt \]

    \begin{align*}  \cos^3(t) &= \cos^2(t)\cos(t) \\ &= (1 - \sin^2(t))\cos(t) \\ &= \cos(t) - \cos(t)\sin^2(t) \end{align*}

Let

    \begin{align*}  u &= \sin(t) \\ du &= \cos(t)\,dt \\ dt &= \frac{du}{\cos(t)}  \end{align*}

So we have:

    \[  \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} [\cos(t) - \cos(t)\sin^2(t)]\,dt \]

    \[ \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \cos(t)\,dt -  \int_{-1}^1 u^2\,\cancel{\cos(t)}\cdot\frac{du}{\cancel{\cos(t)}}   \]

    \[\eval{\sin(t)}_{-\frac{\pi}{2}}^{\frac{\pi}{2}} - \eval{\frac{u^3}{3}}_{-1}^1\]

    \[  [1-(-1)] - [\frac13 -(-\frac13)] = 2-\frac23 = \frac43 \]

Thus,

    \begin{align*}  \underset{\Sigma}{\int \int } x^2\,d\sigma &= \int_0^{2\pi} \cos^2(s)\,ds \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \cos^3\,dt \\ &= \pi\cdot\frac43 \end{align*}

III. 3D Flux

III.1 Derivation

Say we have a vector field that represents flowing fluid. The density of the fluid (which is a scalar) is a function of space: \rho(x,y,z). The velocity of the fluid (which is a vector) is also a function of space: \vec{v}(x,y,z). They make up a function, \vec{F} where:

    \[ \vec{F} = \rho\vec{v} \quad \text{(3.1.1)}  \]

Our goal is to determine the mass of fluid per unit time (i.e. flux) that flows through a surface S per unit time. For convenience, we’ll use the same surface as we used in figure 2.1.2. As you may recall, that surface was parameterized by variables s and t.

Parameterized surface area. (a) Graph of parameters (b) 3D graph of surface
Figure 2.1.2

The strategy for finding the flux is divide up our surface into infinitesimal surface area elements, find the flux through each elements and add up all these fluxes. That should give us the total flux.

Notice the units of \vec{F}: \rho \cdot \vec{v}\,\, \Rightarrow \displaystyle \frac{M}{L^3}\cdot\frac{L}{T}\,\rightarrow\,\displaystyle \frac{M}{T}\cdot\displaystyle \frac{1}{L^2}

where

M = mass
L = length
T = time

From this, we can see that if we multiply \vec{F} by an entity with units of L^2, we will get an answer with units \displaystyle \frac{M}{T}, which is what we want. Of course, area has units of L^2. Thus, it makes sense that we might multiply \vec{F} at each infinitesimal surface element by the area of that element and take their sum (i.e., take their integral). But there’s one more piece of the puzzle. The fluid is flowing in all directions. To get a proper answer, for each infinitesimal element we’re summing, we need to consider only the components of \vec{F} that are perpendicular (normal) to our surface elements.

Diagram of dot product of vector with normal vector times surface area, to be used in flux calculation.
Figure 3.1.1

To do this, we can take the dot product of \vec{F} with a unit vector perpendicular to our surface at each infinitesimal element, multiply this quantity by the infinitesimal area at that site and sum up all the infinitesimal elements (i.e., take their integral). Thus, the expression we need to evaluate to find the total flux through the surface is:

    \[ \text{Flux} = \underset{S}{\int \int } \vec{F}\cdot\hat{n}\cdot dS \quad \text{(3.1.2)}  \]

where

\vec{F} is the vector field defined above
dS is an infinitesimal surface element (a scalar)
\hat{n} is the unit vector perpendicular to dS

The trick now is to find \hat{n}. In our derivation of the surface integral, we noted that the infinitesimal area element is given by eq. (2.1.7):

    \begin{align*} d\sigma &= \bigg| \displaystyle \frac{\partial \vec{r} }{\partial s} ds  \times   \displaystyle \frac{\partial \vec{r} }{\partial t} dt\bigg| \\ &=  \bigg| \displaystyle \frac{\partial \vec{r} }{\partial s}  \times   \displaystyle \frac{\partial \vec{r} }{\partial t}\bigg|\, ds\,dt \quad \text{(2.1.7)} \end{align*}

The vectors that make up this cross product are tangent to our surface, S. We noted previously that the infinitesimal parallelogram formed by the vectors that make up the cross product and vectors parallel to them laid end to tail with them constitutes a tiny area element. What I want to stress here, however, is that the vectors that make up the cross product form a vector that points in a direction perpendicular to the infinitesimal parallelogram. Thus, the cross product constitutes a vector normal to our surface. Its magnitude, however, is equal to the parallelogram’s area, which isn’t necessarily 1 (i.e., it’s not necessarily a unit vector). To make it the unit normal vector we seek (i.e., a normal vector with a magnitude of 1), we need to divide the this vector by the magnitude of the cross product. Thus, we have:

    \[ \hat{n} =  \displaystyle \frac{\displaystyle \frac{\partial \vec{r} }{\partial s}  \times   \displaystyle \frac{\partial \vec{r} }{\partial t}}{\bigg| \displaystyle \frac{\partial \vec{r} }{\partial s}  \times   \displaystyle \frac{\partial \vec{r} }{\partial t}\bigg|} \quad \text{(3.1.3)}  \]

What we called d\sigma in our derivation of the surface integral is represented by dS is our current problem. Therefore, our integral for the total flux becomes:

    \begin{align*} \text{Flux} &= \underset{S}{\int \int } \vec{F}\cdot \hat{n}\cdot dS \\ &= \underset{S}{\int \int } \vec{F}\cdot\displaystyle \frac{\displaystyle \frac{\partial \vec{r} }{\partial s} \times \displaystyle \frac{\partial \vec{r} }{\partial t}}{\cancel{\bigg| \displaystyle \frac{\partial \vec{r} }{\partial s} \times \displaystyle \frac{\partial \vec{r} }{\partial t}\bigg|}}\cdot \cancel{\bigg| \displaystyle \frac{\partial \vec{r} }{\partial s}  \times   \displaystyle \frac{\partial \vec{r} }{\partial t}\bigg|}\, ds\,dt \\ \\ &= \underset{S}{\int \int } \vec{F}\cdot \left(\displaystyle \frac{\partial \vec{r} }{\partial s}  \times   \displaystyle \frac{\partial \vec{r} }{\partial t}\right)\, ds\,dt  \quad \text{(3.1.4)}  \end{align*}

The flux integral is sometimes written as:

    \[ \text{Flux} &= \underset{S}{\int \int } \vec{F}\cdot d\vec{S}  \quad \text{(3.1.4)}  \]

The rationale for this is as follows:

    \begin{align*} \left(\displaystyle \frac{\partial \vec{r} }{\partial s}  \times   \displaystyle \frac{\partial \vec{r} }{\partial t}\right)\, ds\,dt &= \left(\displaystyle \frac{\partial \vec{r} }{\cancel{\partial s}}\,\cancel{ds}\right) \times  \left(\displaystyle \frac{\partial \vec{r} }{\cancel{\partial t}}\,\cancel{dt }\right) \\ &= \partial\vec{r} \times \partial\vec{r} \\ &= d\vec{S} \end{align*}

As Sal Khan points out in the video from which this derivation was taken, the math in this last step (canceling differential elements) is a bit “loosey-goosey.” However, it helps convey the intuition of why we can write things in this way. The vectors \partial\vec{r} with which we create the cross product are what we called \vec{r}(s+ds,t) - \vec{r}(s,t) and \vec{r}(s,t+dt) - \vec{r}(s,t) in our previous derivation. The magnitude of this cross product equals dS, the scalar that appears in eq. 3.1.2. The cross product vector, itself, points in the direction normal to our surface.

In the end, what we’re saying here is, just as \vec{V} – a vector with, say magnitude 5 pointing in the x-direction equals 5\hat{e_x}:

    \[  d\vec{S} = \hat{n}\,dS  \quad \text{(3.1.5)} \]

III.2 Example

An example of a 3D flux problem can be found at Khan Academy.

IV. Green’s Theorem

IV.1 Derivation

In figure 4.1.1, we take 1) a closed curve, C (pink and blue), and 2) a vector field \vec{f} = P(x,y) (red arrows) that only points in the + or – x direction. We want to take the sum of \vec{f} \cdot d\vec{r} around the circumference of C.

Green's theorem with vector field only in x direction
Figure 4.1.1

    \[ \vec{P} = P(x,y)\hat{i} \quad \text{(4.1.1)} \]

    \[  d\vec{r} = dx\,\,\hat{i} + dy\,\,\hat{j} \quad \text{(4.1.2)}  \]

    \begin{align*}  \oint_C \vec{P} \cdot d\vec{r} &= \oint P(x,y)\,dx \\ \\ &= \underbrace{\int_a^b P(x,y_1(x))\,dx}_{C_1} + \underbrace{\int_b^a P(x,y_2(x))\,dx}_{C_2} \\ \\ &= \int_a^b \left[P(x,y_1(x))  -P(x,y_2(x)) \right]\,dx  \\ \\ &= -\int_a^b \left[P(x,y_2(x))\,dx - P(x,y_1(x)) \right]\,dx  \\ \\ &= -\int_a^b \underbrace{\eval{P(x,y)}_{y=y_1(x)}^{y=y_2(x)}}\,\,dx \\ \\ &= -\int_a^b \underbrace{\int_{y=y_1(x)}^{y=y_2(x)}\displaystyle \frac{\partial P}{\partial y}\,dy} \,\,dx \quad \text{(4.1.3)}  \end{align*}

Next, we take the same closed curve, C, but this time, consider a vector field, \vec{f} = Q(x,y) where \vec{f} only points in the + or – y direction. Again, we take \vec{f} \cdot d\vec{r} at each point around C and add them up (i.e., integrate them). We have:

Green's theorem with vector field only in y direction
Figure 4.1.2

    \[ \vec{Q} = Q(x,y)\hat{j}  \quad \text{(4.1.4)}  \]

    \[  d\vec{r} = dx\,\,\hat{i} + dy\,\,\hat{j}  \quad \text{(4.1.5)} \]

    \begin{align*}  \oint_C \vec{Q} \cdot d\vec{r} &= \oint Q(x,y)\,dy \\ \\ &= \underbrace{\int_a^b Q(x_1(y),y)\,dy}_{C_1} + \underbrace{\int_b^a Q(x_2(y),y)\,dy}_{C_2} \\ \\ &= \int_a^b \left[Q(x_1(y),y)  -Q(x_2(y),y) \right]\,dy  \\ \\ &= \int_a^b \left[Q(x_1(y),y)\,dy - Q(x_2(y),y) \right]\,dy  \\ \\ &= \int_a^b \underbrace{\eval{Q(x,y)}_{x=x_2(y)}^{x=x_1(y)}}\,\,dy \\ \\ &= \int_a^b \underbrace{\int_{x=x_2(y)}^{x=x_1(x)}\displaystyle \frac{\partial Q}{\partial y}\,dx} \,\,dy  \quad \text{(4.1.6)} \end{align*}

Now suppose we have the same closed curve, C, but our vector field points in all directions in the xy plane. We can put together the results we got it the first 2 parts of this derivation to obtain:

    \[ \vec{f}(x,y) = P(x,y) \,\, \hat{i} + P(x,y) \,\, \hat{i} \quad \text{(4.1.7)}   \]

    \[ d\vec{r} = dx\,\,\hat{i} + dy\,\,\hat{j}  \quad \text{(4.1.8)}  \]

    \begin{align*} \oint_C \vec{f} \cdot d\vec{r} &= \oint_C P(x,y)\,dx +  Q(x,y)\,dy \\ \\ &= \oint_C P(x,y)\,dx + \oint_C Q(x,y)\,dy \\ \\ &= \underset{R}{\int \int } \displaystyle -\frac{\partial P}{\partial y}\,dA + \frac{\partial Q}{\partial x}\,dA \\ \\ &= \underset{R}{\int \int } \left(\displaystyle \frac{\partial Q}{\partial x} -\displaystyle\frac{\partial P}{\partial y}\right)\,dA \quad \text{(4.1.9)}  \end{align*}

Eq. (4.1.9) is a statement of Green’s theorem.

You may recognize \displaystyle \frac{\partial Q}{\partial x} -\displaystyle\frac{\partial P}{\partial y} as the curl of \vec{f}. Thus, Green’s theorem can be interpreted as saying the tendency of a vector field to rotate along curve C is equivalent to the tendency of the vector field to rotate within the area enclosed by C.

Note that, to apply Green’s theorem, we have to have a piecewise smooth, simple, closed curve. If we traverse our curve in the clockwise direction, this is called a positively-oriented curve and we use the integrals we found in this derivation. If we traverse the curve in a clockwise direction, this is called a negatively-oriented curve and we have to take the negative of the integrals we derived.

IV.2 Examples

An example of the application of Green’s theorem can be found at Khan Academy by clicking here.

V. 2D Divergence Theorem

2D Divergence Theorem
Figure 5.1

We can think of the divergence theorem as a 2D flux problem, although as we’ll see, when we apply Green’s theorem, we add an extra wrinkle.

In figure 5.1, we have a piecewise smooth, simple, positively-oriented, closed curve (shown in blue) and a vector field shown in light red. Similar to our 3D flux problem, let’s suppose our vector field represents a density of a fluid times a velocity:

    \begin{align*} \vec{F}(x,y) &= \underbrace{\rho(x,y)}_{\text{mass/area }\frac{kg}{m^2}}\cdot \underbrace{(M(x,y)\,\hat{i} + N(x,y)\,\hat{j})}_{\text{velocity }\frac{m}{s}} \\ &= \rho M \hat{i} + \rho N \hat{j}  \\ &= P((x,y)\,\hat{i} + Q((x,y)\,\hat{j} \quad \text{(5.1)}  \end{align*}

We can get our outward flux with the integral:

    \[ \oint_C \vec{F} \cdot \hat{n}\,ds  \quad \text{(5.2)} \]

We can write our unit normal vector as:

    \[ \hat{n} = \frac{dy\,\hat{i} - dx\,\hat{j}}{ds}  \quad \text{(5.3)} \]

To see how we get this, click .

Substituting eq. (5.3) into eq. (5.2), we get:

    \begin{align*}  D &= \oint_C  \vec{F} \cdot  \frac{dy\,\hat{i} - dx\,\hat{j}}{\cancel{ds}}\,\cancel{ds} \\ &= \oint_C (P((x,y)\,\hat{i} + Q((x,y)\,\hat{j}) \cdot (dy\,\hat{i} - dx\,\hat{j}) \\ &= \oint_C P((x,y)\,dy - Q((x,y)\,dx   \quad \text{(5.4)} \end{align*}

Now we apply Green’s theorem:

    \begin{align*} D &=  \oint_C P((x,y)\,dy - Q((x,y)\,dx = \underset{R}{\int \int } \left[\frac{\partial P}{\partial x} -(-\frac{\partial Q}{\partial y})\right] dA \\ &= \underset{R}{\int \int } \left[\underbrace{\frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y}}_{\nabla \cdot \vec{F}}\right] dA \\ &=  \underset{R}{\int \int } \text{div } \vec{F}\,dA  \quad \text{(5.5)} \end{align*}

where div \vec{F} is the divergence of \vec{F}.

Eq. (5) is a statement of the 2D divergence theorem.

VI. Stokes’ Theorem

VI.1 Intuition

This section on the intuition for Stokes’ theorem is taken from:

https://www.lehman.edu/faculty/anchordoqui/VC-4.pdf

Definition of Curl
Figure 6.1.1

In figure 6.1.1, we have an infinitesimal area element, enclosed by a contour, dC, with sides given by \vec{dx} and \vec{dy} (thick arrows), in a vector field \vec{a}(x,y,z). The red vectors represent the components of of the vector field tangent to the contour enclosing the infinitesimal area element. The fields in the x direction, respectively, at the bottom and top are:

    \[  a_x(x,y,z) \quad \text{and} \quad a_x(x,y+dy,z) = a_x(x,y,z) + \frac{\partial a_x}{\partial y}dy \quad \text{(6.1.1)} \]

The fields in the y direction, respectively, on the left and right are:

    \[  a_y(x,y,z) \quad \text{and} \quad a_y(x,y+dy,z) = a_y(x,y,z) + \frac{\partial a_y}{\partial x}dx \quad \text{(6.1.2)} \]

We traverse our contour in the counterclockwise direction from the left bottom. We want to find the total amount of the field pointing in the direction in which we’re traversing the counter, that direction representing a circulating or “curling” motion. To do this, we take the dot product of our vector field at each small segment as we traverse the contour since this gives us the component of the field in the direction of our motion.

Since the length of each segment is small, we assume that the field is constant over that segment. The 4 segments of dC are as follows, where the minus sign correlates with segments in which we move in the -x and -y directions:

    \begin{align*} dC &=  +[a_x\,dx] +[a_y(x+dx,y,z)dy)\,dx] - [a_x(x,y+dy,z)\,dx] - [a_y\,dy] \\ &=  +[a_x\,dx] +\left[\left( a_y + \frac{\partial a_y}{\partial x}dx  \right)dy\right] - \left[\left(  a_x +  \frac{\partial a_x}{\partial y}dy  \right)dx\right] - [a_y\,dy] \\ &=  \cancel{a_x\,dx} + \cancel{a_y\,dy} + \frac{\partial a_y}{\partial x}dx \,dy -\cancel{a_x\,dx} - \frac{\partial a_x}{\partial y}dy\,dx - \cancel{a_y\,dy} \\ &= \left( \frac{\partial a_y}{\partial x} - \frac{\partial a_x}{\partial y}  \right)\,dx\,dy \\ &= (\nabla \times \vec{a})\cdot d\vec{s}  \quad \quad \quad \text{(6.1.3)}  \end{align*}

where

d\vec{s} = dxd\,\hat{k}

So dC represents the how much our vector field circulates (or curls) around the curve enclosing any tiny surface. We recognize \frac{\partial a_y}{\partial x} - \frac{\partial a_x}{\partial y} as the curl of \vec{a}:

\displaystyle \frac{\partial a_y}{\partial x} - \frac{\partial a_x}{\partial y} = \nabla \times \vec{a} \quad \text{(6.1.4)}

which we can think of as the tendency of a vector field to circulate or curl per unit area. In fact, the curl has been defined as the amount of circulation of a vector field around a closed curve as the area enclosed by the curve decreases toward 0 (i.e., shrinks down to a point). Mathematically, this is written as:

    \[  \frac{1}{A(c)} = \int_C \vec{F} \cdot d\vec{s}  \quad \text{(6.1.5)}  \]

At any rate, consider – as shown if figure 6.1.2 – what happens if we add up the circulation (or curl) in all the small surface elements that make up a surface, S.

Stokes Theorem: Elements of curl inside an area cancel while elements of curl along the curve that encloses the area add up.
Figure 6.1.2

What happens is that the “internal” elements of curl (depicted in light gray) cancel each other while the elements tangent to the curve enclosing the surface add up.

We know that the total tendency to circulate (or curl) along a closed curve is given by:

    \[  \int_C \vec{F} \cdot d\vec{S}  \quad \text{(6.1.6)}  \]

But from the figure 6.1.2, it appears that the sum of the tendency to circulate (i.e. curl) within all the tiny area elements dS making up a surface S is equivalent to the tendency to circulate along the enclosing curve:

    \[  \int_C \vec{F} \cdot d\vec{s} = \underset{S}{\int \int } (\nabla \times \vec{F}) \cdot d\vec{s}  \quad \text{(6.1.7)}  \]

Eq. (6.1.7) is Stokes’ theorem. We’ll prove it by equating the left and right sides of this equation in the next section.

Before we leave this discussion, you might be wondering, What’s the difference between Stokes’ theorem and Green’s theorem? In fact, as shown in figure 6.1.3, Stokes’ theorem is the 3D generalization of Green’s theorem.

Stokes theorem is the 3D generalization of Green's theorem.
Figure 6.1.3

Or stated differently, Green’s theorem is a special case of Stoke’s theorem. As can be seen in the diagram, both the blue region R in figure 6.1.3a, and the blue surface in figure 6.1.3b are areas; areas that, in both theorems, are determined by taking double integrals; areas that, in both theorems, are then equated to the line integral around the curve enclosing them. The difference is that, in Green’s theorem, the area is “flat” (i.e., confined to the xy plane) while in Stokes’ theorem, the surface can be “curved above or below the xy plane” (i.e. extended to 3D).

VI.2 Proof

Now that we’ve got some intuition about Stoke’s theorem, we’ll prove it – as mentioned above – by proving that the two sides of eq. (6.1.7) are equal.

We start with a parameterized surface, S, (a unit hemisphere with z > 0) as shown in figure 6.2.1.

Hemisphere for proof of Stoke's Theorem
figure 6.2.1

We traverse the closed curve , C, of which we will take our line integral in the counterclockwise direction. That means, by the righthand rule, our normal vector, \hat{n}, (the direction of our curl vector) will point outward*.

*Another way to determine the direction of the normal vector is to image walking around our closed curve. When our left arm is on the side facing the inside of our surface, our head points in the direction of the normal vector. In figure 6.2.1, as we traverse our closed curve in the counterclockwise direction, our left arm is on the side of the interior of our surface and our head – the direction of our normal vector – points in the direction of the z-axis. We can think of the normal vector depicted in figure 6.2.1 as the result of translating that normal vector from the top of the hemisphere to the position where it’s shown, maintaining normality of the vector along the way.

A third way to determine the direction of the normal vector with respect to how we’re traversing our closed curve is to imagine twisting a bottle cap. The direction of twisting is analogous to the direction we’re traversing our closed curve. The result of that twist is the direction of the normal vector (e.g. twist counterclockwise with the bottle pointing up and the bottle cap moves upward, which is the direction of the normal vector; twist rightward and the cap moves down which, again, is the normal vector direction).

I’ve gone into detail about how to relate direction of traversing our curve and our normal vector because getting these directions right is CRITICAL.

The vector field we’re considering is:

    \[\vec{F} = 2z\,\hat{i} + x\,\hat{j} + y\,\hat{z}  \quad \text{(6.2.1)} \]

The choice of our vector field and surface are completely arbitrary, thus the results of this proof should apply to any vector field and surface. We could have defined our vector field and surface with just abstract symbols but using concrete values makes visualization easier.

We’ll compute our line integral first. To do that, we need to parameterize our curve, which is the base of the sphere – a unit circle. We can parameterize it as:

x=\cos t
y=\sin t
z=0

dx=-\sin t\,dt
dy=\cos t\,dt
dz=0

    \[ 0 \leq t \leq 2\pi \]

    \[ dr = -\sin t\,\hat{i} + \cos t\,\hat{j} + 0 \quad \text{(6.2.2)}  \]

To perform our line integral, we take the dot product of \vec{F} with dr. We have:

    \begin{align*} \oint_C \vec{F} \cdot d\vec{r} &= \oint_C (2z)dx + x\,dy + y\,dz \\ &= (0)dx + x\,dy + y(0) \\ &= \oint_C \cos t \cdot \cos t \\ &= \oint_0^{2\pi}  \cos^2 t\,dt  \quad \text{(6.2.3)} \end{align*}

We use substitute the trig identity:

    \[ \cos^2 t = \frac12 + \frac{\cos2t}{2} \]

into eq. (6.2.3) to get:

    \begin{align*} \oint_0^{2\pi} \left( \frac12 + \frac{\cos2t}{2} \right)\,dt  &= \eval{\left( \frac12t + \frac{\sin 2t}{4} \right)}_0^{2\pi} \\ &=  (\pi - 0) - (0 - 0) \\ &= \pi \end{align*}

Next, we turn our attention to solving the surface integral. Our formula is:

    \[  \underset{S}{\int \int } \nabla \vec{F} \cdot \hat{n} \, dS \quad \text{(6.2.3)}  \]

    \[ \nabla \vec{F} = \begin{vmatrix}  i & j & k \\ \frac{\partial}{\partial x}  &\frac{\partial}{\partial y} &\frac{\partial}{\partial z} \\ 2z & x & y \end{vmatrix} &= \begin{pmatrix}  \frac{\partial}{\partial y}\,dy - \frac{\partial}{\partial z} \, x \\ -\left( \frac{\partial}{\partial x} \ y - \frac{\partial}{\partial z}\,2z\right) \\ \frac{\partial}{\partial x} \, x - \frac{\partial}{\partial y} \, z \end{pmatrix} = \begin{pmatrix}   1 \\ 2 \\ 1\end{pmatrix} =<1,2,1>  \quad \text{(6.2.4)}  \]

Now we turn our attention to finding our unit normal vector. In general, a unit normal vector can be found by taking the gradient of the function that specifies our surface and dividing by the length of vector that results from this operation.

    \[ \hat{n} = \displaystyle \frac{\nabla \cdot F(x,y,z)}{\lvert  \nabla \cdot F(x,y,z) \rvert} \quad \text{(6.2.5)}  \]

The function describing our surface is:

    \[ F(x,y,z) = x^2 + y^2 + z^2  \quad \text{(6.2.6)}  \]

So:

    \[  \nabla \cdot F(x,y,z) = (\displaystyle \frac{\partial x^2}{\partial x}\hat{i} + \displaystyle \frac{\partial y^2}{\partial y}\hat{j} + \displaystyle \frac{\partial z^2}{\partial z,}\hat{k} =  <2x,2y,2z>  \quad \text{(6.2.7)} \]

The magnitude of this normal vector is:

    \begin{align*}  \lvert <2x,2y,2z>  \rvert  &= \sqrt{(2x)^2 + (2y)^2 + (2z)^2 } \\ &= \sqrt{4(x^2 + y^2 + z^2)} \\ &= \sqrt{4(1)} \\ &= 2  \quad \quad \quad \quad \text{(6.2.8)} \end{align*}

Therefore, our unit normal vector is:

    \[ \hat{n} = \frac{<2x,2y,2z>}{2} = <x,y,z>  \quad \text{(6.2.9)} \]

Finally, we need to determine dS. We know the line element for a sphere is:

    \[  dr^2 + r^2\,d\theta^2 + r^2\sin^2\, d\phi^2  \quad \text{(6.2.10)} \]

r is constant so dr=0. The sides of the infinitesimal entities that make up infinitesimal area elements on the sphere’s surface are thus \sqrt{r^2\,d\theta^2 } and \sqrt{r^2\sin^2\, d\phi^2}. Therefore, the infinitesimal area element on the surface of a sphere is:

    \[  \sqrt{r^2\,d\theta^2 }\cdot\sqrt{r^2\sin^2\, d\phi^2}  = r^2\, d\theta \,  \sin^2\, d\phi \quad \text{(6.2.11)}  \]

But we’re dealing with a unit hemisphere where r=1. Therefore:

    \[  dS = \sin^2\, d\theta \, d\phi \quad \text{(6.2.12)}  \]

Recapping:

\nabla \vec{F} = <1,2,1>
\hat{n} = <x,y,z>
dS = \sin\theta\, d\theta \, d\phi

We need to convert x, y and z to polar coordinates. The conversions are:

x=\sin \theta \cos \phi
x=\sin \theta \sin \phi
z=\cos \theta

0 \leq \theta \leq \displaystyle \frac{\pi}{2}
0 \leq \phi \leq 2\pi

Putting this all together, we have:

    \begin{align*} \underset{S}{\int \int } \nabla \vec{F} \cdot \hat{n} \, dS &= \int_0^{2\pi} \int _0^{\frac{\pi}{2}}  (x + 2y + z)\sin\theta\, d\theta \, d\phi \\ &=  \int_0^{2\pi} \int _0^{\frac{\pi}{2}} (\sin \theta \cos \phi + 2\sin \theta \sin \phi + \cos \theta) \sin\theta\, d\theta \, d\phi \\ &=  \int_0^{2\pi} \int _0^{\frac{\pi}{2}} \sin^2 \theta \cos \phi \, d\theta \, d\phi + \int_0^{2\pi} \int _0^{\frac{\pi}{2}} 2\sin^2 \theta \sin \phi \, d\theta \, d\phi  + \int_0^{2\pi} \int _0^{\frac{\pi}{2}} \sin \theta \cos \theta \, d\theta \, d\phi \\ &=  \int _0^{\frac{\pi}{2}} \sin^2 \theta \, d\theta \underbrace{\int_0^{2\pi}\cos \phi \, d\phi }_{0} + \int _0^{\frac{\pi}{2}} \sin^2 \theta \, d\theta \underbrace{\int_0^{2\pi}\sin \phi \, d\phi }_{0} +  \int_0^{2\pi} \int _0^{\frac{\pi}{2}} \sin \theta \cos \theta \, d\theta \, d\phi  \\ &= \int_0^{2\pi} \int _0^{\frac{\pi}{2}} \sin \theta \cos \theta \, d\theta \, d\phi   \end{align*}

Let u = \sin \theta \,\, \Rightarrow \,\, du = \cos \theta \, d\theta \,\, \Rightarrow \,\, d\theta = \displaystyle \frac{du}{\cos \theta}

    \begin{align*} \underset{S}{\int \int } \nabla \vec{F} \cdot \hat{n} \, dS &= \int_0^{2\pi} \int _0^{\frac{\pi}{2}} u\,\, \cancel{\cos \theta} \, \displaystyle \frac{du}{\cancel{\cos \theta}} \, d\phi \\  &=  \int_0^{2\pi} \eval{\displaystyle \frac{u^2 }{2}}_0^{\frac{\pi}{2}} \, d\phi\\ &= \int_0^{2\pi} \eval{\displaystyle \frac{\sin^2 \theta}{2}}_0^{\frac{\pi}{2}} \\ &= \int_0^{2\pi} \left( \frac12 - 0  \right)] \, d\phi \\ &= \frac12 \int_0^{2\pi}  \, d\phi \\ &= \eval{\frac12 \phi}_0^{2\pi} \\ &= \frac{1}{\cancel{2}} \cdot \cancel{2}\pi \displaystyle   - 0 \\ &= \pi\end{align*}

From this, we can see that calculation of our line integral and surface integral yield the same value: \pi. Therefore, since our choice of vector field and surface were chosen arbitrarily, we’ve proven what we set out to prove and our results are generally applicable.

VII. 3D Divergence Theorem

VII.1 Intuition

2D vs 3D Divergence theorem
Figure 7.1.1

We’ve already seen the 2D version of the divergence theorem: it states that the flux of a vector field across a curve enclosing an area R is equal to the sum of all the divergences in that area.

The 3D divergence theorem states that the flux across a surface S that encloses a volume V is equivalent to the sum of the divergences within that volume.

VII.2 Proof

Figure 7.1.1 shows the equation for the 3D divergence theorem. I’ll reproduce it here:

    \[ \underset{S}{\int \int } (\vec{F}\cdot \hat{n})\,ds = \underset{V}{\int \int \int}\text{div }\vec{F}\,dV  \quad \text{(7.2.1)} \]

Our strategy will be similar to our proof of the 3D Stokes theorem: we’ll show that each side of the equation produces the same result. The 3D volume we’ll consider is a simple solid region – loosely, a shape that is symmetric about the x and/or y and/or z axis; or more formally, a Type III, II or I 3D object. (An explanation of 3D object types can be found at Khan Academy.)

For our proof, we let \vec{F} be a vector field defined as:

    \[  \vec{F} = P\hat{i} + Q\hat{j} +  R\hat{k}  \quad \text{(7.2.2)}   \]

Then

    \[  \vec{F} \cdot  \hat{n} = P(\hat{i} \cdot \hat{n}) + Q(\hat{j} \cdot \hat{n}) +  R(\hat{k} \cdot \hat{n})  \quad \text{(7.2.3)}  \]

where, for example, P(\hat{i} \cdot \hat{n}) gives us the component of \vec{F} in the x direction.

Using this, we can re-write the lefthand side of eq. (7.2.1) as:

    \begin{align*}  \underset{S}{\int \int } (\vec{F}\cdot \hat{n})\,ds  &= \underset{S}{\int \int }  (P(\hat{i} \cdot \hat{n}) + Q(\hat{j} \cdot \hat{n}) +  R(\hat{k} \cdot \hat{n})) \,ds \\ &=  \underset{S}{\int \int }  (P(\hat{i} \cdot \hat{n})\,ds +  \underset{S}{\int \int } (Q(\hat{j} \cdot \hat{n})\,ds +\underset{S}{\int \int } (R(\hat{k} \cdot \hat{n})\,ds \\ &  \quad \text{(7.2.4)}  \end{align*}

Turning now to the righthand side of eq. (7.2.1), we can write the divergence of \vec{F} as:

    \[  \text{div }\vec{F} = \nabla \cdot  \vec{F} = P_x + Q_y + P_z  \quad \text{(7.2.5)} \]

where, for example, P_x = \displaystyle \frac{\partial P}{\partial x}

Substituting eq. (7.2.5) into the left side of eq. (7.2.1), we have:

    \begin{align*}  \underset{V}{\int \int \int}\text{div }\vec{F}\,dV &= \underset{V}{\int \int \int}\text{div }\vec{F}(P_x + Q_y + P_z)\,dV \quad \text{(7.2.6)} \\ &= \underset{V}{\int \int \int} P_x\,dV +  \underset{V}{\int \int \int} Q_y\,dV +  \underset{V}{\int \int \int} R_z\,dV \quad \text{(7.2.6)}  \end{align*}

Now we equate eq. (7.2.4) and eq. (7.2.6), as shown in figure 7.2.1.

3D divergence theorem proof; 3 expressions to equate
Figure 7.2.1

Specifically, we’ll show that the terms enclosed by the blue dotted lines are equivalent. By the same arguments, the terms in red and green can then be equated (although we won’t show those calculations here). The equivalence of all three parts of the equation shown in figure 7.2.1, then, constitutes proof of the 3D divergence theorem. Note that the Type I, Type II and Type III in figure 7.2.1 refer to the type of simple solid 3D object the mathematical objects written in the same color, represent.

Type I Solid
Figure

Figure 7.2.2 represents a generic Type I simple solid. We can break it into 3 surfaces: S_1, S_2 and S_3. And we can break down the integrals that describe this shape into 3 parts as well. We’ll start with the double integral:

    \begin{align*}  \underset{S}{\int \int } (R(\hat{k} \cdot \hat{n})\,ds &= \underset{S_2}{\int \int } (R(\hat{k} \cdot \hat{n})\,ds + \underset{S_1}{\int \int } (R(\hat{k} \cdot \hat{n})\,ds \\ & +\underbrace{\cancel{\underset{S_3}{\int \int } (R(\hat{k} \cdot \hat{n})\,ds}}_{\hat{k}\cdot\hat{n}=0}  \quad \quad \text{(7.2.7)} \end{align*}

Our unit normal vectors point outward. The unit vector of S_3 is perpendicular to \hat{k}. Therefore, the dot product \hat{k}\cdot\hat{n}=0 and the S_3 integral disappears.

Now we turn our attention to solving the other 2 integrals. We start with the S_2 integral. We begin by parameterizing S_2:

    \begin{align*}  S_2:\, \vec{t}(x,y) &= x\hat{i} + y\hat{j} +  f_2(x,y)\hat{k} \quad \text{ for } (x,y) \in D  \quad \text{(7.2.8)} \end{align*}

Recalling eq. (3.1.4), we have:

    \begin{align*}  (\hat{k} \cdot \hat{n})\,ds &= \hat{k} \cdot (\vec{t}_x \times  \vec{t}_y)\,dA  \\ &= \hat{k} \cdot \begin{vmatrix}  \hat{i} & \hat{j} &  \hat{k} \\ 1 & 0 & \frac{\partial f_2}{\partial x} \\ 0 & 1 & \frac{\partial f_2}{\partial y} \end{bmatrix}\,dA \\ &=  \hat{k} \cdot \left[ (\cdots) \hat{i} + (\cdots) \hat{j} + (1) \hat{k}  \right]\, dA \\ &= dA   \quad \text{(7.2.8)} \end{align*}

*I represented the expressions multiplying \hat{i} and \hat{j} with (\cdots) because it doesn’t matter what (\cdots) is, since \hat{k} is orthogonal to \hat{i} and \hat{j}; thus, their dot products are 0.

From this, we can see that our S_2 integral becomes:

    \[  \underset{S_2}{\int \int } R(\hat{k} \cdot \hat{n})\,ds = \underset{D}{\int \int } R(x,y,f_2(x,y))\,dA  \quad \text{(7.2.9)} \]

We perform the same procedure on the S_1 integral \underset{S_1}{\int \int } R(\hat{k} \cdot \hat{n})\,ds. We begin by parameterizing our surface, S_1:

    \begin{align*}  S_1:\, \vec{t}(x,y) &= x\hat{i} + y\hat{j} +  f_1(x,y)\hat{k} \quad \text{ for } (x,y) \in D  \quad \text{(7.2.10)} \end{align*}

Next, we find (\hat{k} \cdot \hat{n})\,ds:

    \begin{align*}  (\hat{k} \cdot \hat{n})\,ds &= \hat{k} \cdot (\vec{e}_x \times  \vec{e}_y)\,dA  \\ &= \hat{k} \cdot \begin{vmatrix}  \hat{i} & \hat{j} &  \hat{k} \\ 0 & 1 & \frac{\partial f_1}{\partial y} \\ 1 & 0 & \frac{\partial f_1}{\partial x} \end{bmatrix}\,dA \\ &=  \hat{k} \cdot \left[ (\cdots) \hat{i} + (\cdots) \hat{j} - (1) \hat{k}  \right]\, dA \\ &= -dA   \quad \text{(7.2.11)} \end{align*}

Then:

    \[  \underset{S_1}{\int \int } R(\hat{k} \cdot \hat{n})\,ds = -\underset{D}{\int \int } R(x,y,f_1(x,y))\,dA  \quad \text{(7.2.12)} \]

Putting eq. (7.2.9) and eq. (7.2.12) back into eq. (7.2.7), the final expression for our double integral is:

    \[ \underset{S}{\int \int } (R(\hat{k} \cdot \hat{n})\,ds = \underset{D}{\int \int } \left[R(x,y,f_2(x,y)) -  R(x,y,f_1(x,y))\right]\,dA  \quad \text{(7.2.13)} \]

What we have left to do is show that our triple integral is the same as eq. (7.2.13). From eq. (7.2.6), the triple integral for which we’re trying to obtain an expression is:

    \begin{align*}  \underset{V}{\int \int \int} R_z\,dV &= \underset{D}{\int \int } \left[  \int_{f_1(x,y)}^{f_2(x,y)} \frac{\partial R}{\partial z}\,dz \right] \, dA \\ &= \underset{D}{\int \int } \left[R(x,y,f_2(x,y)) -  R(x,y,f_1(x,y))\right]\,dA  \quad \text{(7.2.14)} \end{align*}

We can see that eq. (7.2.13) and eq. (7.2.14) are equal, thus proving what we wanted to prove.