Chapter 31. Vector fields

§31.1 [TEXT] Vector fields

In Part Golf, we only considered integrals of scalar-valued functions. However, in Part India and Juliett we will meet a vector field, which is another name for a function that inputs points and outputs vectors.

Definition
A vector field for ℝ𝑛 is a function 𝐅:ℝ𝑛→ℝ𝑛 that assigns to each point 𝑃∈ℝ𝑛 a vector 𝐅(𝑃)∈ℝ𝑛.

In contrast, we might use the word scalar field for the old kind of functions 𝑓:ℝ𝑛→ℝ that gave a number at each input point rather than a vector.

You actually have met a lot of vector fields before:

Example
Every gradient is an example of a vector field! That is, if 𝑓:ℝ𝑛→ℝ, then ∇𝑓 is a vector field for ℝ𝑛.

This case is so important that there’s a word for it:

Definition
A vector field for ℝ𝑛 is called conservative if it happens to equal ∇𝑓 for some function 𝑓:ℝ𝑛→ℝ.

In Part India and Juliett we’ll meet vector fields that aren’t conservative too.

Type signature

For standalone vector fields, we’ll always use capital bold letters like 𝐅 to denote them. That said, remember ∇𝑓 is also a vector field. So that’s why the operator ∇ itself is typeset a little bit bold.

Like the gradient, you should draw inputs to 𝐅 as points (dots) but the outputs as vectors (arrows). Don’t mix them.

For 2D and 3D vector fields, we’ll often write

𝐅=(𝑝(𝑥,𝑦)𝑞(𝑥,𝑦))𝐅=(𝑝(𝑥,𝑦,𝑧)𝑞(𝑥,𝑦,𝑧)𝑟(𝑥,𝑦,𝑧)).

I think other sources often use 𝑃, 𝑄, 𝑅 instead, but right now I’m using those for points too, so I’ll use lowercase letters.

§31.2 [TEXT] How do we picture a vector field?

There’s a lot of ways to picture a vector field, especially in physics. For consistency, I’m going to pick one such framework and write all my examples in terms of it. So in my book, all examples will be aquatic in nature; but if you can’t swim24, you should feel free to substitute your own. Imagine an electric field. Or a black hole in outer space. Or air currents in the atmosphere. Whatever works for you!

Anyway, for my book, we’ll use the following picture:

Idea
Imagine a flowing body of water (ocean, river, whirlpool, fountain, etc.) in ℝ2 or ℝ3. Then at any point 𝑃, we draw a tiny arrow 𝐅(𝑃) indicating the direction and speed of the water at the point 𝑃. You could imagine if you put a little ball at the point 𝑃, the current would move the ball along that arrow.

Sounds a lot like the gradient, right? Indeed, conservative vector fields are a big family of vector fields, and so we should expect they fit this picture pretty neatly. But the thing about conservative vector fields is this: ∇𝑓, as a vector field, is always rushing towards whatever makes the value of 𝑓 bigger. Whereas generic vector fields might, for example, go in loops. Let’s put these examples into aquatic terms.

Example of a conservative vector field: going downstream a river

Let’s imagine we have a river with a strong current. We’ll make the important assumption that the river only goes one way: that is, if you go along the current, you never end up back where you started. In real life, this often occurs if the river goes down a mountain, so as you go down the river you’re losing elevation.

If you do this, you can define a “downstream function” 𝑓:ℝ3→ℝ as follows: for every point 𝑃 in the river, 𝑓(𝑃) measures how far downstream you are. For example, if the river had a head, maybe we could assign 𝑓 the value zero there, and then 𝑓 would increase as you get farther from the head, reaching the largest value at the mouth. (For mountainous rivers, 𝑓 might instead be thought of as decreasing in elevation.)

Then the vector field corresponding to the river is the gradient ∇𝑓. Remember, the gradient ∇𝑓 tells you what direction to move in to increase 𝑓. And if you throw a ball into a river, its motion could be described simply as: the ball moves downstream.

Figure 70: A river flowing from the base of a waterfall. Red arrows point along the direction of the gradient. (Drawn in ProCreate.)
Example of a non-conservative vector field: a whirlpool

