Flow Lab

Syllabus / Module 2: Multivariable & Vector Calculus

Lesson 2.9

Line Integrals, Circulation & Flux

Work and circulation along curves; flux through surfaces; parametrized curves and surfaces; path independence for conservative fields.

Written byClaude Opus

🌊
Why this matters for simulation: Circulation around an airfoil determines its lift (Kutta–Joukowski theorem).

By the end of this lesson you can…

  • Parametrize curves and surfaces, and compute the speed $\|\vec r\,'(t)\|$ and area element $\|\vec r_u \times \vec r_v\|$.
  • Evaluate line integrals of scalar fields and of vector fields (work) by substituting a parametrization.
  • Compute the circulation and the outward flux of a 2D field around a closed curve, and relate them to curl and divergence.
  • Use the fundamental theorem for line integrals to find work in a conservative field, and test a field for path independence.
  • Set up and evaluate flux integrals through parametrized surfaces such as spheres and graphs.
  • Explain how the circulation around an airfoil determines its lift (Kutta–Joukowski).
On this page
·
  1. Parametrized curves
  2. Line integrals of scalar fields
  3. Worked example: a straight wire
  4. Line integrals of vector fields: work
  5. Worked example: two paths, two fields
  6. Circulation and flux in the plane
  7. Worked example: rotation, source and vortex on a circle
  8. Conservative fields and path independence
  9. Worked example: finding a potential
  10. Parametrized surfaces
  11. Surface integrals and flux
  12. Worked example: flux out of a sphere
  13. Worked example: flow through a dome
  14. Line integrals in code
  15. Circulation and lift: the Kutta–Joukowski theorem
  16. Key Takeaways

Put a wing in a wind tunnel and measure the air velocity on a big loop drawn around it. Add up the component of velocity along the loop, all the way around. That single number, the circulation, tells you the lift on the wing: no circulation, no lift. In the last two lessons you met 2.7 Divergence: Sources & Sinks and 2.8 Curl & Vorticity as local measurements, defined through the flux and circulation around infinitesimally small boxes and loops. This lesson makes those loops finite. We learn to add a quantity up along a curve (line integrals: work and circulation) and across a surface (flux integrals: how much fluid passes through a net). Together with the double and triple integrals of 2.5 Multiple Integrals, these are the raw materials for the big integral theorems of the next lesson and for every conservation law in fluid dynamics.

The recipe is the same every time, and it’s worth stating up front: parametrize, substitute, integrate. A curve or surface becomes a function of one or two parameters, the integrand gets rewritten in those parameters, and what’s left is an ordinary single or double integral that you already know how to do (by hand or numerically).

▶ Video Line integrals, circulation, flux, and why wings liftcaptions only
Transcript
  1. Why does a wing lift? The cleanest answer is a single number: the circulation of the air around it. Today we learn how to add things up along curves and across surfaces.
  2. A curve becomes something we can compute with once we parametrize it. A function r of t spits out a point for every time t, so the curve is the path of a moving dot.
  3. Its derivative, r prime of t, is the velocity of the dot. It is tangent to the curve, and its length is the speed.
  4. In a tiny time d t the dot travels a tiny length d s, equal to speed times d t. Adding up d s gives arc length, and that is the template for every line integral.
  5. First kind of line integral: a scalar function f, like the density of a wire. Stand a curtain on the curve with height f. The integral of f d s is the area of that curtain.
  6. To compute it, substitute the parametrization and turn d s into speed times d t. You get an ordinary integral in t, and the answer does not depend on how fast you walk.
  7. Second kind: a vector field, say the wind. As you walk the curve, only the part of the wind along your direction of travel pushes you forward or holds you back.
  8. Add up force dotted with displacement, F dot d r, along the whole path. That total is the work done by the field. Green bits help you, red bits fight you.
  9. Reverse the direction of travel and every displacement flips sign, so the work flips sign too. Vector line integrals care about orientation; scalar ones do not.
  10. When the curve is closed, the line integral gets a special name: circulation. It measures how much the field flows around the loop.
  11. In this rotating flow the field lines up with the loop everywhere, so the circulation is big. It equals two times the enclosed area: exactly the curl of two, times area, that we found in the curl lesson.
  12. Now go from A to B by two different routes. In the rotating flow the lower route rides with the current and the upper route fights it, so the two amounts of work differ.
  13. The work depends on the path. Fields like this are called non conservative, and they are exactly the ones with circulation.
  14. Now a gradient field: the field is the gradient of a potential f, whose level curves are drawn in violet. Take the same two routes from A to B.
  15. Both routes give the same work: f at B minus f at A. This is the fundamental theorem for line integrals, and the proof is one line of chain rule: along the path, the rate of change of f is the gradient dotted with r prime.
  16. So for a gradient field, work is path independent, and around any closed loop the circulation is zero. Conservative, path independent, zero circulation: three names for one property.
  17. Circulation uses the tangential part of the field. Use the normal part instead and you measure flux: how much fluid crosses the curve per unit time.
  18. In this source flow, fluid streams out through every piece of the loop, so the outward flux is positive. For a velocity field, flux is the volume per second leaking out.
  19. Surfaces work the same way, with two parameters instead of one. A function r of u and v bends a flat square of parameters into a curved sheet in space.
  20. Nudging u traces one tangent vector, r sub u. Nudging v traces another, r sub v. Their cross product is normal to the surface, and its length is the area of the tiny parallelogram they span.
  21. So the area element is the length of that cross product times d u d v, and the flux of a field through the surface adds up F dotted with the cross product over the parameter square. It is a double integral, like the ones from the multiple integrals lesson.
  22. Finally, the payoff. Here is air flowing past a spinning cylinder, a stand-in for a wing. The flow is a uniform stream plus a clockwise swirl, so air rushes faster over the top.
  23. Measure the circulation on any loop around the body. Because the field is irrotational outside the body, every loop gives the same number, gamma.
  24. The Kutta Joukowski theorem says the lift per unit span is air density, times free stream speed, times that circulation. No circulation, no lift.
  25. Wings are shaped to create exactly this circulation, and panel methods in aerodynamics solve for it numerically, one line integral at a time.
  26. To recap. Parametrize, substitute, and integrate in t. Tangential part gives work and circulation, normal part gives flux, and gradient fields are path independent.
  27. Next time, Green, Stokes and Gauss show that circulation and flux on a boundary are really curl and divergence, added up inside.

