Chapter 34. Shortcuts for work: conservative vector fields and Green’s theorem

In the last chapter we showed the definition of work and how to compute ∫𝒞︀𝐅⋅d𝐫 with bare-hands by using parametrization. However, parametrization can be a lot of work. So the purpose of this chapter is to show you under what conditions you can get away with not having to do a parametrization. There will be two such categories:

We’ll show you both of these now.

§34.1 [TEXT] The fundamental theorem of calculus for line integrals

We now show the first Stokes result. It corresponds to a statement for the red arrow shown below.

Figure 84: The FTC for line integrals is the Stokes statement for the “grad” red arrows in the poster Figure 75.
Memorize: FTC for line integrals

Suppose 𝐅:ℝ𝑛→ℝ𝑛 is a conservative vector field, given by 𝐅=∇𝑓 for some potential function 𝑓:ℝ𝑛→ℝ. Then for any curve 𝒞︀ from a point 𝑃 to a point 𝑄 we have

∫𝒞︀𝐅⋅d𝐫=𝑓(𝑄)−𝑓(𝑃).

This has several important consequences. If you know 𝐅 is conservative, then

Indeed in the first case the work integral is 𝑓(𝑃)−𝑓(𝑃)=0 and the second case it equals 𝑓(𝑄)−𝑓(𝑃) (for both 𝒞︀ and 𝒞︀’). But those two bullets are nice philosophically because they don’t even require you to know anything at all about the function 𝑓.

In other words:

Idea: Practical consequences of FTC for line integrals

If you already know 𝐅 is conservative, then

  • If you also know the potential function 𝑓, then work integrals are extremely easy to calculate: just compute 𝑓(ending point)−𝑓(starting point).
  • If you don’t know the potential function 𝑓, use the methods in Chapter 16 to find it.
  • If the starting point and ending point are the same you don’t even need to find 𝑓. The work integral is always 0.

Let’s see this concretely with a conservative vector field. We’ll use

𝐅(𝑥,𝑦)=(2𝑥+13𝑦)

which, if we follow the recipe from Chapter 16, we can recover the 𝑓 such that 𝐅=∇𝑓:

𝑓(𝑥,𝑦)=𝑥2+𝑥+32𝑦2.

Thus, now that 𝑓 is known, line integrals are trivial to compute:

Sample Question

Compute the line integral of the vector field 𝐅(𝑥,𝑦)=(2𝑥+13𝑦) along the following two curves:

  • the upper half of the circle 𝑥2+𝑦2=1, oriented counterclockwise (blue in Figure 85).
  • the line segment from (1,0) to (−1,0) (brown in Figure 85).

Figure 85: The same brown and blue path from Figure 82, but this time with a different vector field, now conservative.

Solution. Because we know the potential function

𝑓(𝑥,𝑦)=𝑥2+𝑥+32𝑦2

the answer to both parts is the same:

𝑓(−1,0)−𝑓(1,0)=0−2=−2.

□

For comparison, we show how we could have computed the line integrals “by hand” for each of the bullets above, if we were not clever enough to notice that 𝐅 was conservative. Of course, we do this knowing that the two answers better be equal (to −2).

Sample Question

Suppose 𝒞︀ is any path from (1,100) to (42,1337). Compute

∫𝒞︀5d𝑥.

Solution. Expanding the shorthand 5d𝑥=5d𝑥+0d𝑦, the vector field we’re integrating over is the constant vector field 𝐅(𝑥,𝑦)=(50). (In the cartoon, every blue arrow points directly east and has the same length 5.) This is certainly conservative: the potential function

𝑓(𝑥,𝑦)=5𝑥

can be found just by guessing or via the method in Chapter 16. Indeed, ∇𝑓=(50) as we needed.

So now that we know 𝐅 is conservative and have found a potential function 𝑓, we can forget about parametrizing 𝒞︀ and just write directly

∫𝒞︀5d𝑥=𝑓(42,1337)−𝑓(1,100)=5⋅42−5⋅1=5(42−1)=205.

□

Remark
In general, the vector field encoded by 𝑐d𝑥 for any constant 𝑐 is conservative with potential function 𝑓(𝑥,𝑦)=𝑐𝑥. Hence, ∫𝒞︀𝑐d𝑥=𝑐∫𝒞︀d𝑥 will always just equal 𝑐 times the total change in 𝑥.

§34.2 [TEXT] Okay, but how do you tell whether 𝐅 is conservative?

