Chapter 32. Grad, curl, and div

The goal of this chapter is to define each individual red arrow in the poster. For each red arrow, we’ll show you

There is no integration in this chapter, and so it’s actually pretty straightforward.

Red arrowSymbolInput typeOutput at
each point
Example inputExample output
Gradient∇𝑓Scalar fieldVectorMeasure of distance from top of waterfallWaterfall current pointing to lower elevation
Curl∇×𝑓3D vec. field3D vectorWhirlpool currentArrow aligned with rotation axis, magnitude is rotation speed
Divergence∇⋅𝑓3D vec. fieldScalarWater flowPump/drain speed
2D curl𝜕𝑔𝜕𝑥−𝜕𝑓𝜕𝑦
where
𝐅=(𝑓,𝑔)
2D vec. fieldScalarWhirlpool currentAngular velocity
2D div∇⋅𝐅2D vec. fieldScalarWater flowPump/drain speed
Table 16: The red arrows, plus an extra 2D div that’s a modified version of 2D curl.

§32.1 [SIDENOTE] Aquatics are unlikely to improve your exam score

By the way, a quick word about aquatics. For each of these, I’m trying to tell you how to think of the quantity in terms of real life. This may help you internalize and remember the results. However, on the actual 18.02 exam, you will find that most of the functions you are taking curl’s or divergence’s of are rather artificial functions. So your aquatic intuition is more or less useless for actually doing calculation.

It’s kind of like how, you were told in 18.01 that derivatives measured rate of change. But then on the calculus final exam you were asked things like “differentiate 𝑓(𝑥)=sin(𝑒𝑥)2”. It probably wasn’t much help to know that 𝑓′(𝑥) was the rate of change of 𝑓, because the function 𝑓 is completely artificial and would never appear in real life. The question was really testing whether you can apply a recipe with the chain rule to get 𝑓′(𝑥)=2𝑒𝑥sin(𝑒𝑥)cos(𝑒𝑥).

The same is true in this chapter. Exam questions about grad, curl, div tend to use artificial functions. So the aquatic intuition is not going to be directly helpful and you just need to be good at following the recipe.

For this reason, in these notes, I’m not even going to bother trying to explain where the curl and div formulas come from. Many have tried and many have failed. If you want to see the grown-ups discuss this, see https://mathoverflow.net/q/21881/70654, where the top comment is “My advice: at this level, stick strictly to the textbook”. (It’s a little patronizing, I know.)

§32.2 [TEXT] Gradient

You already know how to do this from Chapter 15. The function 𝑓 assigns some number to every point in ℝ𝑛, and then ∇𝑓 points in the direction that 𝑓 increases most rapidly. In our aquatic examples, you could imagine you have a waterfall, 𝑓 measures the distance from the top of the waterfall, and ∇𝑓 just points straight down.

§32.3 [TEXT] Curl

Here’s the definition of curl in 3D space.

Definition of curl

Suppose

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

is a 3D vector field. Then the curl of 𝐅 is the vector field defined by

curl𝐅≔∇×𝐅≔(𝜕𝑟𝜕𝑦−𝜕𝑞𝜕𝑧𝜕𝑝𝜕𝑧−𝜕𝑟𝜕𝑥𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦).
Type signature
The curl takes in only a 3D vector field. The curl at each point is a 3D vector (i.e. the curl of a 3D vector field is itself a 3D vector field).
Tip: How to memorize curl

In practice, everyone remembers this formula using the following mnemonic:

∇×𝐅=|𝐞1𝐞2𝐞3𝜕𝜕𝑥𝜕𝜕𝑦𝜕𝜕𝑧𝑝𝑞𝑟|.

This equation does not pass type-safety, because it’s a “matrix” whose entries are some combination of functions, vectors, and partial derivative operators, so it absolutely does not make sense. Nonetheless, if you ignore all the type safety warnings and try to “expand” this expression, you will find that it basically gives you the formula for curl above. (Try it.)

This is why ∇×𝐅 is the notation chosen. You could almost imagine

∇=(𝜕𝜕𝑥𝜕𝜕𝑦𝜕𝜕𝑧)

in which case the determinant above is the old mnemonic for the cross product. Again, this makes absolutely zero sense math-wise. It’s only a convenient way to remember the formula, but it works really well because you only have to remember “∇×𝐅”.

