Vector Calculus

Study Sheet

Vector Calculus

Line integrals, Green's theorem, div and curl

Fields, Circulation, and Flux

Tip
Conservative fields have potentials
xy(2, 1)
The field (y,x)(y, x), the level curves of its potential xyxy (dashed), and two paths from (0,0)(0, 0) to (2,1)(2, 1); both do work 22.

If F=∇f\mathbf F = \nabla f then ∫CF⋅dr=f(end)−f(start)\int_C \mathbf F\cdot d\mathbf r = f(\text{end}) - f(\text{start}) — the fundamental theorem for line integrals: path-independent, and zero around every loop. Test: in the plane, F=(P,Q)\mathbf F = (P, Q) is conservative when Qx=PyQ_x = P_y.

Why only the endpoints matter: along any path r(t)\mathbf r(t), F⋅r′=∇f⋅r′=ddtf(r(t))\mathbf F\cdot\mathbf r' = \nabla f\cdot\mathbf r' = \tfrac{d}{dt}f(\mathbf r(t)), so the line integral is the total change of ff (proof below). The test comes from mixed partials: if P=fxP = f_x and Q=fyQ = f_y, then Py=fxy=fyx=QxP_y = f_{xy} = f_{yx} = Q_x. For F=(y,x)=∇(xy)\mathbf F = (y, x) = \nabla(xy), the work from (0,0)(0, 0) to (2,1)(2, 1) is xyxy at the end minus xyxy at the start, 2−0=22 - 0 = 2, whether you go straight or turn a corner at (2,0)(2, 0).

Tip
Green's theorem trades a loop for a region

∮CP dx+Q dy=∬R(Qx−Py) dA\oint_C P\,dx + Q\,dy = \iint_R (Q_x - P_y)\,dA for a counterclockwise loop. The famous special case 12∮(−y dx+x dy)=area\tfrac12\oint(-y\,dx + x\,dy) = \text{area} powers planimeters and the shoelace formula alike.

Why: the double integral of Qx−PyQ_x - P_y adds up the tiny circulations of the cells of the region. Along every edge shared by two cells, the two circulations run in opposite directions and cancel, so only the outer boundary survives (proof sketch below). For the triangle with corners (0,0)(0, 0), (4,0)(4, 0), (0,3)(0, 3), the area formula 12∮(x dy−y dx)\tfrac12\oint(x\,dy - y\,dx) along the three straight edges gives 12(0+12+0)=6\tfrac12(0 + 12 + 0) = 6, the area 12⋅4⋅3\tfrac12\cdot4\cdot3; the shoelace formula is exactly this computation.

Concept
Divergence and curl, in one breath
(x, y)(−y, x)
Left: (x,y)(x, y), divergence 22, no rotation. Right: (−y,x)(-y, x), curl 22, no spreading.

∇⋅F\nabla\cdot\mathbf F measures how much the field SPREADS from a point (source strength); ∇×F\nabla\times\mathbf F measures how much it ROTATES. Conservative fields are curl-free; incompressible flows are divergence-free — and the Stokes/divergence theorems extend Green to surfaces and solids. For example, (x,y)(x, y) has divergence 22 and curl 00, while (−y,x)(-y, x) has divergence 00 and curl (0,0,2)(0, 0, 2).

Why these derivatives: the divergence Px+QyP_x + Q_y compares what flows out of a tiny box with what flows in — the PxP_x term measures how much faster the flow leaves through the right face than it enters through the left. The curl's zz-component Qx−PyQ_x - P_y compares the push along opposite edges of the box; it is the circulation per unit area, which is why it is the integrand in Green's theorem. In the figure, (x,y)(x, y) points straight out everywhere (pure source), while (−y,x)(-y, x) circles the origin (pure rotation).

Side note
Significance: conservation laws live here

Green's theorem and its 3D siblings are the mathematical form of 'what is created inside crosses the boundary.' Fluid flow, heat, electric charge — every conservation law in physics is one of these theorems applied to the right field. The planimeter (a 19th-century gadget that measures area by tracing a boundary) is Green's theorem built in brass.

Try it
Try it: spot the conservative field

Is F=(2xy,x2)\mathbf F = (2xy, x^2) conservative? If it is, find a potential and the value of ∫F⋅dr\int\mathbf F\cdot d\mathbf r from (0,0)(0, 0) to (3,2)(3, 2) along any path.