We saw that when 𝐅 is conservative, the curl ∇×𝐅 is zero. It turns out that if 𝐅 is defined everywhere, then the reverse is true too: that is, we can use ∇×𝐅 as a criteria for checking conservative fields.

Memorize: Conservative ⟺ ∇×𝐅=𝟎

Assume here the vector field is continuously differentiable and defined everywhere on ℝ2 or ℝ3.

  • A vector field 𝐅:ℝ2→ℝ2 given by 𝐅(𝑥,𝑦)=(𝑝(𝑥,𝑦)𝑞(𝑥,𝑦)) is conservative if and only if the 2D scalar curl is zero everywhere:

    𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦=0.
  • A vector field 𝐅:ℝ3→ℝ3 is conservative if and only if the curl ∇×𝐅 is zero everywhere. In symbols, if 𝐅(𝑥,𝑦)=(𝑝(𝑥,𝑦,𝑧)𝑞(𝑥,𝑦,𝑧)𝑟(𝑥,𝑦,𝑧)) then we need all three components of the curl to equal 0:

    𝜕𝑟𝜕𝑦−𝜕𝑞𝜕𝑧=𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦=𝜕𝑝𝜕𝑧−𝜕𝑟𝜕𝑥=0.

This should look familiar: it’s the same thing I told you in Section 16.6. The only thing that’s change is that I now have an aquatic interpretation of all the equations: that we require the 2D or 3D curl to be zero. But the equations are the same.

Remark
This theorem also fails if the vector field 𝐅 is only defined on part of ℝ𝑛 and the region is not simply connected. In that case it only works one direction — that is, if ∇×𝐅≠𝟎 then 𝐅 is definitely not conservative, but some non-conservative fields also satisfy ∇×𝐅=𝟎.
Sample Question

For which real number 𝑐 is the vector field

𝐅=(𝑒cos𝑥+𝑥𝑦5𝑐𝑥2𝑦4+log(𝑦2+1))

a conservative vector field?

Solution. We need the number 𝑐 such that

𝜕𝜕𝑥(𝑐𝑥2𝑦4+log(𝑦2+1))=𝜕𝜕𝑦(𝑒cos𝑥+𝑥𝑦5)⟺𝑐⋅2𝑥𝑦4=5𝑥𝑦4

holds for all real numbers 𝑥 and 𝑦. This occurs only when 𝑐=52.□

Sample Question

For which real numbers 𝑎, 𝑏 is the vector field

𝐅=(𝑦2+𝑎𝑥2𝑧+𝑒𝑥𝑏𝑥𝑦+𝑧cos(𝑦𝑧)𝑥3+𝑦cos(𝑦𝑧)).

a conservative vector field?

Solution. Let

𝑝=𝑦2+𝑎𝑥2𝑧+𝑒𝑥𝑞=𝑏𝑥𝑦+𝑧cos(𝑦𝑧)𝑟=𝑥3+𝑦cos(𝑦𝑧).

We need to seek (𝑎,𝑏) such that the curl ∇×𝐅 is zero, that is

𝜕𝑟𝜕𝑦−𝜕𝑞𝜕𝑧=𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦=𝜕𝑝𝜕𝑧−𝜕𝑟𝜕𝑥=0.

We compute all six partial derivatives in turn.

Hence (𝑎,𝑏)=(3,2) is the only answer.□

Digression

In particular, there should be a potential function for each of the two examples above.

In the first example, it’s not easy to write down a potential function, because 𝑒cos𝑥 has no easily-expressed anti-derivative. (Though log(𝑦2+1) does; it turns out to be 𝑦(log(𝑦2+1)−2)+2arctan(𝑦).) So we are content that some potential function does exist even if it cannot be written down using familiar functions.

On the other hand, the second example can be integrated readily enough, by following the procedure in Chapter 16: one should get

𝑓(𝑥,𝑦,𝑧)=𝑒𝑥+cos(𝑦𝑧)+𝑥3𝑧+𝑥𝑦2+𝐶.

§34.3 [TEXT] Green’s theorem (2D only)

We expect there should be a Stokes result as well for the red arrow joining the 2D work integral to an area integral.

Figure 86: Green’s theorem is the Stokes result for the above red arrow from the poster Figure 75.

Here is what it says.

Memorize: Green’s theorem for converting work to curl

Suppose 𝒞︀ is a closed loop parametrized by 𝐫(𝑡) that encloses a region ℛ︀ counterclockwise. Then for any vector field 𝐅=(𝑝(𝑥,𝑦)𝑞(𝑥,𝑦)), conservative or not, we have

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