Parametrized curves

A parametrized curve is a function r⃗:[a,b]→R2\vec r : [a, b] \to \mathbb{R}^2 (or R3\mathbb{R}^3),

r⃗(t)=(x(t), y(t)),a≤t≤b.\vec r(t) = \big(x(t),\, y(t)\big), \qquad a \le t \le b .

Think of tt as time and r⃗(t)\vec r(t) as the position of a moving dot. The curve is the trail it leaves. This is exactly the output of your ODE solvers: RK4 applied to x⃗′=F⃗(x⃗)\vec x' = \vec F(\vec x) produces a parametrized curve, sampled at the time steps.

Some standard parametrizations:

CurveParametrization
segment from A⃗\vec A to B⃗\vec Br⃗(t)=A⃗+t(B⃗−A⃗)\vec r(t) = \vec A + t(\vec B - \vec A), 0≤t≤10 \le t \le 1
circle of radius RR about (x0,y0)(x_0, y_0), counterclockwiser⃗(t)=(x0+Rcos⁡t,  y0+Rsin⁡t)\vec r(t) = (x_0 + R\cos t,\; y_0 + R\sin t), 0≤t≤2π0 \le t \le 2\pi
graph y=g(x)y = g(x)r⃗(t)=(t,g(t))\vec r(t) = (t, g(t)), a≤t≤ba \le t \le b
helix in 3Dr⃗(t)=(cos⁡t,sin⁡t,ct)\vec r(t) = (\cos t, \sin t, ct)

The derivative r⃗ ′(t)=(x′(t),y′(t))\vec r\,'(t) = (x'(t), y'(t)) is the velocity. It is tangent to the curve, and its length ∥r⃗ ′(t)∥\|\vec r\,'(t)\| is the speed. In a small time dtdt, the dot moves a small distance

ds=∥r⃗ ′(t)∥ dt=x′(t)2+y′(t)2  dt,ds = \|\vec r\,'(t)\|\,dt = \sqrt{x'(t)^2 + y'(t)^2}\;dt ,

which is just Pythagoras on the little step (dx,dy)=(x′ dt,y′ dt)(dx, dy) = (x'\,dt, y'\,dt). Adding up these pieces gives the arc length ∫ab∥r⃗ ′(t)∥ dt\int_a^b \|\vec r\,'(t)\|\,dt, which you may remember from Calc II. The unit tangent vector is T^=r⃗ ′/∥r⃗ ′∥\hat T = \vec r\,'/\|\vec r\,'\|.

A parametrization also gives the curve an orientation: the direction of increasing tt. The same set of points can be traversed either way. For closed curves in the plane, the default (“positive”) orientation is counterclockwise, with the enclosed region on your left.

Line integrals of scalar fields

Suppose a thin wire lies along the curve CC and has linear density f(x,y)f(x, y) (kilograms per meter). Chop the wire into small pieces of length Δsi\Delta s_i; each has mass about f(r⃗i) Δsif(\vec r_i)\,\Delta s_i. Summing and refining gives the line integral of ff with respect to arc length:

∫Cf ds=lim⁡max⁡Δsi→0∑if(r⃗i) Δsi=∫abf(r⃗(t)) ∥r⃗ ′(t)∥ dt.\int_C f\,ds = \lim_{\max \Delta s_i \to 0} \sum_i f(\vec r_i)\,\Delta s_i = \int_a^b f\big(\vec r(t)\big)\,\|\vec r\,'(t)\|\,dt .

The geometric picture from the video: stand a curtain on the curve whose height above each point is ff. The integral is the area of the curtain. When f=1f = 1 it is simply the length of CC.

Worked example: a straight wire

Compute ∫C(x+y) ds\int_C (x + y)\,ds where CC is the segment from (0,0)(0,0) to (3,4)(3,4).

Parametrize: r⃗(t)=(3t,4t)\vec r(t) = (3t, 4t) for 0≤t≤10 \le t \le 1. Then r⃗ ′(t)=(3,4)\vec r\,'(t) = (3, 4), so ∥r⃗ ′∥=5\|\vec r\,'\| = 5, and f(r⃗(t))=3t+4t=7tf(\vec r(t)) = 3t + 4t = 7t:

∫C(x+y) ds=∫017t⋅5 dt=352=17.5.\int_C (x + y)\,ds = \int_0^1 7t \cdot 5\,dt = \frac{35}{2} = 17.5 .

Check with the arc-length parametrization r⃗(s)=(3s/5,4s/5)\vec r(s) = (3s/5, 4s/5), 0≤s≤50 \le s \le 5, which has speed 1: ∫057s5 ds=75⋅252=17.5\int_0^5 \tfrac{7s}{5}\,ds = \tfrac75 \cdot \tfrac{25}{2} = 17.5. ✓

✏️ Pen & paperMass of a curved wire●○○

A wire is bent into the upper half of the circle x2+y2=4x^2 + y^2 = 4 and its density is δ(x,y)=y\delta(x, y) = y (heavier at the top).

  1. Find the length of the wire using a line integral.
  2. Find its total mass.
  3. Without integrating, explain why ∫Cx ds=0\int_C x\,ds = 0.
Show worked solution