Now imagine instead you have a whirlpool. If you throw a ball in it, it goes in circles around the vortex of the whirlpool. This doesn’t look anything like the river! If you have a river, you never expect a ball to come back to the same point after a while, because it’s trying to go downstream. But with a whirlpool, you keep going in circles over and over.

If you draw the vector field corresponding to a whirlpool, it looks like lots of concentric rings made by tiny arrows. That’s an example of a non-conservative vector field.

Figure 71: A whirlpool. Round and round we go. Not a conservative vector field. (Drawn in ProCreate.)

§31.3 [TEXT] How to draw a vector field

If you’re actually given a formula for 𝐅(𝑥,𝑦), you can sketch the corresponding vector field by the following procedure.

Recipe for sketching a vector field

To draw a cartoon of a vector field:

  1. Pick a bunch of points 𝑃 that you want to draw the arrows at.
  2. For each 𝑃, draw a little arrow starting at 𝑃 in the same direction as 𝐅(𝑃). (To make the cartoon readable, you usually scale down the magnitude of the arrow.)

In practice, to make the pictures not look absurd, people will typically draw the arrows a lot smaller than they really are. For example, if you get that 𝐅(10,10)=(23), then strictly speaking the arrow starting at (10,10) should reach all the way to (12,13). But if you do this, your cartoon image looks absurd. So people will typically adjust the arrow sizes in the cartoon to be a tiny arrow, still pointing the right way, but with much smaller magnitude. For the cartoon it’s usually more important the relative size of the arrows is correct; drawing the absolute values to scale is unnecessary.

The classic easy-to-draw example is 𝐅=(𝑥𝑦), in which for every point 𝑃, one just points straight away from the origin. See Figure 72 for that. For the record, in this figure (and the other figures in this section), the lengths of all the little arrows are scaled exactly 30% compared to the true lengths.

Figure 72: A plot of the first vector field that’s drawn in every class, good old 𝐅(𝑥,𝑦)=(𝑥𝑦).

Okay, here are eight more pictures to train your instincts. For each one, try to pick a few points like (2,0) or (3,−1) and so on and verify that the arrow starting at that point points in the way you expect.

Figure 73: Four more examples of vector fields in ℝ2. The example 𝐅(𝑥,𝑦)=(𝑥0) has just horizontal arrows that get longer as |𝑥| grows. The example 𝐅(𝑥,𝑦)=(0𝑥) has just vertical arrows, similar story. The example 𝐅(𝑥,𝑦)=(𝑦−𝑥) is swirly. The example 𝐅(𝑥,𝑦)=(𝑥𝑦3) is slanted.

Figure 74: Another four examples of vector fields in ℝ2. The vector field 𝐅(𝑥,𝑦)=(11) is just constant. The vector field 𝐅(𝑥,𝑦)=(𝑥+𝑦2𝑥−𝑦2) has some tilted arrows. The vector field 𝐅(𝑥,𝑦)=(𝑥𝑥) has all arrows at 45° angles, growing in length with larger |𝑥|. And the goofy 𝐅(𝑥,𝑦)=(sin(𝜋2𝑥)sin(𝜋2𝑦)) has an oscillating behavior.

§31.4 [TEXT] Preview of integration over vector fields

As we mentioned in Section 21.2, the line integral and surface integral we encountered in Part Golf (which had a scalar-valued function) are actually the ugly ducklings that don’t get used. For most cases, if you are doing a line integral or surface integral, you actually want vector-valued line and surface integrals, where one takes a line or surface integral over the entire field.

That’s when the type signatures go crazy.

In order for this to be even remotely memorable, what I’m going to do is augment the previous Figure 41 with pictures corresponding to the situations in which we might integrate a vector field. The new chart can also be downloaded as a large PDF version.

Figure 75: Upgraded Figure 41 with vector fields. Download at https://web.evanchen.cc/textbooks/poster-stokes.pdf.

There are two new features of Figure 75 compared to the old version: the three purple pictures and the six red arrows. We’ll define them all over the next few sections, so just a few words now.

§31.4.1 The three purple pictures

There are three new pictures in purple: they are work (covered in Part India) and flux (covered in Part Juliett). Basically, these are the only two situations in which we’ll be integrating over a vector field:

These terms will be defined next chapter.

