Table of Contents
- Preface
- I. Line Integrals
- II. Surface Integrals
- III. 3D Flux
- IV. Green’s Theorem
- V. 2D Divergence Theorem
- VI. Stokes’ Theorem
- VII. 3D Divergence Theorem
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
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:
where
- is the total length of
- is the length of the infinitesimal elements that we want to add
The length of is given by the Pythagorean theorem:
If we’re talking about the a 2D curve in the x-y plane, then we can define our curve as:
Then our infinitesimal length element is:
And our integral becomes:
I.1.2 Example
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:
Our line element is:
The integral we need to solve is:
(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
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 . If we take the limit of the sum of all these areas as , we wind up with an integral that gives us the area of the curtain:
To solve this integral, we:
- Find an expression for the differential length element, , along
- Parameterize the curve C (i.e., express and in terms of another variable (parameter),
- Express the endpoints of in terms of to define the limits of integration
By the Pythagorean theorem, the length of the differential length element is:
To parameterize , we let:
We define the endpoints of as and , as shown in figure 2.
Figure 1.2
From this, our integral becomes:
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:
Second:
Putting these values into our integral, we get:
This is the integral we need to solve to get our area.
I.2.2 Example
Figure 1.2.2.1 shows a surface specified by 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:
Therefore:
Let:
So:
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
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, . We find the component of the force field pointing in the direction of , 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: where P and Q are functions of x and y.
Displacement vectors along C: where .
Total work:
So,
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 and 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:
where the points at the end of are actually what define the surface, as shown in figure 2.1.1.
We can do the same for , namely:
From the above, we can come up with the following 2 equations:
Figure 2.1.2a shows a graph of the parameters and . 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 in (a) maps to in (b); the point in (a) maps to in (b); and so forth.
In figure 2.1.2b, we can see that the small green vector, is just vector subtracted from vector . But in eq. (2.1.5), we defined this quantity as .
Likewise, in figure 2.1.2b, the small purple vector, , is just subtracted from vector . But in eq. (2.1.6), we defined this quantity as .
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 . 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 that we can use to calculate the area. Specifically:
The total area of the surface, then, is given by:
where 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 for the surface of a sphere as described by .
We parameterize the x, y and z as shown in 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) , the angle made with the x-axis in the xy plane and 2) , the angle made with the x-axis in the xz plane. The radius of the sphere is . In (b), the purple vector has length is given by at (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 . Specifically, it would be , 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)):
The partial derivatives of needed to calculate the cross product required to define are:
and
The cross product between these 2 vectors is:
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:
To find the area, we substitute this value into the integral of eq. (2.1.8):
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:
For example, we can find the surface integral of a scalar field over a unit sphere as follows:
Our first step is to express our function in terms of our parameters and as given in eq. (2.2.1.1):
so
We plug this and the value for from eq. (2.2.1.5) into eq. (2.2.2.2), remembering that, since we’re dealing with a unit sphere, :
We’ll solve each integral separately then put them back together.
We use the trig identity:
Our integral becomes:
Let
So we have:
Thus,
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: . The velocity of the fluid (which is a vector) is also a function of space: . They make up a function, where:
Our goal is to determine the mass of fluid per unit time (i.e. flux) that flows through a surface 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 and .
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 :
where
= mass
= length
= time
From this, we can see that if we multiply by an entity with units of , we will get an answer with units , which is what we want. Of course, area has units of . Thus, it makes sense that we might multiply 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 that are perpendicular (normal) to our surface elements.
To do this, we can take the dot product of 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:
where
is the vector field defined above
is an infinitesimal surface element (a scalar)
is the unit vector perpendicular to
The trick now is to find . In our derivation of the surface integral, we noted that the infinitesimal area element is given by eq. (2.1.7):
The vectors that make up this cross product are tangent to our surface, . 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:
What we called in our derivation of the surface integral is represented by is our current problem. Therefore, our integral for the total flux becomes:
The flux integral is sometimes written as:
The rationale for this is as follows:
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 with which we create the cross product are what we called and in our previous derivation. The magnitude of this cross product equals , 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 – a vector with, say magnitude 5 pointing in the x-direction equals :
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, (pink and blue), and 2) a vector field (red arrows) that only points in the + or – x direction. We want to take the sum of around the circumference of .
Next, we take the same closed curve, , but this time, consider a vector field, where only points in the + or – y direction. Again, we take at each point around and add them up (i.e., integrate them). We have:
Now suppose we have the same closed curve, , 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:
Eq. (4.1.9) is a statement of Green’s theorem.
You may recognize as the curl of . Thus, Green’s theorem can be interpreted as saying the tendency of a vector field to rotate along curve is equivalent to the tendency of the vector field to rotate within the area enclosed by .
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
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:
We can get our outward flux with the integral:
We can write our unit normal vector as:
To see how we get this, click .
Substituting eq. (5.3) into eq. (5.2), we get:
Now we apply Green’s theorem:
where div is the divergence of .
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
In figure 6.1.1, we have an infinitesimal area element, enclosed by a contour, , with sides given by and (thick arrows), in a vector field . 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:
The fields in the y direction, respectively, on the left and right are:
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 are as follows, where the minus sign correlates with segments in which we move in the -x and -y directions:
where
So represents the how much our vector field circulates (or curls) around the curve enclosing any tiny surface. We recognize as the curl of :
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:
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, .
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:
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 making up a surface is equivalent to the tendency to circulate along the enclosing curve:
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.
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 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, , (a unit hemisphere with z > 0) as shown in figure 6.2.1.
We traverse the closed curve , , of which we will take our line integral in the counterclockwise direction. That means, by the righthand rule, our normal vector, , (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:
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:
To perform our line integral, we take the dot product of with . We have:
We use substitute the trig identity:
into eq. (6.2.3) to get:
Next, we turn our attention to solving the surface integral. Our formula is:
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.
The function describing our surface is:
So:
The magnitude of this normal vector is:
Therefore, our unit normal vector is:
Finally, we need to determine . We know the line element for a sphere is:
is constant so . The sides of the infinitesimal entities that make up infinitesimal area elements on the sphere’s surface are thus and . Therefore, the infinitesimal area element on the surface of a sphere is:
But we’re dealing with a unit hemisphere where . Therefore:
Recapping:
We need to convert x, y and z to polar coordinates. The conversions are:
Putting this all together, we have:
Let
From this, we can see that calculation of our line integral and surface integral yield the same value: . 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
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 is equal to the sum of all the divergences in that area.
The 3D divergence theorem states that the flux across a surface that encloses a volume 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:
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 be a vector field defined as:
Then
where, for example, gives us the component of in the x direction.
Using this, we can re-write the lefthand side of eq. (7.2.1) as:
Turning now to the righthand side of eq. (7.2.1), we can write the divergence of as:
where, for example,
Substituting eq. (7.2.5) into the left side of eq. (7.2.1), we have:
Now we equate eq. (7.2.4) and eq. (7.2.6), as shown in 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.
Figure 7.2.2 represents a generic Type I simple solid. We can break it into 3 surfaces: , and . And we can break down the integrals that describe this shape into 3 parts as well. We’ll start with the double integral:
Our unit normal vectors point outward. The unit vector of is perpendicular to . Therefore, the dot product and the integral disappears.
Now we turn our attention to solving the other 2 integrals. We start with the integral. We begin by parameterizing :
Recalling eq. (3.1.4), we have:
*I represented the expressions multiplying and with because it doesn’t matter what is, since is orthogonal to and ; thus, their dot products are 0.
From this, we can see that our integral becomes:
We perform the same procedure on the integral . We begin by parameterizing our surface, :
Next, we find :
Then:
Putting eq. (7.2.9) and eq. (7.2.12) back into eq. (7.2.7), the final expression for our double integral is:
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:
We can see that eq. (7.2.13) and eq. (7.2.14) are equal, thus proving what we wanted to prove.