Parametrize r⃗(t)=(2cos⁡t,2sin⁡t)\vec r(t) = (2\cos t, 2\sin t), 0≤t≤π0 \le t \le \pi. Then r⃗ ′(t)=(−2sin⁡t,2cos⁡t)\vec r\,'(t) = (-2\sin t, 2\cos t) and ∥r⃗ ′(t)∥=2\|\vec r\,'(t)\| = 2.

  1. Length =∫0π2 dt=2π= \int_0^\pi 2\,dt = 2\pi, half the circumference 4π4\pi. ✓
  2. Mass =∫Cy ds=∫0π(2sin⁡t)(2) dt=4[−cos⁡t]0π=4(1+1)=8= \int_C y\,ds = \int_0^\pi (2\sin t)(2)\,dt = 4\big[-\cos t\big]_0^\pi = 4(1 + 1) = 8.
  3. The wire is symmetric about the yy-axis, and xx takes opposite values at mirror-image points, so the contributions cancel. (Indeed ∫0π2cos⁡t⋅2 dt=0\int_0^\pi 2\cos t \cdot 2\,dt = 0.) This is why the center of mass lies on the yy-axis.

Line integrals of vector fields: work

Now let F⃗\vec F be a force field (or the wind) and walk along CC. Over a tiny displacement dr⃗d\vec r, the field does work F⃗⋅dr⃗\vec F \cdot d\vec r: only the component of F⃗\vec F along the direction of travel counts. The total work is

W=∫CF⃗⋅dr⃗=∫abF⃗(r⃗(t))⋅r⃗ ′(t) dt.W = \int_C \vec F \cdot d\vec r = \int_a^b \vec F\big(\vec r(t)\big) \cdot \vec r\,'(t)\,dt .

Writing dr⃗=r⃗ ′(t) dt=T^ dsd\vec r = \vec r\,'(t)\,dt = \hat T\,ds shows the same thing as a scalar line integral of the tangential component: ∫CF⃗⋅dr⃗=∫C(F⃗⋅T^) ds\int_C \vec F\cdot d\vec r = \int_C (\vec F\cdot \hat T)\,ds. In components, with F⃗=(P,Q)\vec F = (P, Q), you will also see the notation

∫CF⃗⋅dr⃗=∫CP dx+Q dy.\int_C \vec F \cdot d\vec r = \int_C P\,dx + Q\,dy .

Worked example: two paths, two fields

Compute ∫CF⃗⋅dr⃗\int_C \vec F\cdot d\vec r from (0,0)(0,0) to (1,1)(1,1) along (a) the line y=xy = x and (b) the parabola y=x2y = x^2, for F⃗1=(y,x)\vec F_1 = (y, x) and F⃗2=(−y,x)\vec F_2 = (-y, x).

Parametrize (a) as r⃗(t)=(t,t)\vec r(t) = (t, t) with r⃗ ′=(1,1)\vec r\,' = (1, 1), and (b) as r⃗(t)=(t,t2)\vec r(t) = (t, t^2) with r⃗ ′=(1,2t)\vec r\,' = (1, 2t), both for 0≤t≤10 \le t \le 1.

Field F⃗1=(y,x)\vec F_1 = (y, x).

  • (a) F⃗1=(t,t)\vec F_1 = (t, t), so F⃗1⋅r⃗ ′=2t\vec F_1\cdot\vec r\,' = 2t and W=∫012t dt=1W = \int_0^1 2t\,dt = 1.
  • (b) F⃗1=(t2,t)\vec F_1 = (t^2, t), so F⃗1⋅r⃗ ′=t2+2t2=3t2\vec F_1\cdot\vec r\,' = t^2 + 2t^2 = 3t^2 and W=∫013t2 dt=1W = \int_0^1 3t^2\,dt = 1.

Field F⃗2=(−y,x)\vec F_2 = (-y, x).

  • (a) F⃗2=(−t,t)\vec F_2 = (-t, t), so F⃗2⋅r⃗ ′=−t+t=0\vec F_2\cdot\vec r\,' = -t + t = 0 and W=0W = 0. The path runs radially outward, perpendicular to this rotating field.
  • (b) F⃗2=(−t2,t)\vec F_2 = (-t^2, t), so F⃗2⋅r⃗ ′=−t2+2t2=t2\vec F_2\cdot\vec r\,' = -t^2 + 2t^2 = t^2 and W=1/3W = 1/3.

For F⃗1\vec F_1 the two paths agree; for F⃗2\vec F_2 they don’t. That difference is the subject of the section after next.

✅ Concept check

You traverse the same curve $C$ in the opposite direction. What happens to $\int_C f\,ds$ and to $\int_C \vec F\cdot d\vec r$?

Circulation and flux in the plane

When CC is a closed curve, the line integral of a velocity field gets a special name and a special symbol:

Γ=∮CF⃗⋅dr⃗=∮C(F⃗⋅T^) ds(circulation).\Gamma = \oint_C \vec F\cdot d\vec r = \oint_C (\vec F\cdot\hat T)\,ds \qquad \text{(circulation)}.

It measures how much the flow goes around the loop. Its partner uses the outward normal n^\hat n instead of the tangent:

Φ=∮C(F⃗⋅n^) ds(flux across C).\Phi = \oint_C (\vec F\cdot\hat n)\,ds \qquad \text{(flux across } C\text{)}.

For a velocity field, Φ\Phi is the area of fluid per unit time crossing the curve outward (in 3D it would be volume per unit time). How do we get n^ ds\hat n\,ds from a parametrization? For a counterclockwise curve, the tangent step is (dx,dy)(dx, dy); rotating it a quarter turn clockwise points outward, giving n^ ds=(dy,−dx)\hat n\,ds = (dy, -dx). So with F⃗=(P,Q)\vec F = (P, Q),