There’s a new symbol ∮𝒞︀ on the left, but it has the same meaning as ∫𝒞︀. The circle is there to emphasize that 𝒞︀ is a closed loop, i.e. it’s required to have the same start and ending point (unlike the other curves we saw in earlier examples). In other words:

Definition of ∮
∮𝒞︀ means “∫𝒞︀ but with an extra optional reminder that 𝒞︀ is a loop”. (The reminder is optional, i.e. you are not obligated to add the circle even when 𝒞︀ is a loop.)

Note this doesn’t require 𝐅 to be conservative! (All the past discussion about 𝐅 being conservative was because we were using the red “grad” arrow in Figure 84. But we’re now moving on to a new red arrow in our poster, and that assumption about a gradient isn’t needed anymore.) In fact, in the event that 𝐅=∇𝑓 is conservative, we know that 𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦=0: the 2D scalar curl of a conservative vector field is 0. So Green’s theorem is then just saying that ∮𝒞︀∇𝑓d𝐫=0 which we already knew.

Tip: Always use counterclockwise orientation
Whenever 𝒞︀ is a closed loop in ℝ2, we’ll basically always assume that the direction we walk around it is counterclockwise. It’s considered bad manners to break this convention and have a loop oriented clockwise.

Green’s theorem gives us a way to short-circuit a bunch of calculations that we were doing by hand earlier in the case where our loop is closed. Here are a few.

Sample Question

Calculate the line integral

∮𝒞︀(𝑥3−𝑦)d𝑥+(𝑥+𝑦3)d𝑦,

where 𝒞︀ is the circle 𝑥2+𝑦2=4 oriented counterclockwise.

Solution. Let ℛ︀ denote the region enclosed by 𝒞︀. We use Green’s theorem with the vector field

𝑝(𝑥,𝑦)=𝑥3−𝑦,𝑞(𝑥,𝑦)=𝑥+𝑦3.

Calculate the partial derivatives of 𝑞 with respect to 𝑥 and 𝑝 with respect to 𝑦:

𝜕𝑞𝜕𝑥=𝜕𝜕𝑥(𝑥+𝑦3)=1,𝜕𝑝𝜕𝑦=𝜕𝜕𝑦(𝑥3−𝑦)=−1.

Substitute the partial derivatives into Green’s theorem:

∮𝒞︀𝑝d𝑥+𝑞d𝑦=∬ℛ︀(𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦)d𝐴=∬ℛ︀(1−(−1))d𝐴=∬ℛ︀2d𝐴.

The region ℛ︀ is the disk defined by 𝑥2+𝑦2≤4, which is a circle of radius 2, hence with area

Area(ℛ︀)=𝜋𝑟2=𝜋(2)2=4𝜋.

So the answer is 2⋅4𝜋=8𝜋.□

Sample Question

Evaluate the line integral

∮𝒞︀(𝑦d𝑥−𝑥d𝑦)

where 𝒞︀ is the triangle with vertices at (0,0), (1,0), and (0,1), oriented counterclockwise.

Solution. Let ℛ︀ denote the interior of the triangle. By Green’s theorem:

∮𝒞︀𝑝d𝑥+𝑞d𝑦=∬ℛ︀(𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦)d𝐴,

where 𝑃(𝑥,𝑦)=𝑦 and 𝑄(𝑥,𝑦)=−𝑥. Calculate 𝜕𝑞𝜕𝑥 and 𝜕𝑝𝜕𝑦:

𝜕𝑞𝜕𝑥=−1,𝜕𝑝𝜕𝑦=1.

Hence

∬ℛ︀(𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦)d𝐴=∬ℛ︀(−1−1)d𝐴=∬ℛ︀−2d𝐴.

The area of the triangle ℛ︀ is:

Area(ℛ︀)=12⋅base⋅height=12⋅1⋅1=12.

Thus:

∬ℛ︀−2d𝐴=−2⋅12=−1.

□

Sample Question

Calculate the line integral

∮𝒞︀(𝑥2d𝑦−𝑦2d𝑥)

where 𝐶 is the boundary of the square with vertices at (1,1), (0,1), (0,0), and (1,0), oriented counterclockwise.

Solution. Let ℛ︀ denote the interior of the square. By Green’s theorem:

∮𝒞︀𝑝d𝑥+𝑞d𝑦=∬ℛ︀(𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦)d𝐴,

