A field is a gradient field when its line integral depends only on the endpoints, equivalently when it vanishes around every closed path; then the integral is the change of a potential, equal mixed partials are a necessary test that is also enough on a convex set, and the angle field on the punctured plane shows why it is not enough in general.
Taught in 375/376Apostol, not taughtBeyond the courseApostol Vol. 2, 10.10 to 10.20 and 11.21MATH 376 Weeks 2 and 3: worksheets 5, 6, 10 and 27, homework 2 problems 4 and 5, homework 3 problem 1, homework 5 problem 4.1, Midterm 1 problem 1, Final problems 1(a) and 3, the lecture of 4 FebruaryGreen, An Essay on the Application of Mathematical Analysis to the Theories of Electricity and Magnetism (1828)
When does a line integral depend only on where the path starts and where it ends? When it does, the integral is a difference of two values of a single function, and a whole curve can be replaced by two points. This chapter shows that this happens exactly for gradient fields, gives a test you can compute, shows by an example where the test lies, and finishes with the physics (energy) and the differential equations that use it. It is the most heavily tested topic of the first half of MATH 376.
Before you start
6.1: the line integral, closed paths, reversing a path flips the sign. 5.5: for a C2 function the mixed partials are equal. 4.4: path-connected sets. 5.3: the derivative of f(r(t)).
Quick checkIf φ is C2, how are φxy and φyx related?
That is the equality of mixed partials of 5.5, which needs continuous second partials. It is the engine of the test in this chapter.Review: equality of mixed partials
Quick checkFor F=(y,−x) the integral from (1,0) to (0,1) is −1 along the segment and −π/2 along the quarter circle. What does this show?
Same endpoints, different values, so the line integral is not determined by the endpoints for this field. By the end of this chapter you will know that such a field cannot be a gradient.Review: line integrals
Quick checkIs the plane with the origin removed path-connected?
If the segment between two points passes through the origin, go to a third point off the line and then on. A hole does not disconnect the plane; it changes something subtler, which is the subject of this chapter.Review: path-connected
The picture: when the endpoints are all that matter
The field is F=(y,x), the gradient of xy. Walk the three paths from A to B: the three graphs of work so far wiggle differently but end at the same height. Now switch to F=(y,−x). The totals come apart. The first kind of field is a gradient field. In the second kind, the work you get depends on the road you take.
The idea, in words
A scalar function φ is a landscape. Its gradient ∇φ points uphill, with size equal to the steepness. Walking along a path, the work of the field ∇φ is the amount of height gained: the field pushes you with the steepness times the distance, which is exactly the climb. So it does not matter which road you take, only where you start and where you end. Walk a closed loop, and you return to the height you left, so the total is 0.
Why· Why some fields are not gradients
A swirl does not have a landscape. In the field (y,−x) you can walk around a loop and be pushed the same way the whole time. That would mean climbing at every step and returning to the start, which no landscape allows. The most important example is the angle field of the punctured plane, which has equal mixed partials everywhere and yet is not a gradient: its ‘landscape’ would be the angle θ itself, and the angle goes up by 2π every time you go round the origin, like a spiral staircase.
Where this came from· Green and the word 'potential'
George Green, a Nottingham baker’s son who worked in the family mill and was largely self-taught, published An Essay on the Application of Mathematical Analysis to the Theories of Electricity and Magnetism in 1828, privately and by subscription; about fifty people subscribed. In it he introduced the word ‘potential’ for the function obtained by adding up the masses (or charges) of a system, each divided by its distance from a given point. The force is the gradient of that function. The essay was almost unknown until William Thomson, later Lord Kelvin, found it around 1845 and had it reprinted in Crelle’s journal. The same essay contains the integral identity now called Green’s theorem, taken up in 6.4.
Gradient fields and potentials
Definition T
Gradient field
A vector field F on S is a gradient field (the worksheets say conservative field) if there is a scalar field φ with ∇φ=F on all of S. In the plane, with F=(P,Q), this means φx=P and φy=Q.
In one lineA vector field F on a set S is a gradient field if there is a function φ:S→R with ∇φ=F at every point of S.
Why it existsIt says the field is the steepness of a landscape, which is what makes its line integral a change in height.
Definition T
Potential
A function φ with ∇φ=F is a potential (or potential function) of F. It is never unique: adding a constant gives another. On a connected open set that is the only freedom, because two potentials differ by a function with zero gradient, and a function with zero gradient on a connected open set is constant (4.4).
In one lineA potential of F is a function φ with ∇φ=F on the whole domain of F.
Why it existsIt is the landscape: knowing it replaces the whole field by one function, and line integrals by differences of that function.
Definition T
Path independence
The line integral of F is independent of the path in S if for any two piecewise smooth paths in S with the same start and the same end, the integrals of F along them are equal. A set S is connected in this chapter if any two of its points are joined by a piecewise smooth path inside S; for an open set this agrees with 4.4, because the proof there joins points by chains of straight segments.
In one lineThe line integral of F is independent of the path in S if any two piecewise smooth paths in S with the same start and the same end give the same value.
Why it existsIt is the property that lets us write the integral as a function of two points only.
The second fundamental theorem: evaluate with the endpoints
Theorem TApostol Thm 10.3; MATH 376 lecture of 4 February
Second fundamental theorem for line integrals
Let S be open, φ a C1 scalar field on S, and F=∇φ. For every piecewise smooth path r:[a,b]→S lying in S,
∫rF⋅dr=φ(r(b))−φ(r(a)).
In one lineIf F=∇φ on an open set S with φ of class C1, then for any piecewise smooth path r:[a,b]→S, ∫rF⋅dr=φ(r(b))−φ(r(a)).
Why it is trueIt turns a line integral into a subtraction of two numbers, so the path is irrelevant and you may swap a hard path for an easy one.
ProofMATH 376 lecture of 4 February; Apostol 10.11
The idea: On each smooth piece the chain rule says that phi along the path has derivative F dotted with the velocity, so the integrand is the derivative of phi along the path and the fundamental theorem of calculus evaluates it. The pieces telescope.
On a smooth piece, dtdφ(r(t))=∇φ(r(t))⋅r′(t).
The chain rule for a scalar field along a path (5.3); it applies because φ is C1 (so differentiable) and r is differentiable on the piece [tj−1,tj].
∇φ(r(t))=F(r(t)), so dtdφ(r(t))=F(r(t))⋅r′(t).
The hypothesis ∇φ=F holds at every point of S, and the whole path lies in S.
∫tj−1tjF(r(t))⋅r′(t)dt=φ(r(tj))−φ(r(tj−1)).
Part 2 of the fundamental theorem of calculus, for the continuous function t↦F(r(t))⋅r′(t) on the piece, whose antiderivative is φ∘r.
Add over j=1,…,m: the sum telescopes to φ(r(tm))−φ(r(t0)).
The end value of one piece is the start value of the next, because r is continuous at the break points.This is where the continuity of the whole path is used.
So ∫rF⋅dr=φ(r(b))−φ(r(a)). ■
tm=b and t0=a.
Proof workshopGive the reason for each line: the second fundamental theoremApostol 10.11
Each line of the proof is shown in order. Choose the reason that justifies it, then press Check.
dtdφ(r(t))=∇φ(r(t))⋅r′(t) on each smooth piece.
∇φ(r(t))=F(r(t)).
∫tj−1tjF(r(t))⋅r′(t)dt=φ(r(tj))−φ(r(tj−1)).
Adding over the pieces gives φ(r(tm))−φ(r(t0)).
What fails without each hypothesis.
F=∇φ on all of the path. On the punctured plane the angle field x2+y2(−y,x) is the gradient of the polar angle θ on each small piece, but θ cannot be a single-valued function around a loop. Around the unit circle the formula would give φ(end)−φ(start)=0, while the true integral is 2π.
The path stays inside S. If the path leaves the set where φ is defined, for example through a singular point of φ, the chain rule step has no meaning. This is why the homework below insists that the path avoids the origin.
φ is C1. The chain rule needs a differentiable φ, and F=∇φ is then continuous.
The path is continuous. The telescoping step uses that the pieces join.
Quick checkF=∇φ on all of R2, and a path goes from A to B along a very complicated curve. What is ∫F⋅dr?
End minus start, for any piecewise smooth path in the domain. The answer is 0 only if the path is closed. 'Depends on the curve' is the behaviour of a field that is not a gradient.
Worked example MATH 376 worksheet 5 exercise 2
Compute ∫CF⋅dr for F=(3x2y+1,x3+2y) from (0,0) to (1,2), using the potential φ=x3y+x+y2, and check along a path.
Solution.
Check the potential.φx=3x2y+1 and φy=x3+2y, which are the two components of F. Verifying ∇φ=F is the hypothesis of the theorem. Do it before using φ.
Evaluate at the ends.φ(1,2)=1⋅2+1+4=7 and φ(0,0)=0. Substitute the endpoints; do not parametrize.
Subtract.∫CF⋅dr=7−0=7. The second fundamental theorem: end minus start.
Check with a path. Along r(t)=(t,2t) we have F=(6t3+1,t3+4t) and r′=(1,2), so F⋅r′=8t3+8t+1 and ∫01(8t3+8t+1)dt=2+4+1=7. Any path from (0,0) to (1,2) gives the same value.
Answer.7.
Worked example MATH 376 worksheet 6 parts B and C
With F=(2xy3+1,3x2y2) (a potential is φ=x2y3+x), compute (B) the integral along r(t)=(t2+sinπt,t3+cosπt), 0≤t≤1, and (C) the integral along the parabola y=(x−1)2 from (1,0) to (2,1), by switching to an easier path.
Solution.
(B) Find the exact endpoints.r(0)=(0+sin0,0+cos0)=(0,1) and r(1)=(1+sinπ,1+cosπ)=(1,0). sin0=0, cos0=1, sinπ=0, cosπ=−1. A wrong value of one of these changes the answer, so write them out.
(B) Subtract.φ(1,0)−φ(0,1)=(0+1)−(0+0)=1.
(C) Replace the path. Use L1 from (1,0) to (2,0) and then L2 from (2,0) to (2,1). Same start and end, and the new path lies in R2, the domain of F. Path independence says the integral is unchanged.
(C) On L1:y=0, dy=0, F=(1,0), so ∫121dx=1. On L2:x=2, dx=0, F=(4y3+1,12y2), so ∫0112y2dy=[4y3]01=4.
Check with the potential.φ(2,1)−φ(1,0)=(4+2)−(0+1)=5.
Answer. (B) 1 and (C) 5.
Worked example MATH 376 homework 2 problem 5
The field f=∇φ with φ(x)=−1/∥x∥ on Rn minus the origin. A path from (21,0,…,0) to (1,0,…,0) avoids the origin. Compute ∫f⋅dr.
Solution.
Lengths of the endpoints.∥(1,0,…,0)∥=1 and ∥(21,0,…,0)∥=21. A vector with a single non-zero coordinate has length equal to that coordinate.
Potential values.φ(end)=−1 and φ(start)=−2.
Subtract.−1−(−2)=1. The second fundamental theorem. It applies because the path stays in the domain of φ; the potential is singular at the origin, which is why the problem says the path avoids it.
Answer.1.
Worked example MATH 376 Final problem 3; see [A.4](/vol2/a4-final/)
Let C be the unit circle in the plane z=0, counterclockwise, parametrized by α:[0,1]→R3, and F=(yzcos(xyz),xzcos(xyz),xycos(xyz)). Compute ∮CF⋅dα.
Solution.
Recognize a gradient.∇sin(xyz)=(yzcos(xyz),xzcos(xyz),xycos(xyz)). The chain rule on sin(xyz): the x-derivative is cos(xyz)⋅yz, and so on. So F=∇φ with φ=sin(xyz), defined and C1 on all of R3.
The path is closed.α(1)=α(0). A circle returns to its start.
Apply the theorem.∮CF⋅dα=φ(α(1))−φ(α(0))=0. Equal endpoints, so the difference is 0.
Answer.0. A second method needs no theorem: on C we have z=0, so F=(0,0,xy) along the circle and the velocity has third component 0, so F⋅dα=0 at every step. Do not use Stokes’ theorem by replacing F with its values on the plane before taking a curl; see the trap below.
The first fundamental theorem: build a potential
Theorem TApostol Thm 10.4; MATH 376 lecture of 4 February
First fundamental theorem for line integrals
Let S be open and connected, F continuous on S, and suppose the line integral of F is independent of the path in S. Fix p∈S and define φ(x)=∫pxF⋅dr, the line integral along any piecewise smooth path in S from p to x. Then φ is C1 and ∇φ=F.
In one lineIf S is open and connected, F is continuous and its line integral is independent of the path, then φ(x)=∫pxF⋅dr (from a fixed base point p) is a C1 function with ∇φ=F.
Why it is trueIt says path independence is enough to produce a potential, and gives a formula for it: integrate along any path from a base point.
ProofMATH 376 lecture of 4 February; Apostol 10.14
The idea: To find the partial derivative in direction e_i, extend a path from p to x by a short segment in direction e_i. The difference of potentials is the integral of the i-th component along that segment, which is an average of a continuous function and tends to its value at x.
Fix x∈S and a coordinate i. The value φ(x) is defined.
S is connected, so a path from p to x exists; independence of the path means all such paths give the same number, so φ(x) is well defined.
For 0<∣h∣<δ, the segment σ(s)=x+sei, s from 0 to h, lies in S.
S is open: choose δ>0 with the ball of radius δ about x inside S. Every point x+sei with ∣s∣≤∣h∣<δ is within ∣h∣ of x.
φ(x+hei)=φ(x)+∫0hF(x+sei)⋅eids.
A path from p to x followed by σ is a path in S from p to x+hei; independence of the path lets us compute φ(x+hei) along it. Additivity splits the integral, and σ′=ei.
hφ(x+hei)−φ(x)=h1∫0hFi(x+sei)ds.
Dotting with ei picks out the i-th component. Then move φ(x) across and divide by h.
As h→0 the right side tends to Fi(x).
Fi is continuous at x: given a tolerance ϵ, the values Fi(x+sei) are within ϵ of Fi(x) once ∣h∣ is small, so their average over [0,h] is too.
So ∂iφ(x)=Fi(x) for every i, the partials are continuous, and ∇φ=F. ■
The left side is the definition of the partial derivative; then a function with continuous partial derivatives is C1.
What fails without each hypothesis. Without path independence, φ(x) depends on the path chosen, so it is not a function. Without connectedness, there is no path from p to points of other pieces, and φ is defined on one piece only (build one potential per piece). Without openness, the proof cannot step a little in each direction. Without continuity of F, the last limit fails.
Three descriptions of the same thing
Theorem TApostol Thm 10.5; MATH 376 lecture of 4 February
Three equivalent descriptions of a gradient field
Let S⊆Rn be open and connected, and F:S→Rn continuous. The following are equivalent. (a) F is the gradient of a potential function in S. (b) The line integral of F is independent of the path in S. (c) The line integral of F is 0 along every closed piecewise smooth path in S.
In one lineFor a continuous field on an open connected set, (a) F is a gradient, (b) its line integral is independent of the path, and (c) its line integral around every closed piecewise smooth path is 0, are equivalent.
Why it is trueIt lets you test for a gradient field in whichever of three ways is easiest: find a potential, compare two paths, or check one closed path.
The proof goes in a circle: (b) implies (a) is the first fundamental theorem, (a) implies (c) is the second fundamental theorem with equal endpoints (φ(r(b))−φ(r(a))=0 when r(b)=r(a)). It remains to show that (c) implies (b).
ProofMATH 376 lecture of 4 February; Apostol 10.15
The idea: Given two paths with the same ends, run the first forward and the second backward: that is a closed path, its integral is 0, and the integral of the backward path is minus the integral of the second.
Define the combined path γ.
Let α:[a,b]→S and β:[c,d]→S be piecewise smooth paths from p to p′. Run α forward, then β backward: γ(t)=α(t) on [a,b] and γ(t)=β(b+d−t) on [b,b+d−c].
γ is a closed piecewise smooth path in S.
α(b)=p′=β(d)=β(b+d−b), so the pieces meet; γ starts at α(a)=p and ends at β(c)=p; and both parts are piecewise smooth.
0=∫γF⋅dγ.
Hypothesis (c) applied to γ.
0=∫αF⋅dα−∫βF⋅dβ.
Additivity over the two parts of γ, then reversing a path flips the sign of the line integral (6.1).
So ∫αF⋅dα=∫βF⋅dβ: the integral depends only on the end points. ■
Move one term across. The paths α and β were arbitrary paths with the same ends.
Proof workshopRebuild the proof that zero around closed paths gives path independenceMATH 376 lecture of 4 February
Tap the lines in the order a proof would write them. Each line can only use what is already above it.
These are two arbitrary paths with the same start and the same end; we must show they give the same integral.
The new path starts at p, reaches p' along alpha, and returns to p along beta reversed.
You need the two paths named before you can combine them.
The pieces meet at p', and it starts and ends at p; a combination of piecewise smooth paths is piecewise smooth.
You need gamma defined before you can say something about it.
The assumption is that the integral around every closed piecewise smooth path in S is zero.
The hypothesis applies only once gamma is known to be a closed piecewise smooth path.
Split the integral over gamma into its two parts and use that reversing a path flips the sign.
The integral over gamma is zero by hypothesis; this line splits it.
Move the second term across; alpha and beta were arbitrary.
This is the conclusion; it needs the difference to be zero.
Notice what the theorem does not say. Zero around some closed paths, even around infinitely many, is not enough: the field F=(x,xy) has ∮F⋅dr=0 around every circle centred at the origin (Apostol’s note), and yet it is not a gradient, because Py=0=y=Qx. Condition (c) must hold for every closed path.
Worked example MATH 376 worksheet 5 exercise 4
Let F=(y2,x). (a) Is it a gradient field? (b) Compute ∫F⋅dr from (0,0) to (1,1) along C1, the line y=x, and along C2, the path that goes right along the x-axis to (1,0) and then up to (1,1).
Solution.
(a) Use the test.Py=2y and Qx=1, which differ at, for example, (0,0). So F is not a gradient field (the test is proved below). One point where the mixed partials differ is enough.
(b) C1.r1=(t,t), r1′=(1,1), F(r1)=(t2,t), so ∫01(t2+t)dt=31+21=65.
(b) C2, first leg.r=(t,0), r′=(1,0), F=(0,t), so F⋅r′=0 and the integral is 0.
(b) C2, second leg.r=(1,t), r′=(0,1), F=(t2,1), so ∫011dt=1.
Add the legs.0+1=1.
Answer.65 along C1 and 1 along C2: the integral is path dependent, so condition (b) fails and F is not a gradient. Two paths with different values prove ‘not a gradient’ even when the mixed partials are hard to compare.
Worked example MATH 376 homework 2 problem 4 (parts (b) and (d), the disc and the annulus, are in the ladder)
Decide which of these sets are connected, and describe the paths: (a) x2+y2≥0; (c) x2+y2>0; (e) x2+y2>1 and (x−3)2+y2>1; (f) x2+y2<1 or (x−3)2+y2<1.
Solution.
(a) The whole plane. Connected: the segment r(t)=(1−t)P+tQ joins P to Q and lies in the set. Every point of the plane is in the set.
(c) The plane minus the origin. Connected. If the segment PQ misses the origin, use it. If it contains the origin, pick R off the line PQ and use the segments PR then RQ. The line PR meets the line PQ only at P, which is not the origin, so PR misses the origin; the same for RQ.
(e) The plane minus two closed unit discs. Connected. From P go vertically to height +10 (if yP≥0) or −10, then horizontally to x=6, then to the matching height for Q, then horizontally and vertically to Q. The discs lie in ∣y∣≤1, so the lines y=±10 miss them, and the line x=6 misses both. A disc centred on the x-axis meets a vertical line in a chord symmetric about y=0, so a point above (below) the chord can climb (descend) without entering the disc.
(f) Two disjoint open discs. Not connected. Suppose a path (x(t),y(t)) in the set joined a point of the first disc to a point of the second. Then x(t) is continuous, starts below 1 and ends above 2, so by the intermediate value theorem x(t)=1.5 for some t. But 1.5 is not in (−1,1)∪(2,4), the possible x-values: a contradiction. The same reasoning as ‘a continuous image of a connected set is connected’ in 4.4, in plain form.
Answer. (a), (c), (e) are connected; (f) is not. Connectedness is what the first fundamental theorem needs.
A test you can compute
The three descriptions concern every path in S, which cannot be checked directly. A test with derivatives can.
Theorem TApostol Thm 10.6; MATH 376 worksheet 5
Necessary condition for a gradient
Let F=(f1,…,fn) be C1 on an open set S. If F is a gradient on S, then Difj=Djfi on S for all i,j. In the plane, F=(P,Q): ∂y∂P=∂x∂Q. In space with F=(P,Q,R) there are three pairs: Py=Qx, Pz=Rx, Qz=Ry; equivalently the curl (Ry−Qz,Pz−Rx,Qx−Py) is the zero vector.
In one lineIf F=(f1,…,fn) is C1 on an open set and is a gradient, then ∂fi/∂xj=∂fj/∂xi for all i,j; in the plane, Py=Qx.
Why it is trueIt is a two-line computation that proves a field is not a gradient the moment one pair of mixed partials differs.
ProofApostol 10.16
The idea: If F is the gradient of phi, the components are first partials of phi, and the condition says the mixed second partials of phi agree, which they do by the equality of mixed partials.
Suppose F=∇φ for a function φ on S.
F=∇φ means fi=Diφ.
Then Djfi=DjDiφ and Difj=DiDjφ.
F is C1, so the first partials of φ are C1, which makes φ of class C2 (5.5).
DjDiφ=DiDjφ, so Djfi=Difj. ■
Equality of mixed partials for a C2 function (5.5).
The condition is only necessary. Failing it proves that F is not a gradient. Passing it proves nothing by itself, as the angle field shows in a moment. State ’F is C1’ when you use the test, because the equality of mixed partials needs continuity of the second partials (there are functions whose mixed partials exist and differ at a point).
Worked example MATH 376 homework 3 problem 1
Which of these fields on R2 are gradient fields? (1) f=2ex12+x22(x1,x2); (2) f=(cos(x12+x2),sinx2); (3) f=(x12+x2,x24+x1); (4) f=(ex12+x2,x1+x22).
Solution.
The domain. Each field is C1 on R2, which is convex. So the test ∂x2f1=∂x1f2 decides both ways (the convex-set theorem below).
(1)f1=2x1ex12+x22, f2=2x2ex12+x22. Then ∂x2f1=4x1x2ex12+x22=∂x1f2. A gradient field; a potential is φ=ex12+x22. ∇φ=ex12+x22(2x1,2x2)=f.
(2)∂x2f1=−sin(x12+x2) and ∂x1f2=0. At (0,π/2) the first is −1. Not a gradient field. One point of difference is enough.
(3)∂x2f1=1=∂x1f2. A gradient field; φ=3x13+x1x2+5x25 is a potential.
(4)∂x2f1=ex12+x2 and ∂x1f2=1. At (0,1) they are e and 1. Not a gradient field.
Answer. (1) and (3) are gradient fields; (2) and (4) are not.
Worked example MATH 376 practice Midterm 1 problem 1(b); see [A.5](/vol2/a5-practice-exams/)
Does f(x,y)=(1+x22xy,y2) have a potential function on R2?
Solution.
Smoothness.f1 is a quotient of polynomials with a denominator that is never 0, and f2 is a polynomial. So f is C1 on R2. The test needs C1.
Mixed partials.∂yf1=1+x22x and ∂xf2=0. y2 does not depend on x.
Compare.1+x22x=0 for x=0. They agree only on the line x=0.
Answer. No. If a potential existed, it would be C2, its mixed partials would agree, and they do not. (The definition asked in part (a): φ is a potential of f if ∇φ=f, that is φx=f1 and φy=f2 at every point of R2.)
Worked example MATH 376 worksheet 6, the curl test
Is F=(yz,xz,xy+2z) conservative on R3?
Solution.
First component of the curl.∂y(xy+2z)−∂z(xz)=x−x=0. Ry−Qz.
Second.∂z(yz)−∂x(xy+2z)=y−y=0. Pz−Rx.
Third.∂x(xz)−∂y(yz)=z−z=0. Qx−Py.
Conclude. The curl is zero on R3, which is convex, so F is conservative. The sufficient condition on a convex set, proved next.
Answer. Yes. A potential is φ=xyz+z2: φx=yz, φy=xz, φz=xy+2z.
Quick checkWhile building a potential for F=(P,Q) you reach g′(y)=2xy. What do you conclude?
The 'constant' g of the x-integration is a function of y alone, so its derivative cannot contain x. A surviving x means an algebra slip, or that Py=Qx.
When equal mixed partials are enough
Definition T
Convex set
A set S is convex if the segment between any two of its points stays in S. Discs, rectangles, half planes and the whole plane or space are convex; an annulus is not.
In one lineA set S is convex if for any two points p,q in S, the whole segment (1−t)p+tq, 0≤t≤1, lies in S.
Why it existsConvexity lets you draw a straight line from one fixed point to any other point of the set, which is the path used to build a potential by an explicit formula.
Theorem TApostol Thm 10.9; MATH 376 week 3
Equal mixed partials suffice on a convex set
Let S be open and convex, F=(P,Q) of class C1 on S with Py=Qx on S. Then F is a gradient field on S. In space the same holds if all three pairs of mixed partials agree.
In one lineIf S is open and convex, F=(P,Q) is C1 on S and Py=Qx, then F is a gradient field on S; in space the same holds when the curl is zero.
Why it is trueIt turns the practical test into an if and only if on the domains that occur in most problems: the plane, space, discs and boxes.
ProofApostol 10.21 (the Poincare lemma); MATH 376 week 3
The idea: Move coordinates so that the origin is in S. Define phi by integrating F along the straight segment from the origin to the point. Differentiate under the integral sign; the hypothesis P_y = Q_x makes the integrand into the derivative of t times P, which integrates to P.
Define φ(x,y)=∫01[xP(tx,ty)+yQ(tx,ty)]dt.
The segment r(t)=(tx,ty) lies in S because S is convex. Here r′=(x,y), so F(r(t))⋅r′(t)=xP(tx,ty)+yQ(tx,ty).
φx=∫01[P+xtPx+ytQx]dt.
Differentiate under the integral sign (allowed because the integrand and its x-derivative are continuous in (x,t) when P,Q are C1; the rule is proved in analysis). The product rule on xP(tx,ty) gives P+xtPx, and on yQ(tx,ty) gives ytQx, with P,Px,Qx evaluated at (tx,ty).
φx=∫01[P+t(xPx+yPy)]dt.
Replace Qx by Py. This is the one place the hypothesis Py=Qx is used.
The integrand is the derivative of tP(tx,ty), so φx=[tP(tx,ty)]t=0t=1=P(x,y).
Product rule and chain rule: dtd[tP(tx,ty)]=P+t(xPx+yPy).
Likewise φy=Q(x,y), so ∇φ=F. ■
The same calculation with the roles exchanged: differentiate in y, replace Py by Qx, and recognize dtd[tQ(tx,ty)].
Definition A
Simply connected set
An open connected set S in the plane is simply connected (Apostol 11.21) if for every simple closed curve in S, the region inside the curve (in the sense of 6.4) also lies in S. Intuitively, S has no holes. The plane and every convex set are simply connected. A disc with the centre removed, or an annulus, or the plane with the origin removed, is not.
In one lineAn open connected set in the plane is simply connected if it has no holes: every simple closed curve in it encloses a region lying entirely inside the set.
Why it existsIt is the exact condition on the domain that makes equal mixed partials sufficient, and the punctured plane is the standard set that fails it.
Theorem AApostol Thm 11.11
Equal mixed partials suffice on a simply connected set
Let S be an open simply connected set in the plane and F=(P,Q) a C1 field on S. Then F is a gradient on S if and only if Py=Qx everywhere on S. The proof cuts the region between two paths with equal ends into pieces bounded by simple closed curves and applies Green’s theorem to each (6.4); the lecture stated the result without proof in the first weeks.
In one lineIf S is open and simply connected in the plane and F=(P,Q) is C1 with Py=Qx, then F is a gradient on S.
Why it is trueIt extends the test from convex sets to every domain without holes, such as a simply connected region with a curved boundary.
The angle field: equal mixed partials, no potential
Worked example MATH 376 worksheet 5 exercise 3
Let F=x2+y2(−y,x) on R2 minus the origin. (a) Show Py=Qx. (b) Compute ∮F⋅dr around the unit circle. (c) Why is there no contradiction with the theorem that gradient fields have integral zero around closed curves?
Solution.
(a) Name the parts.P=x2+y2−y and Q=x2+y2x; both are C1 away from the origin. The denominator is 0 only at the origin.
(a) Differentiate.Py=(x2+y2)2−(x2+y2)+y⋅2y=(x2+y2)2y2−x2 and Qx=(x2+y2)2(x2+y2)−x⋅2x=(x2+y2)2y2−x2. Quotient rule on each.
(a) Compare. They are equal at every point of the domain. So the necessary condition holds.
(b) Parametrize.r(t)=(cost,sint), 0≤t≤2π, r′=(−sint,cost), and F(r(t))=(−sint,cost). On the unit circle x2+y2=1.
(b) Dot and integrate.F⋅r′=sin2t+cos2t=1, so ∮F⋅dr=∫02π1dt=2π.
(c) Explain. The theorem says a gradient field has integral 0 around closed paths, so condition (c) fails and F is not a gradient field on this domain. The converse ‘equal partials implies gradient’ needs a convex or simply connected domain, and the punctured plane has a hole at the origin. There is no contradiction.
Answer.Py=Qx; the circulation is 2π; F is not a gradient on the punctured plane. Locally it is: on the right half plane φ=arctan(y/x) has φx=P and φy=Q, and φ is the polar angle. Going once round the origin the angle increases by 2π, so no single-valued potential exists on the whole punctured plane.
Worked example MATH 376 homework 5 problem 4.1
True or false: a C2 field on its domain in R3 with curlF=0 is a gradient field. Give a proof or a counterexample.
Solution.
Guess it is false without a condition on the domain. Take F=x2+y2(−y,x,0) on D=R3 minus the z-axis. The angle field extended to space; it is undefined on the whole axis.
Compute the curl.Ry−Qz=0 and Pz−Rx=0 because P,Q do not depend on z and R=0; and Qx−Py=(x2+y2)2y2−x2−(x2+y2)2y2−x2=0. The two-variable computation above.
A closed path.r(t)=(cost,sint,0) lies in D and goes round the z-axis, with F⋅r′=1, so ∮F⋅dr=2π=0. A gradient has zero circulation.
Answer. False. The correct statement needs a simply connected (for example convex) domain.
Why· The picture behind the angle field
The angle field is ‘the gradient of θ’ except that θ is not a function on the punctured plane: it has no consistent value, because turning once round the origin brings you back to the same point with θ increased by 2π. Locally, on any piece that does not circle the origin, you can pick a branch of θ, and the mixed-partials test sees only the local picture, so it passes. The line integral sees the global picture. Think of a spiral staircase: every small patch of it is a ramp, so slope is defined and consistent locally, but there is no height function on the floor plan because walking round the stair column brings you back to the same spot at a different level.
Python labThe angle field adds 2 pi for every lap around the origin, and nothing otherwise
import numpy as npc, s = np.cos, np.sindef lap(F, r, dr, laps=1, n=40000): t = np.linspace(0, 2 * np.pi * laps, n + 1); m = (t[:-1] + t[1:]) / 2 (x, y), (u, v) = r(m), dr(m); P, Q = F(x, y) return np.sum(P * u + Q * v) * (2 * np.pi * laps / n)def curve(cx, cy, a, b, w=1): # ellipse about (cx, cy); w = -1 runs it clockwise return (lambda t: (cx + a * c(t), cy + b * s(w * t)), lambda t: (-a * s(t), w * b * c(w * t)))angle = lambda x, y: (-y / (x**2 + y**2), x / (x**2 + y**2))grad = lambda x, y: (10 * x / (x**2 + y**2)**5, 10 * y / (x**2 + y**2)**5)both = lambda x, y: tuple(p + q for p, q in zip(angle(x, y), grad(x, y)))cases = [("unit circle", curve(0, 0, 1, 1), 1), ("circle off-centre", curve(0.5, 0, 1, 1), 1), ("ellipse 3 by 1", curve(0, 0, 3, 1), 1), ("circle missing origin", curve(3, 0, 1, 1), 1), ("unit circle clockwise", curve(0, 0, 1, 1, -1), 1), ("unit circle twice", curve(0, 0, 1, 1), 2)]print(f"{'':24s}{'angle field':>12s}{'gradient field':>16s}{'sum':>9s} (2*pi = {2 * np.pi:.4f})")for name, (r, dr), k in cases: print(f"{name:24s}" + "".join(f"{lap(F, r, dr, k):{w}.4f}" for F, w in ((angle, 12), (grad, 16), (both, 9))))
Try this.Run it. The angle field gives 2*pi = 6.2832 for every closed curve that goes once counterclockwise around the origin (the unit circle, an off-centre circle that still contains the origin, a 3 by 1 ellipse), 0 for a circle that misses the origin, -2*pi when the unit circle is run clockwise, and 4*pi when it is run twice. The shape of the curve does not matter, only how many times it winds round the missing point. The field 10 (x, y) (x^2+y^2)^-5 has a potential (-5/4 (x^2+y^2)^-4) and gives 0 on every curve here. Adding it to the angle field changes nothing: the last column equals the first. Try a curve of your own, for example a circle of radius 0.2 centred at (0.3, 0): does it enclose the origin?
Worked example MATH 376 Final problem 1(a), 4 points; see [A.4](/vol2/a4-final/)
Let f(x,y)=10(x,y)(x2+y2)−5 on R2 minus the origin. Verify that f has a potential function, and find it.
Solution.
The mixed partials.P=10x(x2+y2)−5 and Q=10y(x2+y2)−5. Then Py=10x⋅(−5)(x2+y2)−6⋅2y=−100xy(x2+y2)−6 and Qx=−100xy(x2+y2)−6. The chain rule on the power, with inner derivative 2y or 2x.
They are not enough here.Py=Qx, but the domain, the plane minus the origin, is not simply connected. The angle field also passes this test, and it has no potential. Another check is needed.
Integrate P in x. With u=x2+y2, 10xdx=5du, so ∫10x(x2+y2)−5dx=−45(x2+y2)−4, and φ=−4(x2+y2)45+g(y). Treat y as a constant during the substitution.
Match Q.φy=−45⋅(−4)(x2+y2)−5⋅2y+g′(y)=10y(x2+y2)−5+g′(y), which equals Q when g′=0.
Verify. With φ=−4(x2+y2)45: φx=10x(x2+y2)−5=P and φy=Q, and φ is C1 on the whole punctured plane. An explicit φ with ∇φ=f proves directly that f has a potential. This is the cleanest answer, and it needs no further argument.
Answer.φ(x,y)=−4(x2+y2)45. The instructor said afterwards (Piazza, post 23) that on this domain checking the mixed partials alone is not enough. Either exhibit a potential, as above, or check also that the integral around circles centred at the missing point is 0: here f⋅CR′=10R−10(−R2costsint+R2sintcost)=0, which he said suffices. (Why it suffices: for a C1 field with Py=Qx on the punctured plane, Green’s theorem on the region between a closed curve and a small circle about the origin shows that the integral around a simple counterclockwise loop that encloses the origin equals the integral around that circle. For a general closed curve it is the winding number of the curve about the origin times the integral around one circle (a fact proved in analysis courses, not here). See 6.4. So if the circles give 0, every closed curve gives 0, and condition (c) holds.)
Quick checkF=(P,Q) is C1 on the plane minus the origin and Py=Qx there. Which conclusion is justified?
The sufficient condition needs a convex or simply connected domain. The angle field has Py=Qx and no potential, while 10(x,y)(x2+y2)−5 has Py=Qx and a potential. The test alone cannot tell them apart.
Quick checkWhich domain is a place where equal mixed partials do NOT guarantee a potential?
The plane and a disc are convex. The punctured plane has a hole; the angle field lives there.
Where this came from· Ørsted, Ampère and the field that circles a wire
In 1820 Hans Christian Ørsted found that an electric current deflects a compass needle, and showed that the force circles the wire rather than pointing along it. Ampère, hearing the news in Paris, repeated and extended the experiments within weeks, showing among other things that two parallel wires attract or repel depending on the directions of their currents. The magnetic field of a long straight wire is exactly the angle field: it goes round the wire. In the early 1860s Maxwell added a term (the displacement current) to Ampère’s circuital law so that it fits with changing electric fields. The equal-partials-but-no-potential subtlety of this chapter is why the magnetic field of a current cannot be written as a gradient everywhere, while the electric field of static charges can.
Constructing a potential
Two variables
Test. Check Py=Qx and the domain. If the test fails, there is no potential. If it holds on a convex domain, there is one.
Integrate P in x:φ=∫Pdx+g(y). The ‘constant’ of integration is a function of y alone.
Match Q: differentiate in y and set φy=Q; solve for g′(y). The result must depend on y only.
Integrate g′ to find g; any constant is free.
Verify: compute φx and φy and check that they equal P and Q.
Worked example MATH 376 Midterm 1 problem 1, 9 points; see [A.2](/vol2/a2-midterm-1/)
Let f(x,y)=(2xy+excosy,x2−exsiny). (a) Write an explicit formula for a potential function and verify it. (b) Compute the line integral of f along α:[0,2π]→R2, α(t)=(t7et2(2π−t),sintesint).
Solution.
Test.P=2xy+excosy and Q=x2−exsiny. Then Py=2x−exsiny=Qx. Both are C1 on the convex set R2, so a potential exists.
Integrate P in x.φ=x2y+excosy+g(y).
Match Q.φy=x2−exsiny+g′(y) must equal x2−exsiny, so g′=0; take g=0.
Write the potential.φ(x,y)=x2y+excosy.
Verify, in writing.φx=2xy+excosy=P and φy=x2−exsiny=Q, so ∇φ=f. Graders give a separate part of the credit for this step. A correct potential with no justification that its gradient equals f lost 3 of the 7 points on the rubric.
(b) Use the endpoints.α(0)=(0,0⋅e0)=(0,0) and α(2π)=((2π)7e4π2⋅0,sin2πesin2π)=(0,0). The factor (2π−t) is 0 at t=2π and sin2π=0. Check which factor (2π−t) multiplies: here it stands outside the exponential.
Subtract. The path is closed, so ∫f⋅dα=φ(0,0)−φ(0,0)=0.
Answer. (a) φ=x2y+excosy (up to a constant). (b) 0, with no integration at all.
Worked example MATH 376 worksheet 27 problem 2; worksheet 5 exercises 1.1 and 1.2 are the same type
Is F=(2xy+3,x2+4y) conservative? Find a potential and compute ∫F⋅dr from (0,0) to (1,2).
Solution.
Test.Py=2x=Qx on the convex set R2. So F is conservative.
Integrate.φ=∫(2xy+3)dx=x2y+3x+g(y).
Match.φy=x2+g′(y)=x2+4y, so g′=4y and g=2y2.
Potential.φ=x2y+3x+2y2. Check: φx=2xy+3 and φy=x2+4y.
Evaluate.φ(1,2)=2+3+8=13 and φ(0,0)=0, so the integral is 13.
Answer. Conservative; φ=x2y+3x+2y2+C; the integral is 13. (Worksheet 5: (2xy+y2,x2+2xy) has φ=x2y+xy2, and (yex,ex+2y) has φ=yex+y2.)
Worked example MATH 376 practice Final problem 1; see [A.5](/vol2/a5-practice-exams/)
Let f(x,y)=(2xycos(x2y)esin(x2y),x2cos(x2y)esin(x2y)). (a) Verify that f has a potential and find it. (b) Compute ∫f⋅dα for α(t)=(t2−t,t3), 0≤t≤1.
Solution.
Spot the pattern. Let u=x2y, so ux=2xy and uy=x2. Then f=cosuesinu(ux,uy). Both components share the factor cosuesinu times the corresponding partial of u.
Guess a potential.φ=esinu=esin(x2y), since dudesinu=cosuesinu.
Verify. By the chain rule, φx=esinucosu⋅2xy=f1 and φy=esinucosu⋅x2=f2. So ∇φ=f on all of R2, which proves that a potential exists without comparing mixed partials, a longer product-rule computation.
Endpoints.α(1)=(0,1) and α(0)=(0,0).
Evaluate.φ(0,1)=esin0=1 and φ(0,0)=esin0=1, so the integral is 1−1=0.
Answer.φ=esin(x2y) and the integral is 0. (By the other route, integrating Q in y first with du=x2dy gives the same φ and is shorter than integrating P in x.)
Three variables
Test: all three pairs of mixed partials agree (curl =0) on a convex or simply connected domain.
Integrate P in x:φ=∫Pdx+g(y,z). Now the ‘constant’ can depend on y and z.
Match Q:φy=Q gives gy; integrate in y: g=∫gydy+h(z).
Match R:φz=R gives h′(z); integrate.
Verify all three partials.
Worked example MATH 376 worksheet 10 problem 2
Find the work done by F=(2xy,x2+z,y) moving from (0,0,0) to (1,2,3).
Solution.
Curl test.∂x(x2+z)=2x=∂y(2xy); ∂z(2xy)=0=∂x(y); ∂y(y)=1=∂z(x2+z). All three pairs match on the convex set R3, so a potential exists.
Integrate P in x.φ=x2y+g(y,z).
Match Q.φy=x2+gy=x2+z, so gy=z and g=yz+h(z).
Match R.φz=y+h′(z)=y, so h′=0; take h=0. Then φ=x2y+yz.
Verify.φx=2xy, φy=x2+z, φz=y.
Work.φ(1,2,3)−φ(0,0,0)=(2+6)−0=8.
Answer.8.
Your answerFind the work done by F=(yz+1,xz,xy+2z) in moving from (0,0,0) to (1,2,3).
Add x and z2 to the potential of the curl-test example, then evaluate at the two endpoints.
A potential is φ=xyz+x+z2 (φx=yz+1, φy=xz, φz=xy+2z). The work is φ(1,2,3)−φ(0,0,0)=(6+1+9)−0=16.
Your answerφ(x,y)=x2y+excosy is a potential for f=(2xy+excosy,x2−exsiny). What is ∫f⋅dr along any path from (0,0) to (1,π)?
Evaluate φ at both ends. Do not forget that φ(0,0) is not 0.
φ(1,π)=π+ecosπ=π−e and φ(0,0)=0+e0=1. End minus start: π−e−1≈−0.577.
A potential can also be built directly from the first fundamental theorem. On a domain where the broken line from a base point (0,0) to (x,0) to (x,y) stays inside, φ(x,y)=∫0xP(s,0)ds+∫0yQ(x,t)dt. For F=(2xy+y2,x2+2xy) this gives 0+∫0y(x2+2xt)dt=x2y+xy2, the same potential as above (Apostol 10.17).
Conservative forces and energy
Definition T
Potential energy
A force field with a potential φ (F=∇φ) is called conservative. The scalar −φ is its potential energy. In 3-space the level sets of φ are the equipotential surfaces (in the plane, equipotential lines); moving along one does no work, because F=∇φ is perpendicular to the level sets (5.3). Many physics books define F=−∇U, with U=−φ the potential energy; the two agree.
In one lineIf a force field F has a potential φ, the potential energy is −φ (Apostol's sign convention), so that kinetic plus potential energy stays constant.
Why it existsIt is the bookkeeping that turns the work-energy theorem into conservation of energy: what the particle gains in speed it loses in potential energy.
Theorem AApostol 10.6, example 2
The work-energy theorem
A particle of mass m moves along a path r(t) under a force field F, and its speed at time t is v(t)=∥r′(t)∥. Then ∫r(a)r(b)F⋅dr=21mv(b)2−21mv(a)2.
In one lineFor a particle of mass m moving under a force field F, the work done in a time interval equals the change in kinetic energy 21mv2.
Why it is trueIt links a line integral over space to a change of speed, and with a potential gives conservation of mechanical energy.
ProofApostol 10.6
The idea: Newton's second law says the force is m times the acceleration, so F dotted with the velocity is m times velocity dotted with acceleration, which is the derivative of one half m v squared. Integrate.
Write v(t)=r′(t) for the velocity vector, so F(r(t))=mv′(t).
Newton's second law: F(r(t))=mr′′(t).
F(r(t))⋅r′(t)=mv′(t)⋅v(t)=dtd(21m∥v(t)∥2).
Product rule: dtd(v⋅v)=2v⋅v′, and v⋅v=∥v∥2 is the squared speed.
Integrating from a to b gives ∫abF(r(t))⋅r′(t)dt=21m∥v(b)∥2−21m∥v(a)∥2. ■
The fundamental theorem of calculus.
If F=∇φ, the second fundamental theorem says that the same work is φ(r(b))−φ(r(a)). Equating the two, 21mv(b)2−φ(r(b))=21mv(a)2−φ(r(a)): kinetic plus potential energy is constant, the principle of conservation of mechanical energy, which is why such a field is called conservative. In a conservative field no net work is done around a closed path. Friction and viscosity are not conservative: they turn mechanical energy into heat, and the work they do around a loop is negative.
Worked example Apostol 10.12 (conservation of energy)
Gravity near the Earth is F=(0,0,−mg). Find a potential, the work done when a 60 kg hiker climbs from sea level to a hut at 2000 m by any route, and the speed of a 1 kg bead released from rest that slides down a frictionless wire from height 40 m to height 10 m.
Solution.
Potential.φ=−mgz, since ∇φ=(0,0,−mg). The potential energy is −φ=mgz.
Work of gravity on the hiker.φ(hut)−φ(start)=−mg⋅2000+0=−60⋅9.8⋅2000=−1.176×106 J. Negative: gravity opposes the climb. Only the height gained matters, not the zigzags of the route.
Energy for the bead. Kinetic energy gained equals potential energy lost: 21mv2=mg(40−10), so v=2g⋅30=588≈24.2 m/s. The mass cancels. The shape of the wire is irrelevant, as long as it is frictionless.
Answer.φ=−mgz; the work is about −1.18×106 J; the speed is about 24.2 m/s.
Your answerA roller-coaster car starts from rest at height 40 m and, ignoring friction, passes a point at height 10 m. What is its speed in m/s? Use g=9.8 m/s2.
The mass cancels from both sides of the energy equation.
Energy is conserved: 21v2=g(40−10), so v=2⋅9.8⋅30=588≈24.25 m/s.
Exact differential equations
Definition A
Exact differential equation
The equation P(x,y)dx+Q(x,y)dy=0 is exact on an open connected set S if the field (P,Q) is a gradient field on S, say ∇φ=(P,Q). Then every differentiable solution y=Y(x) satisfies φ(x,Y(x))=C for a constant C: the function g(x)=φ(x,Y(x)) has derivative φx+φyY′=P+QY′=0 by the chain rule. Conversely, if φ(x,y)=C defines y as a differentiable function of x, that function solves the equation (Apostol Thm 10.7).
In one lineA first-order equation P(x,y)dx+Q(x,y)dy=0 is exact if (P,Q) is a gradient field; then its solutions are the level curves φ(x,y)=C.
Why it existsIt solves a differential equation by finding a potential, so everything in this chapter becomes a method for first-order equations.
Worked example Apostol 10.19, using the field of MATH 376 worksheet 27 problem 2
Solve (2xy+3)dx+(x2+4y)dy=0 with y(0)=1.
Solution.
Recognize exactness.(P,Q)=(2xy+3,x2+4y) has Py=2x=Qx on R2, with potential φ=x2y+3x+2y2 from the example above. The equation is exact.
Write the solutions.x2y+3x+2y2=C.
Use the initial condition. At x=0, y=1: 0+0+2=C, so C=2. The equation 2y2=2 at x=0 gives y=±1; the condition picks y=1.
Solve for y if you like.2y2+x2y+(3x−2)=0, so y=4−x2+x4−8(3x−2), the branch with y(0)=416=1.
Answer.x2y+3x+2y2=2.
Where it is used
Used inside maths· Inside maths: closed versus exact
The statement ‘equal mixed partials but no potential’ is the first example of cohomology. A field with Py=Qx is called closed; a field with a potential is called exact; every exact field is closed, and on a convex set every closed field is exact, but on the punctured plane the angle field is closed and not exact. The extent to which closed fails to imply exact measures the holes of the domain, and the angle field, with circulation 2π, counts how many times a loop goes round the origin: the winding number of 6.4. In complex analysis the same field is the form dθ=Im(dz/z), where z=reiθ, and the fact that θ is not single valued is why logz has branches. Exact differential equations (above) turn the whole story into a method for ODEs; separable equations and equations with an integrating factor are special cases.
Used in the real world· Used in the real world: Ampère's law, escape speed and gradient descent
A long straight wire along the z-axis carrying a current I produces the magnetic field B=2πμ0Ix2+y2(−y,x,0): the angle field, scaled. Its size at distance ρ from the wire is μ0I/(2πρ); for I=10 A and ρ=1 cm this is 2π⋅0.014π×10−7⋅10=2×10−4 tesla. The circulation of B around any loop that goes once counterclockwise round the wire is μ0I=4π×10−6≈1.26×10−5 T·m, and around any loop that does not encircle the wire it is 0: this is Ampère’s circuital law, and the numerical lab above ran exactly this calculation. Since the circulation is not zero, B is not a gradient on the space outside the wire. Locally a ‘magnetic scalar potential’ φ=2πμ0Iθ exists, but it jumps by μ0I every lap.
For gravity, the potential of the Earth (mass M, radius R) outside it is φ=GMm/r, whose gradient is −GMmr/r3, Newton’s attraction. The work needed to lift a mass from the surface to infinity is φ(∞)−φ(R)=−GMm/R, so the escape speed solves 21mv2=GMm/R, giving v=2GM/R. With GM=3.986×1014 m3/s2 and R=6.371×106 m this is 11,186 m/s, about 11.2 km/s, independent of the shape of the trajectory, because the force is conservative.
In machine learning, gradient descent follows −∇L for a loss L. That field is conservative with potential −L, so ‘progress’ is a function: the loss goes down along every trajectory, and a closed loop of training steps cannot return to the same parameters with a lower loss. Methods that use a vector field that is not a gradient (the updates of two networks trained against each other, as in GANs) can circulate, which is one reason they are harder to train.
Your answerThe magnetic field of a long straight wire carrying I=10 A is the angle field scaled by μ0I/2π, with μ0=4π×10−7. What is its circulation (in tesla metres) around a loop that goes once counterclockwise around the wire?
The scaling factor 2πμ0I multiplies the angle-field circulation 2π.
The circulation of the angle field is 2π for such a loop, so the circulation of B is 2πμ0I⋅2π=μ0I=4π×10−7⋅10=4π×10−6≈1.26×10−5.
Your answerUsing GM=3.986×1014 m3/s2 and R=6.371×106 m, what is the escape speed from the Earth's surface in m/s, 2GM/R?
Compute 2GM/R first, then the square root.
2GM/R=2⋅3.986×1014/(6.371×106)≈1.2513×108, and the square root is about 11,186 m/s.
Traps
Watch out· Equal mixed partials do not prove a potential on a domain with a hole
On the 376 final the field of problem 1(a) was 10(x,y)(x2+y2)−5 on the plane minus the origin, and the instructor said afterwards that checking only Py=Qx is not enough there. Write the potential and verify it, or check that the integral around circles centred at the origin is 0. The cleanest is to exhibit φ=−45(x2+y2)−4 and compute its gradient.
Watch out· A correct potential with no check is worth less
On the 376 midterm, a student got all 7 points for problem 1(a), but the rubric shows what was at stake: one item gives only partial credit for a correct potential function without a justification of why its gradient equals f, and it deducts 3 of the 7 points. The habit to keep is to end every potential with ‘check: φx=⋯=P and φy=⋯=Q’.
Watch out· Evaluate the endpoints exactly, and use them as a difference
The theorem is end minus start. On Midterm 1 problem 1(b) the curve looked frightening, but its endpoints were both (0,0) (the factor 2π−t vanishes at t=2π and sin2π=0), so the integral is 0 and no integration is needed. Write out the trigonometric values at the endpoints (as in sinπ=0, cosπ=−1 in worksheet 6 part B) rather than doing them in your head, and do not forget that the potential at the start may not be 0.
Watch out· Restrict after differentiating, not before
On the 376 final, a student answered problem 3 with 0, which was right and earned full credit, but their written method contained a false sentence: they replaced F by its values on the plane z=0, namely (0,0,xy), and then wrote curlF=(x,−y,0). A curl needs derivatives in all three directions, including z, so restricting first computes the curl of a different field (the true curl of F is the zero vector). The line integral around C only uses values of F along C, so replacing F by the field that agrees with it on C is allowed; replacing it before taking a curl is not. The safe routes are the potential sin(xyz) or evaluating the field on the curve. See A.1.
Watch out· Zero around a few closed paths does not make a gradient
F=(x,xy) has zero circulation around every circle centred at the origin and is not a gradient (Py=0, Qx=y). Condition (c) must hold for every closed path. The instructor’s remark that circles about the missing point suffice applies only to fields that already satisfy Py=Qx on the punctured plane.
Watch out· Keep track of the domain
The theorems say ‘open and connected’ (first fundamental), ‘open’ (second), and ‘convex or simply connected’ (the test is sufficient). A path must stay inside the domain of φ: the potential −1/∥x∥ is singular at the origin. A set that is not connected, such as two discs, needs a separate potential on each piece, and the potentials may differ by different constants.
Watch out· Sign of the potential in physics
The mathematical potential has ∇φ=F and the work is φ(end)−φ(start). Physics books write F=−∇U for the potential energy U, so the work is U(start)−U(end). For gravity, φ=−mgz and U=mgz. Check which convention a problem uses.
Problems
check
Is F=(x,y) a gradient on R2? Find the line integral from (0,0) to (3,4).
Solution
Py=0=Qx on the convex set R2, so F is a gradient; φ=21(x2+y2). The integral is φ(3,4)−φ(0,0)=21⋅25=12.5.
checkMATH 376 homework 2 problem 4(b) and (d)
Are (b) the open unit disc and (d) the open annulus 1<x2+y2<2 connected? Give the paths.
Solution
(b) Yes: the disc is convex, since ∥(1−t)P+tQ∥≤(1−t)∥P∥+t∥Q∥<1 by the triangle inequality, so the segment from P to Q works. (d) Yes: write P,Q in polar form (rP,θP), (rQ,θQ) with rP,rQ∈(1,2). Move radially from (rP,θP) to (rQ,θP) (every radius in between is in (1,2)), then along the circle of radius rQ from angle θP to θQ. The annulus is connected but not simply connected.
check
A field has ∮F⋅dr=0 around the unit circle. Does it follow that F is a gradient field on R2?
Solution
No. Condition (c) must hold for every closed path. The field F=(x,xy) has zero circulation around circles centred at the origin and is not a gradient.
check
Find a potential for F=(3x2+2y,2x+4y3) on R2.
Solution
Py=2=Qx. φ=∫(3x2+2y)dx=x3+2xy+g(y), φy=2x+g′=2x+4y3, so g=y4. φ=x3+2xy+y4. Check: φx=3x2+2y, φy=2x+4y3.
useMATH 376 worksheet 6 part A style
Compute ∫F⋅dr for F=(ey,xey+1) along the curve r(t)=(cost+t,sin(πt)), 0≤t≤1.
Solution
Py=ey=Qx, so F is a gradient; φ=xey+y (φx=ey, φy=xey+1). The endpoints are r(0)=(1,0) and r(1)=(cos1+1,sinπ)=(1+cos1,0). So the integral is φ(1+cos1,0)−φ(1,0)=(1+cos1)−1=cos1.
usenew (MATH 376 homework 3 problem 1 style)
Decide whether F=(2xy+z2,x2+2yz,y2+2xz) is a gradient field on R3, and if so find the work from (0,0,0) to (1,1,1).
Solution
Curl: Ry−Qz=2y−2y=0, Pz−Rx=2z−2z=0, Qx−Py=2x−2x=0. Integrate P: φ=x2y+xz2+g(y,z); φy=x2+gy=x2+2yz so g=y2z+h(z); φz=2xz+y2+h′=y2+2xz so h′=0. φ=x2y+xz2+y2z, and the work is φ(1,1,1)−0=3.
useMATH 376 worksheet 5 exercise 4 style
Show that F=(xy,x) is not a gradient by comparing two paths from (0,0) to (1,1): the line y=x and the path through (1,0).
Solution
Along y=x: r=(t,t), F=(t2,t), r′=(1,1), ∫01(t2+t)dt=65. Along the x-axis then up: first leg y=0, F=(0,x), dr=(dx,0), contributes 0; second leg x=1, F=(y,1), dr=(0,dy), contributes ∫011dy=1. The values 65=1 differ, so the integral is path dependent. (The mixed partials are Py=x and Qx=1, which also differ.)
usenew (exact equation)
Solve (3x2y+1)dx+(x3+2y)dy=0.
Solution
The field (3x2y+1,x3+2y) is the gradient of φ=x3y+x+y2 (worksheet 5 exercise 2). The solutions satisfy x3y+x+y2=C.
proveMATH 376 lecture of 4 February
Prove that the potential of a gradient field on an open connected set is unique up to an additive constant.
Solution
Let φ1 and φ2 be potentials of F on the open connected set S and put h=φ1−φ2. Then ∇h=F−F=O on S. By the theorem of 4.4 (zero gradient on a connected open set means constant), h is constant. Alternatively, by the second fundamental theorem, for any path from a base point p to x, φ1(x)−φ1(p)=∫F⋅dr=φ2(x)−φ2(p), so h(x)=h(p) for all x.
provenew (compare Apostol 10.6)
Prove that a conservative force field does no net work on a particle that goes once around a closed path, and use the work-energy theorem to deduce that the particle’s speed is the same when it returns.
Solution
If F=∇φ and r is closed, the work is φ(r(b))−φ(r(a))=0 by the second fundamental theorem. By the work-energy theorem this work equals 21mv(b)2−21mv(a)2, so v(b)2=v(a)2, and since speeds are non-negative, v(b)=v(a).
proveMATH 376 homework 5 problem 4.1 / Apostol 10.16 example 2
Show that the field F=x2+y2(−y,x) on the punctured plane has Py=Qx but is not a gradient. Then show that F+∇ψ is not a gradient for any C1 function ψ on the punctured plane.
Solution
The first part is the example above. For the second part: if F+∇ψ=∇χ on the punctured plane, then F=∇(χ−ψ) would be a gradient there, which was shown false. (Equivalently, ∮(F+∇ψ)⋅dr=2π+0=2π around the unit circle, since the circulation of a gradient is 0.)
provenew (the converse direction of the three descriptions)
Let S be open and connected, and F continuous on S. Prove (b) implies (c) directly: if the line integral of F is independent of the path, then it is 0 around every closed piecewise smooth path.
Solution
Let γ:[a,b]→S be closed, γ(a)=γ(b)=p. Compare γ with the constant path c(t)=p on [a,b], which has the same start and the same end. The constant path has velocity 0, so ∫cF⋅dc=0. By path independence, ∫γF⋅dγ=∫cF⋅dc=0.
provenew (the gradient of a composite)
Let φ be a C1 scalar field on an open set, G:R→R a C1 function, and F=G′(φ)∇φ. Show that F is a gradient field and find a potential. Apply it to the field of the practice final, (2xycos(x2y)esin(x2y),x2cos(x2y)esin(x2y)).
Solution
By the chain rule, ∇(G(φ))=G′(φ)∇φ=F. So G∘φ is a potential. In the example, φ=x2y, ∇φ=(2xy,x2) and G′(u)=cosuesinu, so G(u)=esinu and the potential is esin(x2y), as found above.
stretchApostol 10.15, note (new check)
Show that F=(x,xy) is not a gradient field on R2 although ∮F⋅dr=0 for every circle centred at the origin. Then find a closed path with non-zero integral.
Solution
Py=0=y=Qx (at (0,1), say), so F is not a gradient. On the circle r(t)=(Rcost,Rsint): F⋅r′=Rcost⋅(−Rsint)+R2costsint⋅Rcost=−R2costsint+R3cos2tsint, and both terms integrate to 0 over [0,2π] (∫costsintdt and ∫cos2tsintdt=−3cos3t vanish over a full period). A closed path with non-zero integral: the boundary of the unit square [0,1]2, counterclockwise: bottom contributes ∫01xdx=21, right side (x=1, dr=(0,dy)) contributes ∫01ydy=21, top (y=1, from x=1 to 0, F=(x,x), dr=(dx,0)) contributes ∫10xdx=−21, left side (x=0) contributes 0. Total 21=0. (This is Green’s theorem: Qx−Py=y and ∬[0,1]2ydA=21.)
stretchnew (potential from a radial field)
A radial field is F=h(ρ)(x,y,z), with ρ=x2+y2+z2 and h continuous on (0,∞). Show that F is a gradient on R3 minus the origin and find a potential in terms of an antiderivative of ρh(ρ). What does this say about the gravitational field −GMmr/ρ3?
Solution
Let H be an antiderivative of ρh(ρ), so H′(ρ)=ρh(ρ). Then ∇H(ρ)=H′(ρ)∇ρ=ρh(ρ)⋅ρ(x,y,z)=h(ρ)(x,y,z)=F, because ∇ρ=(x,y,z)/ρ. So H(ρ) is a potential, and every radial field is conservative. For gravity h(ρ)=−GMm/ρ3, so ρh(ρ)=−GMm/ρ2 and H(ρ)=GMm/ρ, the Newtonian potential.
Summary
A gradient field has a potentialφ with ∇φ=F. Potentials differ by constants on a connected open set.
Second fundamental theorem:∫r∇φ⋅dr=φ(end)−φ(start) for any piecewise smooth path in the domain. Evaluate the endpoints exactly; a closed path gives 0.
First fundamental theorem and equivalences: on an open connected set, for a continuous field, (a) F is a gradient, (b) its line integral is path independent, (c) it is 0 around every closed path, are equivalent. Two paths with different values, or one closed path with a non-zero value, prove that F is not a gradient.
Test: if F is C1 and a gradient, then Py=Qx (in space, curl F=0). This is necessary; it is also sufficient on a convex set (explicit formula) and on a simply connected set (via Green’s theorem).
The angle fieldx2+y2(−y,x) on the punctured plane has Py=Qx and circulation 2π around the origin, so it has no potential. On a domain with a hole, find an explicit potential and verify it, or check the circulation.
Construct a potential by integrating P in x, adding g(y) (or g(y,z)), matching Q (and R), then verifying every component.
Energy: the work of a force equals the change of kinetic energy; for a conservative force it is also the change of the potential, so kinetic plus potential energy is constant. An exact equation Pdx+Qdy=0 is solved by the level curves of a potential.
Watch and read
The same ideas explained by someone else. Use these when an explanation here does not land.
MATH 376: The most heavily tested idea of the first half of the course: potentials appeared on Midterm 1 problem 1, on the Final (problems 1 and 3) and on both practice exams. Every worksheet and homework problem on potentials is worked below: worksheet 5 exercises 1 to 4, worksheet 6 parts A to C and the curl test, worksheet 10 problem 2, worksheet 27 problem 2, homework 2 problems 4 and 5, homework 3 problem 1, homework 5 problem 4.1. The exam problems are in 9.2, 9.4 and 9.5.
MATH 521 and 551: The pair 'equal mixed partials, but no potential' is the first example of cohomology: closed forms that are not exact. The punctured plane has a one-dimensional space of such forms, spanned by the angle field, and the winding number counts how many times a loop goes round.
MATH 340 and CS 532: Gradient descent follows the field $-\nabla L$ of a loss $L$, so the loss is its potential. A learned vector field that is not a gradient has loops along which 'progress' is not a number going down.
Physics: Conservative forces are exactly the ones with a potential energy. Friction is not conservative: its work around a closed loop is negative. The electric field of static charges is a gradient; the magnetic field of a current is not, and its circulation is Ampère's law.