Γ=∮CP dx+Q dy,Φ=∮CP dy−Q dx.\Gamma = \oint_C P\,dx + Q\,dy, \qquad \Phi = \oint_C P\,dy - Q\,dx .

Worked example: rotation, source and vortex on a circle

Take the counterclockwise circle r⃗(t)=(Rcos⁡t,Rsin⁡t)\vec r(t) = (R\cos t, R\sin t), so dr⃗=(−Rsin⁡t,Rcos⁡t) dtd\vec r = (-R\sin t, R\cos t)\,dt and n^ ds=(dy,−dx)=(Rcos⁡t,Rsin⁡t) dt\hat n\,ds = (dy, -dx) = (R\cos t, R\sin t)\,dt.

Solid-body rotation F⃗=(−y,x)\vec F = (-y, x). On the circle F⃗=(−Rsin⁡t,Rcos⁡t)\vec F = (-R\sin t, R\cos t), which is parallel to dr⃗d\vec r:

Γ=∫02π(R2sin⁡2t+R2cos⁡2t) dt=2πR2,Φ=∫02π(−R2sin⁡tcos⁡t+R2cos⁡tsin⁡t) dt=0.\Gamma = \int_0^{2\pi} (R^2\sin^2 t + R^2\cos^2 t)\,dt = 2\pi R^2, \qquad \Phi = \int_0^{2\pi} (-R^2\sin t\cos t + R^2 \cos t\sin t)\,dt = 0 .

Notice Γ/(area)=2πR2/πR2=2\Gamma / (\text{area}) = 2\pi R^2 / \pi R^2 = 2, which is exactly the curl of this field. Curl is circulation per unit area, and for this field the ratio is 2 for loops of any size.

Point source F⃗=(x,y)/(x2+y2)\vec F = (x, y)/(x^2 + y^2). On the circle F⃗=(cos⁡t,sin⁡t)/R\vec F = (\cos t, \sin t)/R. Then F⃗⋅n^ ds=(cos⁡2t+sin⁡2t) dt=dt\vec F\cdot\hat n\,ds = (\cos^2 t + \sin^2 t)\,dt = dt, so Φ=2π\Phi = 2\pi for every radius. The same fluid that leaves a small circle must leave a big one. Its circulation is zero.

Point vortex F⃗=(−y,x)/(x2+y2)\vec F = (-y, x)/(x^2 + y^2). Now F⃗⋅dr⃗=(sin⁡2t+cos⁡2t) dt\vec F\cdot d\vec r = (\sin^2 t + \cos^2 t)\,dt, so Γ=2π\Gamma = 2\pi for every radius, and Φ=0\Phi = 0.

That last result is a puzzle worth keeping. A direct computation shows the point vortex has zero curl away from the origin: with P=−y/r2P = -y/r^2 and Q=x/r2Q = x/r^2, both QxQ_x and PyP_y equal (y2−x2)/r4(y^2 - x^2)/r^4. Yet its circulation around the origin is 2π2\pi, not 0. All of that circulation is concentrated at the one point where the field blows up. We’ll come back to this when we discuss path independence.

◆ Interactive Circulation & flux lab: draw a loop, read off ∮F·dr and ∮F·n ds

Loading simulation…

Things to try in the lab:

  1. Solid-body rotation. Use the circle preset, then draw loops of different shapes and sizes. The ratio Γ/A\Gamma/A stays at 2 no matter what you draw. Switch to shear flow (y,0)(y, 0): the ratio is −1-1, the curl of that field, even though the flow lines are straight.
  2. Point vortex. Drag the handle so the loop slides across the red dot at the origin. Γ\Gamma jumps between 2π2\pi (origin inside) and 00 (origin outside), no matter how you deform the loop. Do the same with the point source and watch the flux.
  3. Uniform wind. Every closed loop has Γ=0\Gamma = 0 and Φ=0\Phi = 0: whatever enters on one side leaves on the other.
  4. Wind + clockwise vortex. This is the flow around a lifting body. Increase κ\kappa and read off the Kutta–Joukowski lift. A loop that doesn’t enclose the body gives zero circulation and zero lift.
  5. Hit Reverse direction: circulation flips sign, but the outward flux doesn’t (outward is outward either way).
✅ Concept check

A uniform wind $\vec F = (3, 1)$ blows across a closed loop of any shape. What is the outward flux $\oint_C \vec F\cdot\hat n\,ds$?

Conservative fields and path independence

Back to the puzzle from the two-path example: why did F⃗1=(y,x)\vec F_1 = (y, x) give the same work along both paths? Because F⃗1=∇(xy)\vec F_1 = \nabla(xy) is a gradient field, and gradient fields obey a beautiful shortcut.

Derivation. It is the chain rule from 2.2 Linearization, the Chain Rule & the Jacobian. Along the curve, g(t)=f(r⃗(t))g(t) = f(\vec r(t)) is an ordinary function of tt with derivative

g′(t)=fx x′(t)+fy y′(t)=∇f(r⃗(t))⋅r⃗ ′(t).g'(t) = f_x\,x'(t) + f_y\,y'(t) = \nabla f\big(\vec r(t)\big)\cdot \vec r\,'(t).

So the line integral is ∫abg′(t) dt=g(b)−g(a)=f(B)−f(A)\int_a^b g'(t)\,dt = g(b) - g(a) = f(B) - f(A) by the ordinary fundamental theorem of calculus. ∎

For F⃗1=∇(xy)\vec F_1 = \nabla(xy) from (0,0)(0,0) to (1,1)(1,1): W=1⋅1−0=1W = 1\cdot 1 - 0 = 1, along any path, matching both calculations.

Consequences. For a field F⃗\vec F on a connected region, the following are equivalent:

  1. F⃗=∇f\vec F = \nabla f for some potential ff (conservative);
  2. ∫CF⃗⋅dr⃗\int_C \vec F\cdot d\vec r depends only on the endpoints (path independent);
  3. ∮CF⃗⋅dr⃗=0\oint_C \vec F\cdot d\vec r = 0 around every closed curve.