Show the answer

Test: Py=2xP_y = 2x and Qx=2xQ_x = 2x agree, and F\mathbf F is defined on the whole plane, so a potential exists. To build it, integrate PP in xx: f=x2y+g(y)f = x^2y + g(y). Then fy=x2+g′(y)f_y = x^2 + g'(y) must equal Q=x2Q = x^2, so g′=0g' = 0 and f=x2yf = x^2y (check: ∇f=(2xy,x2)\nabla f = (2xy, x^2)). Along any path the integral is f(3,2)−f(0,0)=9⋅2−0=18f(3, 2) - f(0, 0) = 9\cdot2 - 0 = 18.

Line Integrals: Work Along a Path

Tip
Parametrize, substitute, integrate

For a curve CC given by r(t)\mathbf r(t), a≤t≤ba \le t \le b:

∫CF⋅dr=∫abF(r(t))⋅r′(t) dt,∫Cf ds=∫abf(r(t)) ∣r′(t)∣ dt.\int_C\mathbf F\cdot d\mathbf r = \int_a^b\mathbf F(\mathbf r(t))\cdot\mathbf r'(t)\,dt, \qquad \int_C f\,ds = \int_a^b f(\mathbf r(t))\,|\mathbf r'(t)|\,dt.

The first (work, circulation) changes sign when the direction of travel is reversed; the second (mass of a wire, total along a curve) does not.

Why: over a short time step the point moves by dr≈r′(t) dtd\mathbf r \approx \mathbf r'(t)\,dt, and the force does work F⋅dr\mathbf F\cdot d\mathbf r on that step; adding the steps gives the first integral. For dsds, the step's length ∣r′(t)∣ dt|\mathbf r'(t)|\,dt is what gets counted, and a length has no direction, so reversing the path leaves ∫Cf ds\int_C f\,ds unchanged.

Example
Example: two paths, two answers
(1, 0)(−1, 0)
The field (−y,x)(-y, x) runs along the semicircle (work π\pi) but crosses the dashed diameter at right angles (work 00).

Compute ∫CF⋅dr\int_C\mathbf F\cdot d\mathbf r for F=(−y,x)\mathbf F = (-y, x) from (1,0)(1, 0) to (−1,0)(-1, 0) along two paths. Along the upper half of the unit circle, r(t)=(cos⁡t,sin⁡t)\mathbf r(t) = (\cos t, \sin t) for 0≤t≤π0 \le t \le \pi, so F⋅r′=(−sin⁡t)(−sin⁡t)+(cos⁡t)(cos⁡t)=1\mathbf F\cdot\mathbf r' = (-\sin t)(-\sin t) + (\cos t)(\cos t) = 1, and the integral is π\pi.

Along the diameter, r(t)=(1−2t,0)\mathbf r(t) = (1 - 2t, 0) for 0≤t≤10 \le t \le 1: then F=(0,1−2t)\mathbf F = (0, 1 - 2t) and r′=(−2,0)\mathbf r' = (-2, 0), so F⋅r′=0\mathbf F\cdot\mathbf r' = 0 and the integral is 00. The same endpoints give two different values, so F\mathbf F is not a gradient; the test agrees, since Qx−Py=1−(−1)=2≠0Q_x - P_y = 1 - (-1) = 2 \ne 0. On the arc the field pushes along the motion the whole way; on the diameter it pushes sideways and does no work.

Example
Example: the mass of a wire

A straight wire runs from (0,0)(0, 0) to (3,4)(3, 4) with density f=x+yf = x + y. Parametrize it as r(t)=(3t,4t)\mathbf r(t) = (3t, 4t), 0≤t≤10 \le t \le 1; then ∣r′(t)∣=5|\mathbf r'(t)| = 5 and f=7tf = 7t.

The mass is ∫017t⋅5 dt=352\int_0^1 7t\cdot5\,dt = \tfrac{35}{2}. Check: the density grows evenly from 00 to 77 along a wire of length 55, so its average is 72\tfrac72 and the mass is 5⋅72=3525\cdot\tfrac72 = \tfrac{35}{2}.

Side note
Where it goes wrong