Sample Question

Compute the curl of the vector field

𝐅(𝑥,𝑦,𝑧)=(𝑥𝑦𝑦𝑧𝑧𝑥).

Solution. Let 𝑝(𝑥,𝑦,𝑧)=𝑥𝑦, 𝑞(𝑥,𝑦,𝑧)=𝑦𝑧, 𝑟(𝑥,𝑦,𝑧)=𝑧𝑥. We can compute the first component of the curl by calculating

𝜕𝑟𝜕𝑦=𝜕𝜕𝑦(𝑧𝑥)=0𝜕𝑞𝜕𝑧=𝜕𝜕𝑧(𝑦𝑧)=𝑦.

Hence:

𝜕𝑟𝜕𝑦−𝜕𝑞𝜕𝑧=(0−𝑦)=−𝑦

is the first component of the curl.

The second and third components are done in the same way. The second component is

(𝜕𝑝𝜕𝑧−𝜕𝑟𝜕𝑥)=(0−𝑧)=−𝑧

and the third component is

(𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦)=(0−𝑥)=−𝑥.

Hence

∇×𝐅=(−𝑦−𝑧−𝑥).

□

Now let’s talk about aquatic intuition. Suppose as we do for most of our examples that our vector field 𝐅 represents the flow of water in an ocean or other body of water. We think of the curl as capturing the local rotation or swirling motion of the water at each point.

Here’s how you can imagine curl:

  1. Place a small paddle wheel (or imagine a small object that can rotate, like a stick with flags at each end) in the water at a point where you want to measure the curl.

  2. Observe how the wheel rotates due to the flow of water. If the water is flowing uniformly in a straight line, the wheel will not rotate. In this case, the curl at that point is zero because there’s no local rotation in the flow.

  3. If the wheel spins, this indicates that there is local rotational motion in the water. The curl at the point is a 3D vector, so there are two pieces of information:

    • The direction in which the wheel spins corresponds as follows to the direction of the curl. The axis of rotation of the wheel will point in the direction of the curl vector at that point. For example, if the water causes the wheel to rotate counterclockwise when viewed from above, the curl vector points upward. If the wheel rotates clockwise, the curl vector points downward.

    • The magnitude of the curl is related to how fast the wheel spins. A faster rotation means a stronger curl, indicating more intense local rotational motion in the flow of water.

Example of high and low curl:

In short, the curl of a vector field 𝐅 in our context of water flow measures the tendency of the water to rotate around each point, rather than simply move in a straight line. Visualizing it with a paddle wheel helps convey the idea of local rotational motion, with the curl vector indicating the direction and strength of that rotation.

Now, I promised you earlier that any two red arrows put together give 0. So now we prove the following.

Memorize: Curl of conservative field is zero

Let 𝑓:ℝ3→ℝ be a function (aka scalar field), and let ∇𝑓 be the corresponding conservative vector field. Then (assuming ∇𝑓 is continuously differentiable), the curl of ∇𝑓 is 𝟎 at every point i.e.

curl(∇𝑓)=∇×(∇𝑓)=𝟎.

Figure 77: Cut-out of two red arrows from the poster Figure 75 that chain to give zero.

You can actually verify this theorem pretty easily by definition:

Proof. Since

∇𝑓=(𝜕𝑓𝜕𝑥𝜕𝑓𝜕𝑦𝜕𝑓𝜕𝑧)

we get

curl(∇𝑓)=(𝑓𝑧𝑦−𝑓𝑦𝑧𝑓𝑥𝑧−𝑓𝑧𝑥𝑓𝑦𝑥−𝑓𝑥𝑦)=(000)

because we saw in Section 16.6 that 𝑓𝑧𝑦=𝑓𝑦𝑧=0, etc.□

However, it’s more important to have a visual understanding of why this is true. Remember, in the context of water flow, the fact that the curl of the gradient is zero means that if the flow is purely driven by a gradient (such as water moving due to pressure differences or height differences), there will be no rotational movement in the water. For example, if you have a waterfall, the water will flow directly downhill or uphill, without any swirling or spinning motion.

Here’s an example showing this:

Sample Question

Compute the curl of the vector field

𝐅(𝑥,𝑦,𝑧)=(𝑦2−sin(𝑥)2𝑥𝑦+4𝑦𝑧𝑒𝑧+2𝑦2).

