Skip to content
Tutorials Center
My learning

Topics

Lesson 29 of 39 · Line and Surface Integrals

Line Integrals

Compute line integrals of scalar functions with arc length and of vector fields as work, using parametrizations, orientation rules and Python checks.

An ordinary integral adds up a function along an interval of the x-axis. A line integral adds up a function along a curve in the plane or in space. There are two kinds, and they answer different questions:

  • the scalar line integral adds up a quantity (like wire density) times arc length, to get total mass or length;
  • the vector line integral adds up the component of a force along the path, to get work.

Both are computed by parametrizing the curve and reducing to an ordinary integral.

Parametrizing a curve

A curve C is described by r(t) = ⟨x(t), y(t)⟩ (or with z(t)) for a ≤ t ≤ b. The velocity r'(t) is tangent to the curve, and its length |r'(t)| is the speed. A tiny piece of arc has length

Text
ds = |r'(t)| dt

Some useful parametrizations:

Curve Parametrization
Segment from P to Q r(t) = P + t(Q - P), 0 ≤ t ≤ 1
Circle of radius R r(t) = ⟨R cos t, R sin t⟩, 0 ≤ t ≤ 2π
Graph y = g(x) r(t) = ⟨t, g(t)⟩
Helix r(t) = ⟨cos t, sin t, t⟩

Scalar line integrals

For a scalar function f defined on the curve,

Text
∫_C f ds = ∫ₐᵇ f(r(t)) |r'(t)| dt

With f = 1 this is the length of the curve. If f is a density per unit length, it is the mass of the wire. The result does not depend on which direction you traverse C, because ds is always positive.

Example. Let f(x, y) = xy and C be the quarter circle r(t) = ⟨cos t, sin t⟩, 0 ≤ t ≤ π/2. Then |r'(t)| = 1, so

Text
∫_C xy ds = ∫₀^{π/2} cos t sin t dt = [sin² t / 2]₀^{π/2} = 1/2
Python Scalar line integrals with SymPy

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Vector line integrals and work

Now let F be a vector field, such as a force. As an object moves along C, only the part of F pointing along the motion does work. A small displacement is dr = r'(t) dt, and the small amount of work is F · dr. Adding up:

Text
∫_C F · dr = ∫ₐᵇ F(r(t)) · r'(t) dt

In component form with F = ⟨P, Q⟩, this is often written

Text
∫_C P dx + Q dy

Unlike the scalar integral, direction matters. Reversing the direction of travel changes the sign: ∫_{-C} F · dr = -∫_C F · dr.

Example 1. Let F = ⟨-y, x⟩ and C the unit circle, counterclockwise: r(t) = ⟨cos t, sin t⟩, 0 ≤ t ≤ 2π. Then F(r(t)) = ⟨-sin t, cos t⟩ and r'(t) = ⟨-sin t, cos t⟩, so

Text
∫_C F · dr = ∫₀^{2π} (sin² t + cos² t) dt = 2π

The field pushes along the path the whole way, so the work is positive.

Example 2. Let F = ⟨y, x⟩ along the same unit circle but only the quarter from (1, 0) to (0, 1). Then F(r(t)) = ⟨sin t, cos t⟩, r'(t) = ⟨-sin t, cos t⟩, and

Text
∫₀^{π/2} (-sin² t + cos² t) dt = ∫₀^{π/2} cos 2t dt = 0

(For this field, F = ∇(xy), and xy is 0 at both endpoints: a hint of what the next lesson will explain.)

Python Work done by a field along a path

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

For F = ⟨-y, x⟩, the work between the same two points depends on the path. That is the key property that distinguishes non-conservative fields.

Numerical line integrals

You can approximate any line integral by chopping the curve into many short steps and summing F · Δr. This is a calculator that applies the definition, and it is useful when no formula is available.

Python A numerical work calculator

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The second result is -19.6, the work done by gravity on a unit mass rising 2 m. The sign is negative because the force points opposite to the motion.

Line integrals in space

For a space curve r(t) = ⟨x(t), y(t), z(t)⟩ and F = ⟨P, Q, R⟩, the same formulas apply, with a three-component dot product. The helix ⟨cos t, sin t, t⟩ has speed √2, so its length over 0 ≤ t ≤ 2π is 2π√2.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is ds in terms of a parametrization r(t)?

    ds is the arc length element: speed times dt.
  2. 2. What happens to ∫_C F · dr when the direction of C is reversed?

    Reversing the path flips the sign of each small displacement dr, so the vector line integral changes sign. The scalar integral does not.
  3. 3. The work done by F = ⟨-y, x⟩ around the counterclockwise unit circle is:

    F · r' = sin² t + cos² t = 1, and the integral of 1 from 0 to 2π is 2π.
  4. 4. For a scalar line integral ∫_C f ds with f = 1, you get:

    Adding up all the tiny arc lengths gives the total length.

Summary

  • Parametrize the curve as r(t); then ds = |r'(t)| dt.
  • Scalar line integral: ∫_C f ds = ∫ f(r(t)) |r'(t)| dt (no dependence on direction).
  • Vector line integral (work): ∫_C F · dr = ∫ F(r(t)) · r'(t) dt (reverses sign with direction).
  • In components, ∫_C P dx + Q dy.
  • For some fields the work depends on the path; for others it does not.

Next: Conservative Fields and Potential Functions