Dropping the speed from dsds: ∫017t dt=72\int_0^1 7t\,dt = \tfrac72 for the wire, wrong by the factor 55 — the length of the wire, which the parameter interval [0,1][0, 1] knows nothing about. The opposite slip, using magnitudes in a work integral, fails too: ∫∣F∣ ∣r′∣ dt\int|\mathbf F|\,|\mathbf r'|\,dt happens to give π\pi on the semicircle, but on the diameter it gives ∫01∣1−2t∣⋅2 dt=1\int_0^1|1 - 2t|\cdot2\,dt = 1 instead of 00, because it ignores the angle between the force and the motion.

Try it
Try it: work along a parabola

Find the work done by F=(y,x2)\mathbf F = (y, x^2) along the parabola y=x2y = x^2 from (0,0)(0, 0) to (1,1)(1, 1).

Show the answer

Parametrize by xx: r(t)=(t,t2)\mathbf r(t) = (t, t^2), 0≤t≤10 \le t \le 1, so r′(t)=(1,2t)\mathbf r'(t) = (1, 2t) and F(r(t))=(t2,t2)\mathbf F(\mathbf r(t)) = (t^2, t^2). Then F⋅r′=t2+2t3\mathbf F\cdot\mathbf r' = t^2 + 2t^3, and the work is ∫01(t2+2t3) dt=13+12=56\int_0^1 (t^2 + 2t^3)\,dt = \tfrac13 + \tfrac12 = \tfrac56.

Green's Theorem in Practice

Tip
Choose the easier side

∮CP dx+Q dy=∬R(Qx−Py) dA\displaystyle\oint_C P\,dx + Q\,dy = \iint_R (Q_x - P_y)\,dA when CC is the boundary of RR traversed counterclockwise, with the region on the left. Use it from left to right when the loop integral is unpleasant and Qx−PyQ_x - P_y is simple; use it from right to left when the boundary is easy but the region is awkward, as in the area formulas.

Why the orientation matters: the proof tiles RR by tiny cells and lets the shared edges cancel, which works only if every cell is traversed the same way, with its inside on the left. Reversing the boundary flips the sign of the line integral, while the double integral does not change, so Green's theorem is only true for the counterclockwise direction.

Example
Example: a hopeless loop made easy

Compute ∮C(3y+sin⁡x) dx+(5x+ey2)dy\displaystyle\oint_C (3y + \sin x)\,dx + \left(5x + e^{y^2}\right)dy counterclockwise around the circle of radius 22 centred at the origin. Here P=3y+sin⁡xP = 3y + \sin x and Q=5x+ey2Q = 5x + e^{y^2}, so Qx−Py=5−3=2Q_x - P_y = 5 - 3 = 2.

By Green's theorem the integral is ∬R2 dA=2⋅4π=8π\iint_R 2\,dA = 2\cdot4\pi = 8\pi. The terms sin⁡x\sin x and ey2e^{y^2}, which would be hopeless along the circle, never mattered: sin⁡x\sin x in PP has ∂y=0\partial_y = 0 and ey2e^{y^2} in QQ has ∂x=0\partial_x = 0. Each is a gradient piece, and gradients have zero loop integrals.

Example
Example: checking the theorem on a rectangle
xy96 + 8/3−3−8/3
The rectangle traversed counterclockwise, with the value of ∫P dx+Q dy\int P\,dx + Q\,dy along each edge; they add to 1212.

Take P=x2−yP = x^2 - y and Q=x+y2Q = x + y^2 around the rectangle [0,3]×[0,2][0, 3]\times[0, 2]. The right side is quick: Qx−Py=1−(−1)=2Q_x - P_y = 1 - (-1) = 2, so ∬R2 dA=2⋅6=12\iint_R 2\,dA = 2\cdot6 = 12.

The left side, edge by edge. Bottom (y=0y = 0, xx from 00 to 33): ∫03x2 dx=9\int_0^3 x^2\,dx = 9. Right (x=3x = 3, yy from 00 to 22): ∫02(3+y2) dy=6+83\int_0^2 (3 + y^2)\,dy = 6 + \tfrac83. Top (y=2y = 2, xx from 33 back to 00): ∫30(x2−2) dx=−3\int_3^0 (x^2 - 2)\,dx = -3. Left (x=0x = 0, yy from 22 down to 00): ∫20y2 dy=−83\int_2^0 y^2\,dy = -\tfrac83. The total is 9+6+83−3−83=129 + 6 + \tfrac83 - 3 - \tfrac83 = 12, matching.