Secretly, we happen to know the right-hand side is the gradient of the function 𝑓(𝑥,𝑦,𝑧)=𝑦2𝑥+cos𝑥+2𝑦2𝑧+𝑒𝑧+𝐶; this was the last example in Section 16.3. So with this insider information we expect the answer should come out to 𝟎. Indeed, it does:

Solution. Let 𝑝(𝑥,𝑦,𝑧)=𝑦2−sin(𝑥), 𝑞(𝑥,𝑦,𝑧)=2𝑥𝑦+4𝑦𝑧, 𝑟(𝑥,𝑦,𝑧)=𝑒𝑧+2𝑦2. First compute 𝜕𝑟𝜕𝑦 and 𝜕𝑞𝜕𝑧:

𝜕𝑟𝜕𝑦=𝜕𝜕𝑦(𝑒𝑧+2𝑦2)=4𝑦𝜕𝑞𝜕𝑧=𝜕𝜕𝑧(2𝑥𝑦+4𝑦𝑧)=4𝑦.

Compute the first component:

(𝜕𝑟𝜕𝑦−𝜕𝑞𝜕𝑧)=4𝑦−4𝑦=0.

For the second component, compute 𝜕𝑝𝜕𝑧 and 𝜕𝑟𝜕𝑥:

𝜕𝑝𝜕𝑧=𝜕𝜕𝑧(𝑦2−sin𝑥)=0𝜕𝑟𝜕𝑥=𝜕𝜕𝑥(𝑒𝑧+2𝑦2)=0.

Hence

(𝜕𝑝𝜕𝑧−𝜕𝑟𝜕𝑥)=0−0=0.

Finally, compute 𝜕𝑞𝜕𝑥 and 𝜕𝑝𝜕𝑦:

𝜕𝑞𝜕𝑥=𝜕𝜕𝑥(2𝑥𝑦+4𝑦𝑧)=2𝑦𝜕𝑝𝜕𝑦=𝜕𝜕𝑦(𝑦2−sin𝑥)=2𝑦.

Compute the third component:

(𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦)=2𝑦−2𝑦=0.

So the curl of the vector field 𝐅(𝑥,𝑦,𝑧) is (000)=𝟎.□

Hence this is an example of a conservative vector field, which we’ll talk more about later.

§32.4 [TEXT] Divergence

Definition of divergence

Suppose

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

is a 3D vector field. Then the divergence of 𝐅 is the scalar field defined by

div(𝐅)≔∇⋅𝐅≔𝜕𝑝𝜕𝑥+𝜕𝑞𝜕𝑦+𝜕𝑟𝜕𝑧.
Type signature
Divergence takes vector fields as input. The divergence at each point is a number (i.e. is a scalar field).
Tip: How to memorize divergence

The notation ∇⋅𝐅 is supposed to also be a mnemonic. If you continue the analogy where

∇=(𝜕𝜕𝑥𝜕𝜕𝑦𝜕𝜕𝑧)

then ∇⋅𝐅 looks like a dot product that does the right thing. Again, only for memory; this is totally nonsense math-wise.

Sample Question

Compute the divergence of the vector field

𝐅(𝑥,𝑦,𝑧)=(𝑥𝑦𝑦𝑧𝑧𝑥).

Solution. Let 𝑝(𝑥,𝑦,𝑧)=𝑥𝑦, 𝑞(𝑥,𝑦,𝑧)=𝑦𝑧, 𝑟(𝑥,𝑦,𝑧)=𝑧𝑥. Then

𝜕𝑝𝜕𝑥=𝜕𝜕𝑥(𝑥𝑦)=𝑦𝜕𝑞𝜕𝑦=𝜕𝜕𝑦(𝑦𝑧)=𝑧𝜕𝑟𝜕𝑧=𝜕𝜕𝑧(𝑧𝑥)=𝑥.

Sum the partials to get the divergence:

∇⋅𝐅=𝜕𝐹1𝜕𝑥+𝜕𝐹2𝜕𝑦+𝜕𝐹3𝜕𝑧=𝑦+𝑧+𝑥=𝑥+𝑦+𝑧.

□

Now let’s talk about aquatics. Again suppose 𝐅 represents the flow of water in an ocean or another body of water. To visualize the divergence of a vector field 𝐅, think of the divergence as measuring how much the water is spreading out or converging at each point.