(1 ⇒ 2) is the theorem. (2 ⇔ 3): two paths from AA to BB combine into a loop (out along one, back along the other), and the loop integral is their difference. (2 ⇒ 1): define f(x⃗)=∫x⃗0x⃗F⃗⋅dr⃗f(\vec x) = \int_{\vec x_0}^{\vec x} \vec F\cdot d\vec r along any path; path independence makes this well defined, and differentiating it recovers F⃗\vec F.

The name “conservative” comes from mechanics: if a force is F⃗=−∇V\vec F = -\nabla V, the work done around any closed path is zero, so kinetic plus potential energy is conserved. Gravity and springs are conservative; friction and drag are not.

A practical test. Since the curl of a gradient is zero (2.8 Curl & Vorticity), a conservative field must have ∇×F⃗=0⃗\nabla\times\vec F = \vec 0, i.e. Qx=PyQ_x = P_y in 2D. Conversely:

The two-path example confirms the test: F⃗1=(y,x)\vec F_1 = (y, x) has Qx−Py=1−1=0Q_x - P_y = 1 - 1 = 0, while F⃗2=(−y,x)\vec F_2 = (-y, x) has Qx−Py=1−(−1)=2Q_x - P_y = 1 - (-1) = 2. And for F⃗2\vec F_2, the loop “out along the parabola, back along the line” has circulation 13−0=13\tfrac13 - 0 = \tfrac13. The region between the curves has area ∫01(x−x2) dx=16\int_0^1 (x - x^2)\,dx = \tfrac16, and 2×16=132 \times \tfrac16 = \tfrac13. Circulation equals curl times area again! That’s not a coincidence; it’s Green’s theorem, coming in 2.10 Green, Stokes & the Divergence Theorem.

Worked example: finding a potential

Show F⃗=(2xy+1,  x2+3y2)\vec F = (2xy + 1,\; x^2 + 3y^2) is conservative, find a potential, and compute the work from (0,0)(0,0) to (1,2)(1,2).

Test: Py=2xP_y = 2x and Qx=2xQ_x = 2x, equal on all of R2\mathbb{R}^2 (no holes), so F⃗\vec F is conservative.

Integrate fx=2xy+1f_x = 2xy + 1 in xx, treating yy as constant: f=x2y+x+g(y)f = x^2 y + x + g(y), where the “constant” can depend on yy. Differentiate in yy and match QQ: fy=x2+g′(y)=x2+3y2f_y = x^2 + g'(y) = x^2 + 3y^2, so g′(y)=3y2g'(y) = 3y^2 and g=y3g = y^3. Hence

f(x,y)=x2y+x+y3,W=f(1,2)−f(0,0)=2+1+8=11.f(x, y) = x^2 y + x + y^3, \qquad W = f(1, 2) - f(0, 0) = 2 + 1 + 8 = 11 .
✅ Concept check

$\vec F = (2xy,\; x^2)$. A particle follows a wiggly spiral path from $(0,0)$ to $(2,3)$. How much work does $\vec F$ do?

✅ Concept check

The point vortex $\vec F = (-y, x)/(x^2+y^2)$ has zero curl wherever it is defined, yet $\oint \vec F\cdot d\vec r = 2\pi$ around the unit circle. How is that consistent?

✏️ Pen & paperPath independence in practice●●○

Let F⃗=(y2,  2xy+ey)\vec F = (y^2,\; 2xy + e^y).

  1. Show that F⃗\vec F is conservative and find a potential ff.
  2. Compute the work done by F⃗\vec F moving from (0,0)(0,0) to (2,1)(2,1).
  3. Verify your answer by integrating directly along the straight segment.
  4. What is ∮CF⃗⋅dr⃗\oint_C \vec F\cdot d\vec r around the unit circle?
Show worked solution
  1. Py=2yP_y = 2y and Qx=2yQ_x = 2y on all of R2\mathbb{R}^2, so F⃗\vec F is conservative. From fx=y2f_x = y^2: f=xy2+g(y)f = xy^2 + g(y). Then fy=2xy+g′(y)=2xy+eyf_y = 2xy + g'(y) = 2xy + e^y gives g=eyg = e^y. So f(x,y)=xy2+eyf(x, y) = xy^2 + e^y.
  2. W=f(2,1)−f(0,0)=(2+e)−(0+1)=1+e≈3.718W = f(2,1) - f(0,0) = (2 + e) - (0 + 1) = 1 + e \approx 3.718.
  3. Take r⃗(t)=(2t,t)\vec r(t) = (2t, t), 0≤t≤10 \le t \le 1, with r⃗ ′=(2,1)\vec r\,' = (2, 1). Then F⃗=(t2,  4t2+et)\vec F = (t^2,\; 4t^2 + e^t) and F⃗⋅r⃗ ′=2t2+4t2+et=6t2+et\vec F\cdot\vec r\,' = 2t^2 + 4t^2 + e^t = 6t^2 + e^t. Integrating: [2t3+et]01=2+e−1=1+e\big[2t^3 + e^t\big]_0^1 = 2 + e - 1 = 1 + e. ✓
  4. Zero: a conservative field has zero circulation around every closed curve.

Parametrized surfaces

A surface in R3\mathbb{R}^3 needs two parameters:

r⃗(u,v)=(x(u,v),  y(u,v),  z(u,v)),(u,v)∈D.\vec r(u, v) = \big(x(u,v),\; y(u,v),\; z(u,v)\big), \qquad (u, v) \in D .