Example
Example: an ellipse measured from its boundary

Find the area inside x=3cos⁡tx = 3\cos t, y=2sin⁡ty = 2\sin t with 12∮(x dy−y dx)\tfrac12\oint(x\,dy - y\,dx). Here dx=−3sin⁡t dtdx = -3\sin t\,dt and dy=2cos⁡t dtdy = 2\cos t\,dt, so x dy−y dx=(6cos⁡2t+6sin⁡2t) dt=6 dtx\,dy - y\,dx = (6\cos^2t + 6\sin^2t)\,dt = 6\,dt.

The area is 12∫02π6 dt=6π\tfrac12\int_0^{2\pi}6\,dt = 6\pi, which is πab\pi ab with a=3a = 3, b=2b = 2 — the same answer the Jacobian topic reached by stretching a disk. A planimeter does this integral mechanically as its arm traces the boundary.

Side note
Where it goes wrong

Orientation and the order of the derivatives. Going round the rectangle clockwise gives −12-12. Mixing up the integrand, as Px−QyP_x - Q_y instead of Qx−PyQ_x - P_y, gives ∬(2x−2y) dA=18−12=6\iint(2x - 2y)\,dA = 18 - 12 = 6 over the rectangle, a plausible-looking wrong answer. The correct integrand is the zz-component of the curl: the xx-derivative of the yy-component minus the yy-derivative of the xx-component.

Try it
Try it: a triangle

Use Green's theorem to compute ∮Cxy dx+x2 dy\oint_C xy\,dx + x^2\,dy counterclockwise around the triangle with corners (0,0)(0, 0), (2,0)(2, 0), (0,2)(0, 2).

Show the answer

Here Qx−Py=2x−x=xQ_x - P_y = 2x - x = x, so the loop integral equals ∬Tx dA\iint_T x\,dA. At each xx the triangle runs from y=0y = 0 to y=2−xy = 2 - x, so this is ∫02x(2−x) dx=4−83=43\int_0^2 x(2 - x)\,dx = 4 - \tfrac83 = \tfrac43. Check with the centroid: the triangle has area 22 and centroid xx-coordinate 23\tfrac23, and 2⋅23=432\cdot\tfrac23 = \tfrac43.

Proofs & Why It Matters

Tip
Proof: the fundamental theorem for line integrals

If F=∇f\mathbf F = \nabla f and CC is parametrized by r(t)\mathbf r(t), a≤t≤ba \le t \le b, then ∫CF⋅dr=∫ab∇f(r(t))⋅r′(t) dt\int_C \mathbf F\cdot d\mathbf r = \int_a^b \nabla f(\mathbf r(t))\cdot\mathbf r'(t)\,dt.

By the chain rule the integrand is exactly ddtf(r(t))\tfrac{d}{dt}f(\mathbf r(t)), so the integral is f(r(b))−f(r(a))f(\mathbf r(b)) - f(\mathbf r(a)) by the ordinary fundamental theorem of calculus. Only the endpoints survive. ■\blacksquare

Tip
Proof sketch: Green's theorem on a rectangle

On [a,b]×[c,d][a,b]\times[c,d]: ∬Qx dA=∫cd[Q(b,y)−Q(a,y)]dy\iint Q_x\,dA = \int_c^d\left[Q(b,y) - Q(a,y)\right]dy, which is the line integral of Q dyQ\,dy up the right side and down the left. Similarly −∬Py dA-\iint P_y\,dA produces P dxP\,dx along the bottom and top. Adding gives the counterclockwise loop integral.

A general region is tiled by small rectangles: interior edges are traversed twice in opposite directions and cancel, leaving only the outer boundary. ■\blacksquare

Tip
Proof: the ½∮(x dy − y dx) area formula

Apply Green's theorem with P=−y2P = -\tfrac{y}{2}, Q=x2Q = \tfrac{x}{2}: then Qx−Py=12+12=1Q_x - P_y = \tfrac12 + \tfrac12 = 1, so the loop integral equals ∬1 dA\iint 1\,dA — the enclosed area. Choosing polygon vertices as the path gives the shoelace formula as a corollary. ■\blacksquare