Here’s how you can imagine it:

  1. Place a small marker (such as a floating object) at a point in the water flow. The goal is to observe how the flow of water behaves around that point.

  2. If the water appears to be flowing outward, as if water is being emitted from that point, the divergence is positive at that location. This suggests that more water is moving away from the point than toward it, indicating a local source of water.

  3. If the water appears to be flowing inward, as if the water is being sucked into that point, the divergence is negative. This suggests that water is converging at the point, indicating a local sink or depletion of water.

  4. If there is no noticeable net flow inward or outward (the water moves but does not spread out or converge), the divergence is zero. This indicates that there is no net change in how much water is entering or leaving that point.

Example of high and low divergence:

In summary, the divergence of a vector field 𝐅 in the context of water flow measures the rate at which water is spreading out (positive divergence) or converging (negative divergence) at each point. If there is neither spreading nor converging, the divergence is zero.

Digression on divergence of curl

I told you any two red arrows give you zero in the poster Figure 75. So there is technically a theorem that says the divergence of a curl is 0: that is,

div(curl(𝐅))=∇⋅(∇×𝐅)=0

assuming 𝐅 has continuous second partial derivatives. However, I don’t think we ever use this in 18.02. The problem is that our description of divergence assumes that our vector field is thought of like a water current, but curl(𝐅) is a vector field that describes how fast something rotates, and those arrows are emphatically not a water current (or anything resembling one).

§32.5 [TEXT] 2D scalar curl

The 2D scalar curl is a little more unnatural. The physical interpretation is the same, but if you have a 2D body of water, there’s only two ways to rotate: either clockwise or counterclockwise. (In contrast, if you put a paddle wheel into the ocean, there are lots of ways it can rotate.)

So the 2D scalar curl, true to its name, only outputs a number at each point, which you think of as an angular velocity of the spinning paddle wheel. Unlike with the usual 3D curl it’s no longer needed to specify an entire vector so that you can talk about the direction of rotation. Instead we take the convention that

Definition of 2D scalar curl

Suppose

𝐅(𝑥,𝑦)=(𝑝(𝑥,𝑦)𝑞(𝑥,𝑦))

is a 2D vector field. Then the 2D scalar curl of 𝐅 is the scalar field defined by

curl𝐅≔𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦.
Tip: 2D scalar curl is a special case of 3D scalar curl

The mnemonic ∇×𝐅 actually still works if you just pretend 𝐅 is a 3D vector field where the 𝑧-coordinate is always zero. That is, given 𝐅=(𝑝(𝑥,𝑦)𝑞(𝑥,𝑦)), consider the mnemonic

∇×(𝑝(𝑥,𝑦)𝑞(𝑥,𝑦)0).

If you follow through, you will find you get

|𝐞1𝐞2𝐞3𝜕𝜕𝑥𝜕𝜕𝑦𝜕𝜕𝑧𝑝(𝑥,𝑦)𝑞(𝑥,𝑦)0|.

All the terms involving 𝜕𝜕𝑧 disappear, because there’s no 𝑧 anywhere. So only the terms in front of 𝐞3 survive, and you get

|𝜕𝜕𝑥𝜕𝜕𝑦𝑝(𝑥,𝑦)𝑞(𝑥,𝑦)|𝐞3=(𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦)𝐞3.

And there’s the 2D scalar curl, the coefficient of 𝐞3.

Sample Question

Compute the 2D scalar curl of

𝐅(𝑥,𝑦)=(𝑥cos𝑦𝑒𝑥+sin𝑦).

Solution. The 2D scalar curl is given by

curl𝐹=𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦.

Given 𝑞(𝑥,𝑦)=𝑒𝑥+sin𝑦, we have

𝜕𝑞𝜕𝑥=𝜕𝜕𝑥(𝑒𝑥+sin𝑦)=𝑒𝑥+0=𝑒𝑥.

Given 𝑝(𝑥,𝑦)=𝑥cos𝑦 we have

𝜕𝑝𝜕𝑦=𝜕𝜕𝑦(𝑥cos𝑦)=𝑥(−sin𝑦)=−𝑥sin𝑦.

Hence

curl𝐅(𝑥,𝑦)=𝑒𝑥+𝑥sin𝑦.