The map bends the flat parameter region DD into a curved sheet. Holding vv fixed and varying uu traces a curve on the surface with tangent vector r⃗u=∂r⃗/∂u\vec r_u = \partial\vec r/\partial u; similarly r⃗v\vec r_v. A tiny rectangle du×dvdu \times dv in DD maps to a tiny parallelogram on the surface with sides r⃗u du\vec r_u\,du and r⃗v dv\vec r_v\,dv.

The cross product a⃗×b⃗=(a2b3−a3b2,  a3b1−a1b3,  a1b2−a2b1)\vec a\times\vec b = (a_2b_3 - a_3b_2,\; a_3b_1 - a_1b_3,\; a_1b_2 - a_2b_1) is perpendicular to both a⃗\vec a and b⃗\vec b, and its length is the area of the parallelogram they span (the 3D cousin of the 2×22\times 2 determinant from 1.4 Determinants as Volume Scaling). So

N⃗=r⃗u×r⃗v   is normal to the surface,dS=∥r⃗u×r⃗v∥ du dv   is the area element.\vec N = \vec r_u \times \vec r_v \;\text{ is normal to the surface,}\qquad dS = \|\vec r_u\times\vec r_v\|\,du\,dv \;\text{ is the area element.}

This is the same idea as the Jacobian factor in a change of variables from 2.5 Multiple Integrals: it tells you how much the map stretches area.

Graphs. For z=g(x,y)z = g(x, y) use r⃗(x,y)=(x,y,g(x,y))\vec r(x, y) = (x, y, g(x,y)). Then r⃗x=(1,0,gx)\vec r_x = (1, 0, g_x), r⃗y=(0,1,gy)\vec r_y = (0, 1, g_y), and

r⃗x×r⃗y=(−gx,  −gy,  1),dS=1+gx2+gy2  dx dy.\vec r_x\times\vec r_y = (-g_x,\; -g_y,\; 1), \qquad dS = \sqrt{1 + g_x^2 + g_y^2}\;dx\,dy .

This normal points upward (positive zz-component).

Spheres. For radius RR use spherical angles ϕ∈[0,π]\phi \in [0,\pi] (from the north pole) and θ∈[0,2π]\theta \in [0, 2\pi]:

r⃗(ϕ,θ)=(Rsin⁡ϕcos⁡θ,  Rsin⁡ϕsin⁡θ,  Rcos⁡ϕ).\vec r(\phi, \theta) = (R\sin\phi\cos\theta,\; R\sin\phi\sin\theta,\; R\cos\phi).

A computation gives r⃗ϕ×r⃗θ=R2sin⁡ϕ (sin⁡ϕcos⁡θ,  sin⁡ϕsin⁡θ,  cos⁡ϕ)=Rsin⁡ϕ  r⃗\vec r_\phi\times\vec r_\theta = R^2\sin\phi\,(\sin\phi\cos\theta,\; \sin\phi\sin\theta,\; \cos\phi) = R\sin\phi\;\vec r, pointing outward with length R2sin⁡ϕR^2\sin\phi. Sanity check, the surface area:

∫02π ⁣ ⁣∫0πR2sin⁡ϕ  dϕ dθ=2πR2[−cos⁡ϕ]0π=4πR2.✓\int_0^{2\pi}\!\!\int_0^\pi R^2\sin\phi\;d\phi\,d\theta = 2\pi R^2\big[-\cos\phi\big]_0^\pi = 4\pi R^2 . \checkmark

Surface integrals and flux

The scalar surface integral ∬Sf dS=∬Df(r⃗(u,v)) ∥r⃗u×r⃗v∥ du dv\iint_S f\,dS = \iint_D f(\vec r(u,v))\,\|\vec r_u\times\vec r_v\|\,du\,dv adds up ff over area, for example the mass of a curved shell with surface density ff.

The important one for fluids is flux. Pick an orientation (a consistent choice of unit normal n^\hat n; for closed surfaces, outward). The flux of F⃗\vec F through SS is

∬SF⃗⋅n^ dS=∬DF⃗(r⃗(u,v))⋅(r⃗u×r⃗v) du dv.\iint_S \vec F\cdot\hat n\,dS = \iint_D \vec F\big(\vec r(u,v)\big)\cdot\big(\vec r_u\times\vec r_v\big)\,du\,dv .

The convenient thing is that the messy length ∥r⃗u×r⃗v∥\|\vec r_u \times \vec r_v\| cancels: n^ dS=N⃗∥N⃗∥ ∥N⃗∥ du dv=N⃗ du dv\hat n\,dS = \dfrac{\vec N}{\|\vec N\|}\,\|\vec N\|\,du\,dv = \vec N\,du\,dv. If r⃗u×r⃗v\vec r_u \times \vec r_v points the wrong way for your orientation, flip the sign.

Why is this “volume per time”? If fluid moves with velocity u⃗\vec u, in time dtdt the fluid crossing a small patch dSdS fills a slanted prism of base dSdS and height (u⃗⋅n^) dt(\vec u\cdot\hat n)\,dt. So u⃗⋅n^ dS\vec u\cdot\hat n\,dS is the volume per second through the patch. Only the normal component counts: fluid sliding along the surface doesn’t cross it.

Worked example: flux out of a sphere

Find the outward flux of F⃗=(x,y,z)\vec F = (x, y, z) through the sphere of radius RR.

On the sphere F⃗=r⃗\vec F = \vec r, and r⃗ϕ×r⃗θ=Rsin⁡ϕ r⃗\vec r_\phi\times\vec r_\theta = R\sin\phi\,\vec r, so F⃗⋅N⃗=Rsin⁡ϕ ∥r⃗∥2=R3sin⁡ϕ\vec F\cdot\vec N = R\sin\phi\,\|\vec r\|^2 = R^3\sin\phi. Then

∬SF⃗⋅n^ dS=∫02π ⁣ ⁣∫0πR3sin⁡ϕ  dϕ dθ=4πR3.\iint_S \vec F\cdot\hat n\,dS = \int_0^{2\pi}\!\!\int_0^\pi R^3\sin\phi\;d\phi\,d\theta = 4\pi R^3 .