Going Deeper: Explanations & Worked Problems

Concept
Conservative or not: the full workflow

Given F=(P,Q)\mathbf F = (P, Q), the question "does a potential exist?" has a mechanical answer. Test: compute QxQ_x and PyP_y; if they differ, no potential, stop.

If they agree (on a region without holes), CONSTRUCT the potential: integrate PP in xx to get f=∫P dx+g(y)f = \int P\,dx + g(y) with an unknown function of yy alone; differentiate this ff in yy, set it equal to QQ, and solve for g′(y)g'(y); integrate once more. Example: F=(2xy,  x2+3y2)\mathbf F = (2xy,\; x^2 + 3y^2). Check: Py=2x=QxP_y = 2x = Q_x ✓. Integrate: f=x2y+g(y)f = x^2y + g(y). Match: fy=x2+g′(y)=!x2+3y2f_y = x^2 + g'(y) \stackrel{!}{=} x^2 + 3y^2, so g′(y)=3y2g'(y) = 3y^2 and g=y3g = y^3. Potential: f=x2y+y3f = x^2y + y^3, and every line integral of F\mathbf F is now just ff at the endpoints. The hole caveat is real: (−yx2+y2,xx2+y2)\left(\tfrac{-y}{x^2+y^2}, \tfrac{x}{x^2+y^2}\right) passes the derivative test everywhere it is defined yet has integral 2π2\pi around the origin — the missing point matters.

Example
Worked: verifying Green's theorem on the unit circle

Take F=(−y,x)\mathbf F = (-y, x) around the unit circle, counterclockwise. LEFT SIDE (the line integral, done honestly):

Step 1 — parametrize: r(t)=(cos⁡t,sin⁡t)\mathbf r(t) = (\cos t, \sin t), 0≤t≤2π0 \le t \le 2\pi, so dx=−sin⁡t dtdx = -\sin t\,dt, dy=cos⁡t dtdy = \cos t\,dt.

Step 2 — substitute: ∮(−y dx+x dy)=∫02π[(−sin⁡t)(−sin⁡t)+(cos⁡t)(cos⁡t)]dt=∫02π(sin⁡2t+cos⁡2t) dt\oint(-y\,dx + x\,dy) = \int_0^{2\pi}\left[(-\sin t)(-\sin t) + (\cos t)(\cos t)\right]dt = \int_0^{2\pi}(\sin^2 t + \cos^2 t)\,dt.

Step 3 — the identity collapses the integrand to 11: the integral is 2π2\pi. RIGHT SIDE (the double integral): Qx−Py=1−(−1)=2Q_x - P_y = 1 - (-1) = 2, and ∬disk2 dA=2π\iint_{\text{disk}} 2\,dA = 2\pi. The two sides agree — and dividing by 22 gives the area formula 12∮(x dy−y dx)=π\tfrac12\oint(x\,dy - y\,dx) = \pi, the area of the unit disk, computed purely from its boundary.

Example
Worked: divergence and curl side by side

Let F=(x2,  xy,  z2)\mathbf F = (x^2,\; xy,\; z^2). DIVERGENCE: differentiate each component by ITS OWN variable and add: ∂x(x2)+∂y(xy)+∂z(z2)=2x+x+2z=3x+2z\partial_x(x^2) + \partial_y(xy) + \partial_z(z^2) = 2x + x + 2z = 3x + 2z — at (1,2,3)(1,2,3) this is 9>09 > 0, so the field is expanding there (a net source).

CURL: the determinant recipe gives ∇×F=(∂y(z2)−∂z(xy),  ∂z(x2)−∂x(z2),  ∂x(xy)−∂y(x2))=(0−0,  0−0,  y−0)=(0,0,y)\nabla\times\mathbf F = \left(\partial_y(z^2) - \partial_z(xy),\; \partial_z(x^2) - \partial_x(z^2),\; \partial_x(xy) - \partial_y(x^2)\right) = (0 - 0,\; 0 - 0,\; y - 0) = (0, 0, y). Nonzero curl means F\mathbf F is NOT conservative — no potential exists, and loop integrals of F\mathbf F can be nonzero — even though two of the three components look innocent. One derivative test settles what no amount of staring at the formula would.