Type signature
The new purple things are still all scalar quantities, i.e. work and flux are both numbers, not vectors.

As we mentioned in Section 21.2, the purple pictures will basically replace the corresponding green ones. Conversely, vector fields will usually only be integrated in the situations described in the purple picture. This is summarized in Table 15.

For scalar fields 𝑓:ℝ𝑛→ℝFor vector fields 𝐅:ℝ𝑛→ℝ𝑛
18.01 integral✅ Used all the time❌ Never used in 18.02
Line integral🔵 Only for arc length✅ Used all the time (work)
Double/Area integral✅ Used all the time❌ Never used in 18.02
Surface integral🔵 Only for surface area✅ Used all the time (flux)
Triple/Volume integral✅ Used all the time❌ Never used (except in Equation 12)
Table 15: What the various kinds of integrals are used for. The integrals with ❌ markers never appear in 18.02, so they don’t appear in the chart Figure 75 either. (In 18.02 it could happen that line and surface integrals are used for scalar fields if you need mass of a wire or metal plate, but that’s quite rare I think.)

This bears repeating:

Idea
We’ll pretty much not use the scalar field integrals besides for arc length and surface area. In other words, you can mostly ignore the green pictures in the poster Figure 75 that got replaced by purple ones.

§31.4.2 The six red arrows

There are also six new red arrows. They indicate transformations on functions: a way to take one type of function and use it to build another function.

For example, the gradient ∇ is the one we’ve discussed: if you start with a scalar-valued function 𝑓:ℝ𝑛→ℝ, the gradient creates a vector field ∇𝑓:ℝ𝑛→ℝ𝑛. (The d𝑓d𝑥 in the 𝑓:ℝ1→ℝ case is also just the gradient, though a bit more degenerate.)

We’ll soon meet three more transformations:

§31.5 [TEXT] Foreshadowing of Stokes’ theorem

All the red arrows have two important properties I will tell you right now. Because I haven’t talked much about any of the red arrows yet, you won’t be able to understand what this means yet. That’s okay. We’ll go over what this means for each individual red arrow when we get to it. However, I want to tell you in advance that every time we meet a red arrow, there will be a case of Stokes’ theorem that applies to it.

Memorize: Two red arrows gives zero
In Figure 75, if you follow two red arrows consecutively, you get zero.
Memorize: Generalized Stokes’ Theorem, for 18.02

In Figure 75, take any of the six red arrows 𝑋→𝑌. Let ℛ︀ be a compact region. Then the integral of 𝑋 over the boundary of ℛ︀ equals the integral of 𝑌 over ℛ︀:

∫boundary(ℛ︀)𝑋=∫ℛ︀𝑌.

In fact let me tell you what generalized Stokes’ theorem says, in vague non-precise terms (we’ll make precise later), for each of these six red arrows:

Evaluation → 18.01 integral

For the d𝑓d𝑥 arrow joining evaluation to the 18.01 integral, it’s the fundamental theorem of calculus. The region ℛ︀ is the line segment [𝑎,𝑏], and the boundary is the two endpoints 𝑎 and 𝑏. Then we have the fundamental theorem of calculus from 18.01:

𝑓(𝑏)−𝑓(𝑎)=∫𝑎𝑏d𝑓d𝑥d𝑥.
Evaluation → line integral (×2)

There are two such red arrows, but the statement is the same for both. Suppose 𝐫(𝑡) parametrizes a path joining point 𝑃 to 𝑄 (say, the line segment 𝑃𝑄, or some more curvy path). The region ℛ︀ is this path, and the endpoints are 𝑃 and 𝑄: Then we get the fundamental theorem of calculus for line integrals:

𝑓(𝑄)−𝑓(𝑃)=∫𝑡=start timestop time∇𝑓(𝐫(𝑡))⋅𝐫′(𝑡)d𝑡.

The right-hand side is the work done by ∇𝑓 on the path 𝐫.

If you use shorthand where 𝒞︀ is the curve formed by 𝐫, this could be rewritten as

𝑓(𝑄)−𝑓(𝑃)=∫𝒞︀∇𝑓⋅d𝐫.
Line integral → double/area integral