where 𝑝(𝑥,𝑦)=−𝑦2 and 𝑞(𝑥,𝑦)=𝑥2. Calculate 𝜕𝑞𝜕𝑥 and 𝜕𝑝𝜕𝑦:

𝜕𝑞𝜕𝑥=2𝑥,𝜕𝑝𝜕𝑦=−2𝑦.

Substitute these into Green’s theorem:

∬ℛ︀(2𝑥−(−2𝑦))d𝐴=∬ℛ︀(2𝑥+2𝑦)d𝐴.

Since ℛ︀ is a square with side length 1 centered at the origin, integrate over 𝑥 and 𝑦 from 0 to 1:

∬ℛ︀(2𝑥+2𝑦)d𝐴=2∫𝑦=01∫𝑥=01(𝑥+𝑦)d𝑥d𝑦.

Evaluate the inner integral with respect to 𝑥:

[𝑥22+𝑦𝑥]𝑥=01=𝑦+12.

Evaluate the integral with respect to 𝑦:

2∫𝑦=01(𝑦+12)d𝑦=2.

□

§34.4 [SIDENOTE] A picture explaining why Green’s Theorem for work should be true (not a formal proof)

Here is an extremely informal explanation of what Green’s Theorem is trying to say pictorially. We won’t make it precise or go into the details.

Remember that the 2D scalar curl of a 2D vector field 𝐅 at a point 𝑃 is a number that describes the counterclockwise swirl of the field 𝐅 near 𝑃. So to draw a picture (Figure 87):

Then the integral

∬ℛ︀(𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦)d𝐴

can be thought of as the “sum of the green swirls” (whatever that means).

Figure 87: A rough picture of what Green’s Theorem for work is trying to say: “if you add up the green swirls, then only the work along the purple boundary is left”.

However, in Figure 87 you should realize: all the swirls on the inside cancel. Imagine one of the vertical grey walls between two grey cells: you can imagine the direction and magnitude of 𝐅 along the wall contributes to the “swirliness” of the two adjacent cells, but whatever it contributes positively to one cell, it contributes negatively to the other one. (Again, this is all an informal picture, so I won’t make this precise.)

So if we add all the green stuff, the only thing that’s left is the green stuff that’s just along the purple curve (drawn darker above). For example, the dark green arrows on the left correspond to how much 𝐅 points downwards against the nearby grey walls: which exactly matches the description of the work integral of 𝐅 along that western wall. And when you sum all four dark green currents, you just get the total work done by 𝐅 along the purple curve 𝒞︀, as desired.

§34.5 [RECIPE] Evaluating line integrals, all together now

While we gave a definition of line integrals with parametrization, we then saw right away there are a couple shortcuts, namely FTC and Green’s theorem (in 2D) in certain cases. So with this, we can present a recipe that condenses these together.

Recipe for computing line integrals with possible shortcuts

Suppose we want to evaluate ∫𝒞︀𝐅⋅d𝐫.

  1. First, check if the vector field is conservative by seeing if the curl is zero.

    • If so, don’t bother parametrizing 𝒞︀. Don’t even look at 𝒞︀ besides the endpoints. Find a potential function 𝑓 for the vector field 𝐅 and use the FTC as a shortcut: output

      𝑓(stop)−𝑓(start).
  2. Second, if the line integral is in ℝ2, check if 𝒞︀ is a closed loop.

    • If so, see if Green’s theorem gives you an easy shortcut:

      ∮𝒞︀(𝑝d𝑥+𝑞d𝑦)=∬ℛ︀(𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦)d𝐴.
  3. If both of these fail, fall back to the parametrization recipe described in Section 33.4. To repeat it here:

    1. Pick any parametrization 𝐫:ℝ→ℝ𝑛 of the curve 𝒞︀, including specifying the start and stop times. As described in Section 12.7, you have some freedom in how you set the parametrization.
    2. Calculate the derivative 𝐫′(𝑡).
    3. Calculate the dot product 𝐅(𝐫(𝑡))⋅𝐫′(𝑡).
    4. Integrate this from the start time to the stop time.

We’ll give several more examples of this in Section 35.5, where we contrast it to another type of line integral, the “2D flux”.

§34.6 [TEXT] Advanced technique: sealing regions

Green’s Theorem is powerful enough that it can be handy even if the path 𝒞︀ is not a closed loop: the idea is to “seal” the loop by adding some simple path, for which the line integral is easy to calculate. To show this technique, we bring back the first example from Section 33.4 all the way back when we first introduced how to compute work with bare hands.