□

It’s still true (and indeed follows from the 3D version) that:

Memorize
The 2D scalar curl of a conservative 2D vector field is zero at every point.

Figure 78: These two red arrows from the poster Figure 75 also chain to give zero.

Let’s see an example of that.

Sample Question

Compute the 2D scalar curl of

𝐅(𝑥,𝑦)=(3𝑥2+4𝑥𝑦+𝑦22𝑥2+2𝑥𝑦−3𝑦2).

Secretly, we happen to know the right-hand side is the gradient of the function 𝑓(𝑥,𝑦)=𝑥3+2𝑥2𝑦+𝑥𝑦2−𝑦3, because we did this example Section 16.3. So the 2D scalar curl should be 0, and indeed it is.

Solution. Given 𝑞(𝑥,𝑦)=2𝑥2+2𝑥𝑦−3𝑦2:

𝜕𝑞𝜕𝑥=𝜕𝜕𝑥(2𝑥2+2𝑥𝑦−3𝑦2)=4𝑥+2𝑦

Given 𝑝(𝑥,𝑦)=3𝑥2+4𝑥𝑦+𝑦2:

𝜕𝑝𝜕𝑦=𝜕𝜕𝑦(3𝑥2+4𝑥𝑦+𝑦2)=4𝑥+2𝑦.

Hence

curl𝐅(𝑥,𝑦)=𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦=(4𝑥+2𝑦)−(4𝑥+2𝑦)=0.

□

§32.6 [TEXT] 2D divergence

This is not a red arrow in the picture. But it comes up in one version of Green’s theorem, and it’s actually exactly the same as 3D. So I’ll just mention it briefly.

Definition of divergence

Suppose

𝐅(𝑥,𝑦)=(𝑝(𝑥,𝑦)𝑞(𝑥,𝑦))

is a 2D vector field. Then the divergence of 𝐅 is the scalar field defined by

div𝐅≔∇⋅𝐅≔𝜕𝑝𝜕𝑥+𝜕𝑞𝜕𝑦.

The aquatic interpretation is the same too, just in 2D bodies of water.

Sample Question

Compute the divergence of

𝐅(𝑥,𝑦)=(𝑥cos𝑦𝑒𝑥+sin𝑦).

Solution. In two dimensions, the divergence is given by

∇⋅𝐅=𝜕𝑝𝜕𝑥+𝜕𝑞𝜕𝑦.

Given 𝑝(𝑥,𝑦)=𝑥cos𝑦:

𝜕𝑝𝜕𝑥=𝜕𝜕𝑥(𝑥cos𝑦)=cos𝑦.

Given 𝑞(𝑥,𝑦)=𝑒𝑥+sin𝑦:

𝜕𝑞𝜕𝑦=𝜕𝜕𝑦(𝑒𝑥+sin𝑦)=cos𝑦.

Hence

∇⋅𝐅(𝑥,𝑦)=𝜕𝑝𝜕𝑥+𝜕𝑞𝜕𝑦=cos𝑦+cos𝑦=2cos𝑦.

□

Sample Question

Compute the divergence of

𝐅(𝑥,𝑦)=(3𝑥2+4𝑥𝑦+𝑦22𝑥2+2𝑥𝑦−3𝑦2).

Solution. Given 𝑝(𝑥,𝑦)=3𝑥2+4𝑥𝑦+𝑦2:

𝜕𝑝𝜕𝑥=𝜕𝜕𝑥(3𝑥2+4𝑥𝑦+𝑦2)=6𝑥+4𝑦

Given 𝑞(𝑥,𝑦)=2𝑥2+2𝑥𝑦−3𝑦2:

𝜕𝑞𝜕𝑦=𝜕𝜕𝑦(2𝑥2+2𝑥𝑦−3𝑦2)=2𝑥−6𝑦.

Hence

∇⋅𝐅(𝑥,𝑦)=𝜕𝑝𝜕𝑥+𝜕𝑞𝜕𝑦=(6𝑥+4𝑦)+(2𝑥−6𝑦)=8𝑥−2𝑦.

□

§32.7 [EXER] Exercises

Exercise 32.1. Consider the force of gravity 𝐆 exerted by a point mass of mass 𝑚 at a point 𝑂. Show that

∇⋅𝐆=0

at every point except 𝑂.