Engineering Mathematics · Lesson 24 of 28
Line and Surface Integrals
Work line integrals of scalar and vector fields, work and circulation, conservative fields and path independence, Green theorem, divergence and curl, flux, and the divergence theorem, with every rule carried to a number.
15 min read · Super EaFree lesson
Ordinary integrals add a quantity up along a straight axis; the MSTE paper occasionally asks you to add one up along a curve or through a boundary instead. This lesson covers the vector-calculus tools the CELE actually tests: the line integral of a scalar field, the line integral of a vector field that gives work and circulation, conservative fields and the path independence that makes them easy, Green theorem for a closed plane curve, the divergence and curl operators, and flux with the divergence theorem. Every rule is carried all the way to a number with units so you can check your own habits against it.
Line integral of a scalar field
A line integral of a scalar field adds up the values of a function f(x, y) along a curve C, weighting each value by the little piece of arc length ds it sits on:
integral over C of f ds.
To evaluate it you parametrize the curve as r(t) = (x(t), y(t)) for t running from a to b, and replace ds by the speed of that parametrization times dt:
ds = sqrt((dx/dt)^2 + (dy/dt)^2) dt.
With f = 1 the integral just returns the length of C. With f equal to a linear density the integral returns the mass of a wire, and dividing by the length returns the average value of f along the curve. The single habit that matters is never to forget the sqrt factor: ds is arc length, not dt and not dx.
Worked example: A thin wire runs in a straight line from (0, 0) to (1, 1), with position in meters, and carries a linear density lambda(x, y) = (x + y) kg/m. Parametrize the segment as r(t) = (t, t) for t from 0 to 1, so dx/dt = 1 and dy/dt = 1 and ds = sqrt(1^2 + 1^2) dt = sqrt(2) dt. Along the wire lambda = t + t = 2t, so the mass is
m = integral over C of lambda ds = integral from 0 to 1 of (2t) sqrt(2) dt = 2 sqrt(2) [t^2 / 2] from 0 to 1 = sqrt(2) = 1.41 kg.
Dropping the sqrt(2) and integrating 2t dt alone would give 1.00 kg, the classic slip of treating ds as dt.
Line integral of a vector field and work
When the field is a vector F = (P, Q) rather than a scalar, the natural thing to add up is the component of F along the direction of travel. That is the line integral of a vector field, written with the tangent step dr = (dx, dy):
integral over C of F dot dr = integral over C of (P dx + Q dy).
Physically this is the work done by a force field F as its point of application moves along C, and for a flow field it is the circulation around C. You evaluate it the same way, by parametrizing: substitute x(t), y(t), dx = (dx/dt) dt, dy = (dy/dt) dt and integrate the resulting one-variable integral in t.
Worked example: Compute the work of F = (y, 2x), with force in newtons and position in meters, along the parabola y = x^2 from (0, 0) to (1, 1). Parametrize as r(t) = (t, t^2) for t from 0 to 1, so dr = (1, 2t) dt and F = (y, 2x) = (t^2, 2t). Then F dot dr = (t^2)(1) + (2t)(2t) = t^2 + 4t^2 = 5t^2, and
W = integral from 0 to 1 of 5t^2 dt = 5 [t^3 / 3] from 0 to 1 = 5/3 = 1.67 J.
Worked example (a different path): Take the same field F = (y, 2x) but travel the straight segment y = x from (0, 0) to (1, 1). Now r(t) = (t, t), dr = (1, 1) dt, and F = (t, 2t), so F dot dr = t + 2t = 3t and W = integral from 0 to 1 of 3t dt = 3/2 = 1.50 J. The two answers differ, 1.67 J versus 1.50 J, which is the whole point: for a general field the work depends on the path, not just on the endpoints.
Conservative fields and path independence
A vector field F is conservative when it is the gradient of some scalar potential f, that is F = grad f = (f_x, f_y). Conservative fields are the pleasant special case where the line integral forgets the path entirely and depends only on the endpoints. That is the fundamental theorem for line integrals:
integral over C of grad f dot dr = f(B) - f(A).
Two consequences follow at once. First, the integral is path independent, so any route from A to B gives the same work. Second, the integral around any closed loop is zero, because B and A are the same point. In two dimensions there is a fast test for whether F = (P, Q) is conservative: on a simply connected region it is conservative exactly when
partial P / partial y = partial Q / partial x.
If that equality holds, you recover the potential f by integrating P in x, then fixing the leftover function of y by matching f_y to Q.
Worked example: Show that F = (2xy, x^2) is conservative and use it to find the work from (1, 0) to (2, 3), positions in meters and force in newtons. Here P = 2xy and Q = x^2, so partial P / partial y = 2x and partial Q / partial x = 2x; they match, so F is conservative. Integrating P = 2xy in x gives f = x^2 y + g(y), and then f_y = x^2 + g'(y) must equal Q = x^2, forcing g'(y) = 0, so f = x^2 y. By the fundamental theorem the work is
W = f(2, 3) - f(1, 0) = (2^2)(3) - (1^2)(0) = 12 - 0 = 12 J,
the same for every path between those two points. Reversing the endpoints would flip the sign to -12 J, the common orientation mistake.
Green theorem
Green theorem is the plane bridge between a line integral once around a closed curve and a double integral over the region it encloses. For a positively (counterclockwise) oriented simple closed curve C bounding a region R,
closed integral over C of (P dx + Q dy) = double integral over R of (partial Q / partial x - partial P / partial y) dA.
A clean special case gives area straight from the boundary. Choosing P = -y and Q = x makes the integrand partial Q / partial x - partial P / partial y = 1 + 1 = 2, so the double integral is twice the area. Rearranged, the area of R is
A = (1/2) closed integral over C of (x dy - y dx).
Worked example (area): Find the area of the ellipse x^2 / a^2 + y^2 / b^2 = 1 with a = 3 m and b = 2 m, using the boundary formula. Parametrize the boundary as x = a cos t, y = b sin t for t from 0 to 2 pi, so dx = -a sin t dt and dy = b cos t dt. Then x dy - y dx = (a cos t)(b cos t) dt - (b sin t)(-a sin t) dt = ab (cos^2 t + sin^2 t) dt = ab dt, and
A = (1/2) integral from 0 to 2 pi of ab dt = (1/2)(ab)(2 pi) = pi ab = pi (3)(2) = 6 pi = 18.85 m^2.
Worked example (line to area): Evaluate the closed integral over C of (x^2 dx + xy dy) where C is the triangle with vertices (0, 0), (1, 0), and (1, 1) traversed counterclockwise. Here P = x^2 and Q = xy, so partial Q / partial x - partial P / partial y = y - 0 = y. By Green theorem the line integral equals the double integral of y over the triangle, where x runs from 0 to 1 and y runs from 0 to x:
double integral over R of y dA = integral from 0 to 1 of [ integral from 0 to x of y dy ] dx = integral from 0 to 1 of (x^2 / 2) dx = (1/2)(1/3) = 1/6 = 0.167.
Doing that line integral segment by segment would take three parametrizations; Green theorem replaces all three with one easy double integral.
Divergence and curl
Two derivative operators summarize how a vector field spreads and how it swirls. For F = (P, Q) in the plane the divergence is a scalar that measures net outflow per unit area,
div F = partial P / partial x + partial Q / partial y,
and the (scalar) curl measures the local rate of rotation,
curl F = partial Q / partial x - partial P / partial y.
The curl is exactly the integrand in Green theorem, which is why Green theorem is read as "circulation around C equals the total curl inside R." A field with zero curl everywhere on a simply connected region is conservative, tying this section back to path independence. In three dimensions F = (P, Q, S) has div F = partial P / partial x + partial Q / partial y + partial S / partial z, and its curl is a full vector, but the board rarely needs more than the divergence in 3D.
Worked example: For the velocity field F = (x^2 y, x y^2), with velocity in m/s and position in m, compute the divergence and curl at the point (1, 2). The divergence is
div F = partial / partial x (x^2 y) + partial / partial y (x y^2) = 2xy + 2xy = 4xy,
so at (1, 2) it is 4(1)(2) = 8 per second (units of 1/s, since it is a velocity per length). The scalar curl is
curl F = partial / partial x (x y^2) - partial / partial y (x^2 y) = y^2 - x^2,
so at (1, 2) it is 2^2 - 1^2 = 4 - 1 = 3 per second. Swapping the two terms and writing x^2 - y^2 would give -3, the sign mistake to watch for.
Flux and the divergence theorem
Flux measures how much of a field crosses a boundary. Across a closed plane curve C with outward unit normal n, the flux is the line integral of the outward component of F,
flux = closed integral over C of F dot n ds,
and the two-dimensional divergence theorem (the flux form of Green theorem) turns that boundary integral into a double integral of the divergence over the region R inside:
closed integral over C of F dot n ds = double integral over R of div F dA.
Worked example: Find the flux of the field F = (x, y), with F in m/s and position in m, outward across the circle of radius R = 3 m. Its divergence is div F = 1 + 1 = 2, a constant, so the double integral is just 2 times the enclosed area:
flux = double integral over R of div F dA = 2 (pi R^2) = 2 pi (3^2) = 18 pi = 56.55 m^2/s.
A direct check confirms it: on the circle the outward normal is n = (x, y) / R, so F dot n = (x^2 + y^2) / R = R^2 / R = R, and multiplying by the circumference 2 pi R gives 2 pi R^2, the same answer.
The idea lifts to three dimensions unchanged. The (3D) divergence theorem says the flux of F out through a closed surface equals the triple integral of the divergence over the solid it bounds:
closed surface integral of F dot n dS = triple integral over V of div F dV.
Worked example: Find the flux of F = (x, y, z), with F in m/s and position in m, outward through the sphere of radius R = 2 m. The divergence is div F = 1 + 1 + 1 = 3, so
flux = triple integral over V of 3 dV = 3 (4/3 pi R^3) = 4 pi R^3 = 4 pi (2^3) = 32 pi = 100.5 m^3/s.
Forgetting the factor of 3 and reporting only the volume 4/3 pi R^3 = 33.5 m^3/s is the usual error.
| Line integral | Formula | What it totals |
|---|---|---|
| Scalar field along C | integral over C of f ds | length of C (f = 1), mass of a wire, average of f |
| Vector field along C | integral over C of F dot dr | work done by F, circulation around C |
| Flux across a plane curve | closed integral over C of F dot n ds | net outflow of F through the boundary |
| Theorem | Statement | Trades this for that |
|---|---|---|
| Fundamental theorem for line integrals | integral over C of grad f dot dr = f(B) - f(A) | a gradient line integral for endpoint values |
| Green theorem | closed integral (P dx + Q dy) = double integral (Q_x - P_y) dA | a boundary line integral for an area double integral |
| Divergence theorem (3D) | closed surface integral F dot n dS = triple integral div F dV | a closed-surface flux for a volume triple integral |
Exam-day strategy
- Parametrize every line integral first: write r(t) = (x(t), y(t)), then substitute and integrate in t; for a scalar integral never drop the ds = sqrt((dx/dt)^2 + (dy/dt)^2) dt factor, since that is what makes it arc length.
- Match the integrand to the question: f ds for length or mass of a wire, F dot dr for work or circulation, and F dot n ds for flux across a boundary.
- Before grinding out a vector line integral, test whether F is conservative with partial P / partial y = partial Q / partial x; if it holds, find the potential f and use f(B) - f(A), which ignores the path entirely and turns the closed-loop answer into zero.
- Reach for Green theorem whenever the curve is closed: it replaces one line integral around C with a single double integral of (Q_x - P_y) over the region, and the choice P = -y, Q = x gives the area formula A = (1/2) closed integral of (x dy - y dx).
- Keep the operators straight: divergence adds the matching partials (P_x + Q_y) and measures outflow, while the scalar curl subtracts the crossed partials (Q_x - P_y) and measures swirl; a zero-curl field on a simply connected region is conservative.
- For flux across a closed boundary, convert to a divergence integral: in the plane use double integral of div F dA, and in space use triple integral of div F dV, which for a constant divergence is just that divergence times the area or the volume.
- Watch orientation and units: counterclockwise is positive for Green theorem and outward is positive for flux, so reversing either flips the sign; carry the units through so work lands in joules, plane flux in m^2/s, and space flux in m^3/s.
Marking it done updates your Exam-Ready progress.
Lesson quiz
Check you actually have it
20 items on this lesson alone, randomized each try, with the reasoning on every answer.
Line and Surface Integrals: quick check
Item 01 / 20 · Score 0
The outward flux of F = (x, y) in m/s across the circle of radius R = 3 m is closest to:
This whole first section is free
Read every lesson in Engineering Mathematics and take its quizzes free. The full CELE reviewer unlocks the other 5 subjects, all section tests, and the timed mock exams — one payment, lifetime access, ₱399.
Unlock the full reviewer