Notice that 4πR3=3⋅43πR34\pi R^3 = 3 \cdot \tfrac43\pi R^3, three times the volume, and the divergence of F⃗\vec F is 1+1+1=31 + 1 + 1 = 3. Flux equals divergence times volume; that’s the divergence theorem, next lesson.

Worked example: flow through a dome

A uniform upward flow F⃗=(0,0,1)\vec F = (0, 0, 1) passes through the dome z=1−x2−y2z = 1 - x^2 - y^2, z≥0z \ge 0, oriented upward. Find the flux.

Using the graph formula, N⃗=(−gx,−gy,1)=(2x,2y,1)\vec N = (-g_x, -g_y, 1) = (2x, 2y, 1) and F⃗⋅N⃗=1\vec F\cdot\vec N = 1. The parameter region is the unit disk, so the flux is its area, π\pi. That matches intuition: every bit of fluid crossing the flat unit disk at the base must also cross the dome. The flux depends only on the boundary here because this flow has zero divergence.

✅ Concept check

For the surface $z = g(x, y)$ parametrized by $(x, y)$, which vector is $\vec r_x \times \vec r_y$?

✏️ Pen & paperFlux through a paraboloid●●○

Compute the upward flux of F⃗=(x,y,z)\vec F = (x, y, z) through the paraboloid z=1−x2−y2z = 1 - x^2 - y^2, z≥0z \ge 0.

Show worked solution

Parametrize by (x,y)(x, y) over the unit disk DD. With g=1−x2−y2g = 1 - x^2 - y^2, the upward normal is N⃗=(−gx,−gy,1)=(2x,2y,1)\vec N = (-g_x, -g_y, 1) = (2x, 2y, 1). On the surface,

F⃗⋅N⃗=2x2+2y2+z=2(x2+y2)+1−x2−y2=1+x2+y2.\vec F\cdot\vec N = 2x^2 + 2y^2 + z = 2(x^2 + y^2) + 1 - x^2 - y^2 = 1 + x^2 + y^2 .

Switch to polar coordinates, with dA=r dr dθdA = r\,dr\,d\theta:

∬D(1+r2) r dr dθ=2π[r22+r44]01=2π⋅34=3π2.\iint_D (1 + r^2)\,r\,dr\,d\theta = 2\pi\left[\frac{r^2}{2} + \frac{r^4}{4}\right]_0^1 = 2\pi\cdot\frac34 = \frac{3\pi}{2} .

Check (preview of the divergence theorem): ∇⋅F⃗=3\nabla\cdot\vec F = 3 and the solid under the dome has volume ∬D(1−r2) dA=2π(12−14)=π2\iint_D (1 - r^2)\,dA = 2\pi(\tfrac12 - \tfrac14) = \tfrac{\pi}{2}, so the total outward flux of the closed region is 3⋅π2=3π23\cdot\tfrac\pi2 = \tfrac{3\pi}{2}. On the flat base (z=0z = 0, outward normal −k^-\hat k), F⃗⋅(−k^)=−z=0\vec F\cdot(-\hat k) = -z = 0, so all of it goes through the dome. ✓

✏️ Pen & paperCirculation and flux, then shrink the loop●●●

Let F⃗=(x−y,  x+y)\vec F = (x - y,\; x + y), a rotation combined with an expansion, and let CC be the counterclockwise circle of radius RR centered at the origin.

  1. Compute the circulation ∮CF⃗⋅dr⃗\oint_C \vec F\cdot d\vec r.
  2. Compute the outward flux ∮CF⃗⋅n^ ds\oint_C \vec F\cdot\hat n\,ds.
  3. Divide each by the enclosed area. Compare with the curl Qx−PyQ_x - P_y and the divergence Px+QyP_x + Q_y.
  4. Is F⃗\vec F conservative?
Show worked solution

Use r⃗(t)=(Rcos⁡t,Rsin⁡t)\vec r(t) = (R\cos t, R\sin t), so dr⃗=(−Rsin⁡t,Rcos⁡t) dtd\vec r = (-R\sin t, R\cos t)\,dt, n^ ds=(Rcos⁡t,Rsin⁡t) dt\hat n\,ds = (R\cos t, R\sin t)\,dt, and F⃗=(Rcos⁡t−Rsin⁡t,  Rcos⁡t+Rsin⁡t)\vec F = (R\cos t - R\sin t,\; R\cos t + R\sin t).

  1. F⃗⋅dr⃗=R2[−(cos⁡t−sin⁡t)sin⁡t+(cos⁡t+sin⁡t)cos⁡t]dt=R2(sin⁡2t+cos⁡2t) dt=R2 dt\vec F\cdot d\vec r = R^2\big[-(\cos t - \sin t)\sin t + (\cos t + \sin t)\cos t\big]dt = R^2(\sin^2 t + \cos^2 t)\,dt = R^2\,dt, so Γ=2πR2\Gamma = 2\pi R^2.
  2. F⃗⋅n^ ds=R2[(cos⁡t−sin⁡t)cos⁡t+(cos⁡t+sin⁡t)sin⁡t]dt=R2 dt\vec F\cdot\hat n\,ds = R^2\big[(\cos t - \sin t)\cos t + (\cos t + \sin t)\sin t\big]dt = R^2\,dt, so Φ=2πR2\Phi = 2\pi R^2.
  3. Both ratios are 2πR2/πR2=22\pi R^2 / \pi R^2 = 2. The curl is Qx−Py=1−(−1)=2Q_x - P_y = 1 - (-1) = 2 and the divergence is Px+Qy=1+1=2P_x + Q_y = 1 + 1 = 2. Circulation per area is curl, flux per area is divergence, exactly as in the curl and divergence lessons (here even for big loops, because both are constant).
  4. No: its circulation around the circle is nonzero (equivalently, its curl is nonzero).