Suppose now 𝐅:ℝ2→ℝ2 is a vector field. Write 𝐅=(𝑝(𝑥,𝑦),𝑞(𝑥,𝑦)). Let ℛ︀ be some two dimensional region, like a disk. Suppose further that the boundary of ℛ︀ is parametrized by a curve 𝐫(𝑡) (e.g. the circumference of the disk). Then Green’s theorem says that

∫𝑡=start timestop time𝐅(𝐫(𝑡))⋅𝐫′(𝑡)d𝑡=∬ℛ︀(𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦)d𝑥d𝑦.

The weird expression 𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦 in the right-hand side is called the 2D scalar curl, but we haven’t defined this term yet.

If you use shorthand as in Table 13, this can be simplified. Let 𝒞︀ be the curve formed by 𝐫, this could be rewritten as

∫𝒞︀𝐅⋅d𝐫=∬ℛ︀(𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦)d𝐴.

There’s a second form of Green’s theorem I’ll show you when I get to it.

Line integral → surface integral

Suppose now 𝐅:ℝ3→ℝ3 is a vector field. Let 𝐫2(𝑢,𝑣) parametrizes some two dimensional surface 𝒮︀ (like a metal sheet), and suppose further that the boundary of this surface is parametrized by a curve 𝐫1(𝑡) (e.g. the edges of the sheet). Then the classical version of Stokes’ theorem says that

∫𝑡=start timestop time𝐅(𝐫1(𝑡))⋅𝐫1′(𝑡)d𝑡=∬𝒮︀(∇×𝐅)(𝐫2(𝑢,𝑣))⋅(𝜕𝐫2𝜕𝑢×𝜕𝐫2𝜕𝑣)d𝑢d𝑣.

The nonsense expression ∇×𝐅 is called the curl, defined next chapter in Chapter 32.

The shorthand version following Table 13 is much easier to read, because the shorthand 𝐧d𝑆 stands for the entire hunk (𝜕𝐫2𝜕𝑢×𝜕𝐫2𝜕𝑣)d𝑢d𝑣. Suppose the curve for 𝐫1 is denoted 𝒞︀. Then the above equation compresses all the way down to

∫𝒞︀𝐅⋅d𝐫1=∬𝒮︀(∇×𝐅)⋅𝐧d𝑆.

so yes, that does save a lot of characters.

Surface integral → triple/volume integral

Suppose now 𝐅:ℝ3→ℝ3 is a vector field. Let 𝒯︀ be some three-dimensional solid (e.g. metal ball). Suppose further the boundary of ℛ︀ is parametrized by some two-dimensional surface 𝐫(𝑢,𝑣) (e.g. metal sphere), which we call 𝒮︀. Then the divergence theorem says that

∬𝒮︀𝐅(𝐫(𝑢,𝑣))⋅(𝜕𝐫𝜕𝑢×𝜕𝐫𝜕𝑣)d𝑢d𝑣=∭𝒯︀(∇⋅𝐅)(𝑥,𝑦,𝑧)d𝑥d𝑦d𝑧.

If we adopt shorthand again, this reads just

∬𝒮︀𝐅⋅𝐧d𝑆=∭𝒯︀∇⋅𝐅d𝑉.

The nonsense expression ∇⋅𝐅 is called the divergence, defined next chapter in Chapter 32.

Again, these bullets will not make sense to you yet (except the first one, which is the 18.01 fundamental theorem of calculus), because there are several undefined terms. Instead, treat this as a template for all the theorem statements you are going to learn soon:

Idea
Every red arrow in the poster Figure 75 has an associated Stokes result.

Know this going in to each of the concepts to follow.

Figure 76: It’s all Stokes’ theorem.

§31.6 [TEXT] Stay determined

This is probably super overwhelming right now, and Figure 75 might be frightening to look at because there’s so much information in it. Don’t worry, we’ll take Figure 75 apart one piece at a time over the rest of the semester.

§31.7 [EXER] Exercises

Exercise 31.1. Take a few deep breaths, touch some grass, and have a nice drink of water, so that you can look at Figure 75 without feeling fear.
Exercise 31.2. Print out a copy of the high-resolution version of Figure 75 (which can be downloaded at https://web.evanchen.cc/textbooks/poster-stokes.pdf) and hang it in your room.
  1. 24Doesn’t MIT make you pass a swim test, though?