Sample Question
Compute the line integral of the vector field 𝐅(𝑥,𝑦)=(2𝑦3𝑥) along the upper half of the circle 𝑥2+𝑦2=1, oriented counterclockwise. See Figure 88.

We already saw that we could compute this using bare-hands parametrization. Now we’ll show how to use Green’s Theorem as a shortcut by adding the line segment from (−1,0), to (1,0).

Figure 88: Evaluation of ∫𝒞︀𝐅⋅d𝐫 by “sealing” the region, adding in a line segment joining (−1,0) to (1,0). The line integral across the segment is easy to compute (it equals zero, since the force is perpendicular to it.) Then Green’s theorem applies to the sealed region ℛ︀.

Solution. Let 𝒞︀ denote the semicircle. Because 𝒞︀ is not a closed loop, Green’s Theorem does not apply directly. To use it, we instead add a new line segment 𝒞︀lid pointing from (−1,0) to (1,0). Then if we consider both 𝒞︀ and the new lid 𝒞︀lid, they enclose the upper half of a disk ℛ︀ with area 𝜋2, as shown in Figure 88. Hence Green’s Theorem on the two-part boundary states that

∫𝒞︀(2𝑦d𝑥+3𝑥d𝑦)⏟what we want+∫𝒞︀lid(2𝑦d𝑥+3𝑥d𝑦)=∬ℛ︀(𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦)d𝐴=∬ℛ︀(𝜕𝜕𝑥(3𝑥)−𝜕𝜕𝑦(2𝑦))d𝐴=∬ℛ︀(3−2)d𝐴=∬ℛ︀d𝐴=Area(ℛ︀)=𝜋2.

On the other hand, I claim that

∫𝒞︀lid(2𝑦d𝑥+3𝑥d𝑦)=0.

This is easy to compute with direct parametrization: if we parametrize the lid by 𝐫(𝑡)=(𝑡,0) for −1≤𝑡≤1, for example, then

∫𝒞︀lid(2𝑦d𝑥+3𝑥d𝑦)=∫𝑡=−11(2⋅03⋅𝑡)⋅𝐫′(𝑡)d𝑡=∫𝑡=−11(03𝑡)⋅(10)d𝑡=∫𝑡=−110d𝑡=0.

Indeed one can even see it from Figure 88 directly, since the vector field is perpendicular to the 𝑥-axis along the entire lid, so the total work being 0 is not a surprise. Thus, the desired line integral is

∫𝒞︀(2𝑦d𝑥+3𝑥d𝑦)⏟what we want=∬ℛ︀(𝜕𝑞𝜕𝑥−𝜕𝑝𝜕𝑦)d𝐴−∫𝒞︀lid(2𝑦d𝑥+3𝑥d𝑦)=𝜋2−0=𝜋2.

□

§34.7 [EXER] Exercises

Exercise 34.1. Is the vector field

𝐅(𝑥,𝑦)=(sin(𝑒𝑥)arctan(𝑦𝜋+𝜋𝑦))

conservative?

Exercise 34.2. Calculate the line integral

∮𝒞︀(𝑥2−𝑦)d𝑥+(𝑦2−𝑥)d𝑦

where 𝒞︀ is the boundary of the region enclosed by the circle 𝑥2+𝑦2=4, oriented counterclockwise.

Exercise 34.3 (Suggested by Ting-Wei Chao). As in Exercise 33.1, let 𝒞︀ be the oriented closed curve formed by the arc of the parabola 𝑦=𝑥2−1 running from (−1,0) to (1,0), followed by a line segment from (1,0) back to (−1,0). Again let

𝐅(𝑥,𝑦)=(𝑥2(𝑦+1)(𝑦+1)2).

Compute ∫𝒞︀𝐅⋅d𝐫 this time using Green’s Theorem.

Exercise 34.4 (*) (Shoelace formula). Let 𝑛≥3 be an integer and suppose 𝒫︀=𝑃1𝑃2…𝑃𝑛 is a convex 𝑛-gon in ℝ2, where the vertices 𝑃𝑖=(𝑥𝑖,𝑦𝑖) are labeled counterclockwise. Use Green’s theorem to prove the following formula for the area of 𝒫︀:

Area(𝒫︀)=12∑𝑖=0𝑛−1(𝑥𝑖𝑦𝑖+1−𝑥𝑖+1𝑦𝑖).

Here 𝑥0=𝑥𝑛 and 𝑦0=𝑦𝑛 by convention, so the 𝑖=0 summand is 𝑥𝑛𝑦1−𝑥1𝑦𝑛.