Line integrals in code

Every integral in this lesson becomes a one-dimensional or two-dimensional quadrature once it’s parametrized. Here is the playground version for circles in the plane:

🐍 PythonCirculation and flux around circles, numerically
⌘/Ctrl + Enter

Look at the rows: rotation and shear give circulation per area equal to their curl (2 and −1-1) for every circle; the point vortex and point source give 2π2\pi only when the circle surrounds the origin, and 0 otherwise.

Now implement the general tool yourself.

🧪 Coding exerciseExercise: work along a parametrized path, conservative vs not
⌘/Ctrl + Enter

The last line of the solution prints the circulation around the closed loop formed by the two paths: 1/31/3, equal to curl (=2)(=2) times the area between the curves (=1/6)(=1/6).

Surface flux works the same way with a double sum over the parameter grid:

🐍 PythonFlux through a sphere with a midpoint grid in (φ, θ)
⌘/Ctrl + Enter

In each case the flux equals the divergence times the volume of the ball (33, 00 and 11 times 43πR3\tfrac43\pi R^3). Hold that thought for 2.10 Green, Stokes & the Divergence Theorem.

Circulation and lift: the Kutta–Joukowski theorem

Here is the payoff promised at the start. Model the flow around a 2D wing section (an airfoil, or a spinning cylinder) as a uniform stream of speed U∞U_\infty plus a swirl. Away from the body the flow is irrotational, so by the reasoning in the point-vortex example, every loop enclosing the body has the same circulation Γ\Gamma, and every loop not enclosing it has zero. The body behaves, from far away, like a point vortex of strength Γ\Gamma sitting in a uniform wind. The lab’s “wind + clockwise vortex” field is exactly this.

Why should circulation produce lift? A clockwise swirl adds to the stream above the body and subtracts below, so air moves faster over the top. Bernoulli’s principle (faster flow, lower pressure) then gives lower pressure on top than on the bottom, and the net pressure force points up. The theorem is the precise version, and the proof is itself a line integral of pressure around the body, done in 11.7 Potential Flow & Stream Functions. Real wings get their circulation from the Kutta condition: the sharp trailing edge forces the flow to leave smoothly, which fixes Γ\Gamma. Computing that circulation is the job of thin-airfoil theory and panel methods (12.1 Airfoils, Circulation & Lift, 12.2 Thin Airfoil Theory & Panel Methods).

✏️ Pen & paperHow much circulation does a light aircraft need?●●○

A light aircraft weighs 10 00010\,000 N, has a wingspan of 1111 m, and cruises at U∞=50U_\infty = 50 m/s in air of density ρ=1.225\rho = 1.225 kg/m³. Treat the wing as uniform along its span (a crude 2D model).

  1. What lift per unit span is needed in level flight?
  2. What circulation Γ\Gamma must each wing section produce?
  3. If the plane slows to 3535 m/s, how must Γ\Gamma change, and how might the pilot achieve it?
Show worked solution
  1. In level flight lift balances weight: L′=10 000/11≈909L' = 10\,000 / 11 \approx 909 N/m.
  2. Γ=L′ρU∞=909.11.225×50=909.161.25≈14.8\Gamma = \dfrac{L'}{\rho U_\infty} = \dfrac{909.1}{1.225 \times 50} = \dfrac{909.1}{61.25} \approx 14.8 m²/s.
  3. Γ∝1/U∞\Gamma \propto 1/U_\infty, so it must increase by the factor 50/35≈1.4350/35 \approx 1.43, to about 21.221.2 m²/s. The pilot raises the nose (increasing the angle of attack) or deploys flaps; both change the airfoil’s effective shape so that the Kutta condition forces a larger circulation. At too high an angle of attack the flow separates and the model fails: that’s a stall.

Key Takeaways

  • Parametrize, substitute, integrate. A curve r⃗(t)\vec r(t) gives ds=∥r⃗ ′∥ dtds = \|\vec r\,'\|\,dt and dr⃗=r⃗ ′ dtd\vec r = \vec r\,'\,dt; a surface r⃗(u,v)\vec r(u,v) gives N⃗=r⃗u×r⃗v\vec N = \vec r_u\times\vec r_v and dS=∥N⃗∥ du dvdS = \|\vec N\|\,du\,dv.
  • ∫Cf ds\int_C f\,ds adds up a scalar along a curve (mass, length) and ignores orientation. ∫CF⃗⋅dr⃗\int_C \vec F\cdot d\vec r adds up the tangential part of a field (work) and flips sign when the curve is reversed.
  • Around a closed curve, the tangential integral is the circulation Γ\Gamma and the normal integral ∮F⃗⋅n^ ds\oint \vec F\cdot\hat n\,ds is the flux. Per unit area, for small loops, they are curl and divergence.
  • Fundamental theorem for line integrals: ∫C∇f⋅dr⃗=f(B)−f(A)\int_C \nabla f\cdot d\vec r = f(B) - f(A). Conservative, path independent, and zero circulation around every loop are the same property.
  • Curl-free implies conservative only on regions without holes; the point vortex has zero curl but circulation 2π2\pi around its center.
  • Flux through a surface, ∬F⃗⋅(r⃗u×r⃗v) du dv\iint \vec F\cdot(\vec r_u\times\vec r_v)\,du\,dv, measures volume per time crossing it; grid and finite-volume solvers are built on discrete fluxes.
  • Kutta–Joukowski: lift per span is L′=ρU∞ΓL' = \rho U_\infty \Gamma. The circulation around a wing is what holds an airplane up.
Finished this lesson?

Mark it complete to track your progress (saved in this browser). Reading every section does this for you.

Where this leads

These later lessons build directly on this one: