MATH-209 · Lesson 4 of 5 · 42 min

Line and surface integrals

Many physical quantities are vectors that vary from point to point: the velocity of water in a river, the wind over a building, the electric field around a cable, the force of gravity. These are vector fields. Engineers constantly need two kinds of totals involving them: how much a field pushes along a path (the work done moving a load, the circulation of a fluid around a wing) and how much of it flows through a surface (water through a screen, heat through a wall, electric flux through a closed surface). Line integrals and surface integrals measure exactly these.

This chapter introduces vector fields, defines line integrals of scalar functions and of vector fields, develops the special and very useful case of conservative fields with potential functions, and then moves to surfaces: describing them with parameters, finding their area, and computing the flux of a vector field through them. These are the ingredients of the great theorems in Lesson 5.

Vector fields

A vector field assigns a vector to each point: in 2D, \(\mathbf{F}(x, y) = P(x, y)\,\mathbf{i} + Q(x, y)\,\mathbf{j}\); in 3D, a third component \(R\,\mathbf{k}\) is added. A plot shows arrows at a grid of points.

Two vector field plots. Left: F = (minus y, x), arrows circling the origin counterclockwise and growing longer away from it, like a rotating fluid. Right: the gradient of f = x squared plus y squared, arrows pointing straight outward from the origin and growing longer, crossing circular contours at right angles.
A rotating field (left) and a gradient field (right). Gradient fields cross level curves at right angles; rotating fields circulate.

Some fields engineers meet constantly:

  • Velocity fields in fluids: \(\mathbf{v}(x, y, z)\), the velocity of the fluid particle at each point.
  • Force fields: gravity near the Earth is \(\mathbf{F} = -mg\,\mathbf{k}\), constant; far from the Earth it is \(-GMm\,\mathbf{r}/|\mathbf{r}|^3\), pointing toward the centre.
  • Gradient fields: \(\nabla f\) for any scalar function, such as the heat flux \(-k\nabla T\) and the electric field \(-\nabla V\).
  • The rotation field \(\mathbf{F} = (-y, x)\), the velocity of a rigid disk spinning at 1 rad/s.

Line integrals of scalar functions

To add up a scalar quantity along a curve C, such as the mass of a curved wire with varying density, parametrize the curve as \(\mathbf{r}(t) = (x(t), y(t))\) for \(a \le t \le b\). Each small piece has length \(ds = |\mathbf{r}'(t)|\,dt\), so

\[\int_C f\,ds = \int_a^b f(x(t), y(t))\,|\mathbf{r}'(t)|\,dt\]

Worked problem

Mass of a curved rod

A rod is bent into a quarter circle of radius 2 m in the first quadrant. Its linear density is \(\lambda = 1 + y\) kg/m. Find its mass.

Show solution
  1. Parametrize: \(\mathbf{r}(t) = (2\cos t, 2\sin t)\), \(0 \le t \le \pi/2\). Then \(|\mathbf{r}'(t)| = |(-2\sin t, 2\cos t)| = 2\).
  2. \[m = \int_0^{\pi/2} (1 + 2\sin t)(2)\,dt = 2\left[t - 2\cos t\right]_0^{\pi/2} = 2\left(\frac{\pi}{2} + 2\right) = \pi + 4\]

Answer: π + 4 ≈ 7.14 kg. With f = 1, the same integral gives the length of the curve: here π m

Line integrals of vector fields: work

If a force field \(\mathbf{F}\) acts on an object moving along C, the work done is the sum of the force component along the path times each small displacement:

\[W = \int_C \mathbf{F} \cdot d\mathbf{r} = \int_a^b \mathbf{F}(\mathbf{r}(t)) \cdot \mathbf{r}'(t)\,dt = \int_C P\,dx + Q\,dy\;(+\,R\,dz)\]

Only the part of the force tangent to the path does work; the perpendicular part does none. Reversing the direction of travel changes the sign. When C is a closed loop, the integral is written \(\oint_C\) and called the circulation, a key quantity in fluid mechanics: the lift on an aircraft wing is proportional to the circulation of air around it.

A path from (0, 0) to (1, 1) along the parabola y = x squared, with force arrows of the field F = (3x squared, 2y) drawn at points along it and the tangent direction at one point. The tangential component is highlighted.
Work adds up the tangential component of the force along the path.

Worked problem

Work along a parabola

Find the work done by \(\mathbf{F} = (3x^2, 2y)\) N on an object moving along \(y = x^2\) from (0, 0) to (1, 1) m.

Show solution
  1. Parametrize: \(\mathbf{r}(t) = (t, t^2)\), \(0 \le t \le 1\), so \(\mathbf{r}'(t) = (1, 2t)\).
  2. \(\mathbf{F}(\mathbf{r}(t)) = (3t^2, 2t^2)\).
  3. \[W = \int_0^1 (3t^2 \cdot 1 + 2t^2 \cdot 2t)\,dt = \int_0^1 (3t^2 + 4t^3)\,dt = 1 + 1 = 2 \text{ J}\]

Answer: 2 J

Worked problem

Work depends on the path (sometimes)

For the rotation field \(\mathbf{F} = (-y, x)\), find the work from (1, 0) to (−1, 0) (a) along the upper half of the unit circle, (b) along the straight line through the origin. Then find the circulation around the whole unit circle.

Show solution
  1. (a) \(\mathbf{r}(t) = (\cos t, \sin t)\), \(0 \le t \le \pi\); \(\mathbf{F} \cdot \mathbf{r}' = (-\sin t)(-\sin t) + (\cos t)(\cos t) = 1\). So \(W = \pi\).
  2. (b) Along the x-axis, \(y = 0\) and \(dy = 0\), so \(\mathbf{F} \cdot d\mathbf{r} = -y\,dx + x\,dy = 0\). So \(W = 0\).
  3. Full circle: \(\oint = \int_0^{2\pi} 1\,dt = 2\pi\).

Answer: π along the arc, 0 along the line, and a circulation of 2π. Because the answer depends on the path, this field is not conservative. A paddle wheel placed in a fluid with this velocity field would spin

Conservative fields and potential functions

For some fields, the work between two points is the same along every path. These conservative fields are exactly the gradient fields: \(\mathbf{F} = \nabla\phi\) for some scalar potential function \(\phi\). For them, the fundamental theorem for line integrals reduces any line integral to a subtraction:

\[\int_C \nabla\phi \cdot d\mathbf{r} = \phi(\text{end}) - \phi(\text{start})\]

Consequences: the work depends only on the endpoints, and the circulation around any closed loop is zero. Gravity and the electrostatic force are conservative, which is why potential energy (\(mgh\), \(qV\)) makes sense: the work to lift a load to a given height is the same whichever route the crane takes. Friction and the rotation field above are not conservative.

Testing for a conservative field

In 2D, on a region without holes, \(\mathbf{F} = (P, Q)\) is conservative exactly when

\[\frac{\partial P}{\partial y} = \frac{\partial Q}{\partial x}\]

This follows from Clairaut's theorem: if \(P = \phi_x\) and \(Q = \phi_y\), both sides equal \(\phi_{xy}\). In 3D the test is that the curl (Lesson 5) is zero.

Worked problem

Finding a potential

Show that \(\mathbf{F} = (2xy + 3,\; x^2 - 4y)\) is conservative, find a potential, and compute the work from (0, 0) to (2, 1).

Show solution
  1. Test: \(P_y = 2x\) and \(Q_x = 2x\). Equal, so F is conservative.
  2. Integrate P with respect to x: \(\phi = x^2y + 3x + g(y)\), where \(g\) is a function of y alone.
  3. Match \(\phi_y = x^2 + g'(y)\) with \(Q = x^2 - 4y\): \(g'(y) = -4y\), so \(g = -2y^2\).
  4. \(\phi = x^2y + 3x - 2y^2\).
  5. Work: \(\phi(2, 1) - \phi(0, 0) = (4 + 6 - 2) - 0 = 8\).

Answer: φ = x²y + 3x − 2y², and the work is 8 along any path. Check: ∇φ = (2xy + 3, x² − 4y) ✓

Worked problem

Checking the parabola example

Is \(\mathbf{F} = (3x^2, 2y)\) from the earlier example conservative? If so, recompute the work.

Show solution
  1. \(P_y = 0 = Q_x\). Conservative, with \(\phi = x^3 + y^2\).
  2. \(W = \phi(1, 1) - \phi(0, 0) = 2\).

Answer: 2 J, matching the direct calculation, with no parametrization needed

Parametric surfaces

Just as curves are described by one parameter, surfaces are described by two: \(\mathbf{r}(u, v) = (x(u, v), y(u, v), z(u, v))\). Standard examples:

  • The graph \(z = g(x, y)\): \(\mathbf{r}(x, y) = (x, y, g(x, y))\).
  • A cylinder of radius R: \(\mathbf{r}(\theta, z) = (R\cos\theta, R\sin\theta, z)\).
  • A sphere of radius R: \(\mathbf{r}(\phi, \theta) = (R\sin\phi\cos\theta, R\sin\phi\sin\theta, R\cos\phi)\).

The partial derivatives \(\mathbf{r}_u\) and \(\mathbf{r}_v\) are tangent to the surface, so their cross product \(\mathbf{r}_u \times \mathbf{r}_v\) is normal to it, and its length is the area scale factor. A small patch has area

\[dS = |\mathbf{r}_u \times \mathbf{r}_v|\,du\,dv\]

For a graph \(z = g(x, y)\), this becomes \(dS = \sqrt{1 + g_x^2 + g_y^2}\,dA\).

Worked problem

Area of a sphere

Find the surface area of a sphere of radius R.

Show solution
  1. With the parametrization above, \(|\mathbf{r}_\phi \times \mathbf{r}_\theta| = R^2\sin\phi\) (the same factor as the spherical volume element, at fixed \(\rho = R\)).
  2. \[A = \int_0^{2\pi}\int_0^{\pi} R^2\sin\phi\,d\phi\,d\theta = 2\pi R^2[-\cos\phi]_0^\pi = 4\pi R^2\]

Answer: 4πR², the familiar formula, now derived

Worked problem

Area of a paraboloid dish

Find the area of the surface \(z = x^2 + y^2\) for \(z \le 4\), the curved part of the tank from Lesson 3.

Show solution
  1. \(g_x = 2x\), \(g_y = 2y\), so \(dS = \sqrt{1 + 4x^2 + 4y^2}\,dA = \sqrt{1 + 4r^2}\,r\,dr\,d\theta\).
  2. \[A = \int_0^{2\pi}\int_0^2 \sqrt{1 + 4r^2}\,r\,dr\,d\theta = 2\pi \cdot \frac{1}{12}\left[(1 + 4r^2)^{3/2}\right]_0^2 = \frac{\pi}{6}\left(17^{3/2} - 1\right)\]

Answer: ≈ 36.2 m². This is the area of plate needed to fabricate the curved part of the tank

Flux: flow through a surface

The flux of a vector field \(\mathbf{F}\) through a surface S measures how much of the field passes through it. Choose a unit normal \(\mathbf{n}\) on S (this choice is the orientation; for closed surfaces, outward is standard). Only the normal component of F carries anything through the surface, so

\[\iint_S \mathbf{F} \cdot \mathbf{n}\,dS = \iint_D \mathbf{F}(\mathbf{r}(u, v)) \cdot (\mathbf{r}_u \times \mathbf{r}_v)\,du\,dv\]

If \(\mathbf{F}\) is a fluid velocity, the flux is the volume flow rate through the surface (m³/s). If \(\mathbf{F}\) is a heat flux vector (W/m²), the flux is the rate of heat flow (W). If \(\mathbf{F}\) is an electric field, the flux appears in Gauss's law.

A curved surface patch with a normal vector n. Several flow arrows pass through it at an angle; each is split into a component along n, which carries flow through the surface, and a component along the surface, which does not.
Only the normal component F · n carries flow through a surface.

Worked problem

Flow through a pipe opening

Water flows straight up at a uniform 3 m/s, \(\mathbf{v} = (0, 0, 3)\), through a horizontal circular opening of radius 0.5 m. Find the volume flow rate. What if the opening were tilted at 60° to the horizontal?

Show solution
  1. Horizontal disk: \(\mathbf{n} = \mathbf{k}\), so \(\mathbf{v} \cdot \mathbf{n} = 3\) everywhere. Flux \(= 3 \times \pi(0.5)^2 = 2.36\) m³/s.
  2. Tilted 60°: the normal makes 60° with \(\mathbf{k}\), so \(\mathbf{v} \cdot \mathbf{n} = 3\cos 60^\circ = 1.5\). Flux \(= 1.5 \times 0.785 = 1.18\) m³/s.

Answer: 2.36 m³/s, halved to 1.18 m³/s when the opening is tilted 60°. Flux depends on the area that faces the flow

Worked problem

Flux out of a sphere

Find the outward flux of \(\mathbf{F} = (x, y, z)\) through the sphere of radius R centred at the origin.

Show solution
  1. On the sphere, the outward unit normal is \(\mathbf{n} = (x, y, z)/R\).
  2. \(\mathbf{F} \cdot \mathbf{n} = (x^2 + y^2 + z^2)/R = R^2/R = R\), constant over the surface.
  3. Flux \(= R \times \text{area} = R \times 4\pi R^2 = 4\pi R^3\).

Answer: 4πR³ (for R = 2, 32π ≈ 100.5). Notice that this is 3 times the volume of the ball. Lesson 5 explains why: the divergence of this field is 3 everywhere

Common mistakes

  • MistakeForgetting |r′(t)| in a scalar line integral.

    Insteadds = |r′(t)| dt; for a circle of radius R it is R dt.

  • MistakeUsing ∫F ds instead of ∫F · dr for work.

    InsteadWork uses the dot product with the tangent vector r′(t) dt, not the arc length.

  • MistakeAssuming every field is conservative.

    InsteadTest ∂P/∂y = ∂Q/∂x (or curl F = 0) first.

  • MistakeForgetting the function of y (or z) when integrating to find a potential.

    Insteadφ = ∫P dx + g(y); find g by matching φ_y with Q.

  • MistakeUsing an inward normal for a closed surface.

    InsteadThe standard orientation for closed surfaces is outward; state the orientation.

  • MistakeComputing F · n with a normal that is not a unit vector, then multiplying by dS as well.

    InsteadEither use the unit normal with dS, or use r_u × r_v with du dv, not a mixture.

Summary and key terms

  • A vector field assigns a vector to each point: fluid velocity, force, gradient fields.
  • Scalar line integrals ∫f ds = ∫f |r′(t)| dt give mass and length of curves.
  • Work is ∫F · dr = ∫F(r(t)) · r′(t) dt; around a closed loop it is the circulation.
  • Conservative fields are gradients, F = ∇φ; then ∫F · dr = φ(end) − φ(start) and circulation is zero.
  • In 2D, F = (P, Q) is conservative (on a region without holes) when P_y = Q_x.
  • Surfaces are parametrized by r(u, v); dS = |r_u × r_v| du dv; for z = g(x, y), dS = √(1 + gₓ² + g_y²) dA.
  • Flux ∬F · n dS measures flow through a surface: volume flow rate, heat flow, electric flux.
Vector field
An assignment of a vector to each point of a region.
Line integral
An integral along a curve, of a scalar (∫f ds) or a vector field (∫F · dr).
Work
The line integral of a force along a path.
Circulation
The line integral of a field around a closed curve.
Conservative field
A field whose line integrals depend only on the endpoints.
Potential function
A scalar φ with ∇φ = F.
Parametric surface
A surface described by a vector function of two parameters.
Surface integral
An integral over a surface, of a scalar or the normal component of a field.
Flux
The surface integral ∬F · n dS, the amount of a field passing through a surface.
Orientation
The choice of which side of a surface the normal points to.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Find the length of the helix \(\mathbf{r}(t) = (\cos t, \sin t, t)\), \(0 \le t \le 2\pi\).

    Show answer

    |r′| = √(sin²t + cos²t + 1) = √2. Length = 2π√2 ≈ 8.89.

  2. Find \(\int_C (x + y)\,ds\) along the straight segment from (0, 0) to (3, 4).

    Show answer

    r = (3t, 4t), |r′| = 5. ∫₀¹ 7t · 5 dt = 17.5.

  3. Find the work done by \(\mathbf{F} = (y, -x)\) around the unit circle counterclockwise.

    Show answer

    F · r′ = (sin t)(−sin t) + (−cos t)(cos t) = −1. Work = −2π (the field circulates clockwise).

  4. Is \(\mathbf{F} = (y^2, 2xy)\) conservative? If so, find a potential.

    Show answer

    P_y = 2y = Q_x, so yes. φ = xy².

  5. Is \(\mathbf{F} = (x + y, x - y)\) conservative?

    Show answer

    P_y = 1, Q_x = 1: yes, φ = x²/2 + xy − y²/2.

  6. A 500 kg load is moved by a crane along a complicated path from ground level to a point 12 m higher. How much work does gravity do?

    Show answer

    Gravity is conservative: W = −mgΔh = −500 × 9.81 × 12 = −58.9 kJ, whatever the path.

  7. Find the area of the part of the plane \(z = 2x + 2y\) above the unit square.

    Show answer

    dS = √(1 + 4 + 4) dA = 3 dA. Area = 3.

  8. Find the lateral area of a cylinder of radius 1.5 m and height 4 m using a parametrization.

    Show answer

    r(θ, z) = (1.5 cos θ, 1.5 sin θ, z). |r_θ × r_z| = 1.5. Area = ∫₀⁴∫₀^{2π} 1.5 dθ dz = 12π ≈ 37.7 m².

  9. Air moves at \(\mathbf{v} = (2, 0, 0)\) m/s. Find the flux through a 1 m × 1 m square in the plane x = 0, and through one in the plane y = 0.

    Show answer

    x = 0 plane, n = i: flux 2 m³/s. y = 0 plane, n = j: v · n = 0, flux 0.

  10. Find the outward flux of \(\mathbf{F} = (x, y, z)\) through the sphere of radius 3.

    Show answer

    4π(3)³ = 108π ≈ 339.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz