Multivariable Calculus · Undergraduate

Line Integrals

Quick answer

A line integral adds up a quantity along a curve instead of along an interval. The scalar line integral ∫f ds weighs each small piece of the curve by its length, giving masses of wires and averages along paths. The vector line integral ∫F · dr adds up the component of a field along the direction of motion, giving the work a force does on a moving object. Both are computed by parametrizing the curve and turning the line integral into an ordinary integral in t.

What you'll learn

  • Compute a scalar line integral with ds = |r′(t)| dt
  • Compute the work integral of a vector field along a curve
  • Explain how orientation affects each kind of line integral
  • Interpret line integrals as mass, length and work

Integrating along a curve

A single integral runs along a straight interval of the xx-axis. A line integral runs along a curve CC, which may bend through the plane or through space. Cut CC into short pieces, multiply a quantity on each piece by the piece’s length Δs\Delta s, and add. The limit is

∫Cf(x,y) ds\int_C f(x, y)\,ds

the line integral of ff with respect to arc length. If ff is the density of a wire bent along CC, in mass per unit length, the integral is the mass of the wire. With f=1f = 1 it is the length of CC.

To compute it, parametrize CC as r(t)\mathbf{r}(t) for a≤t≤ba \le t \le b. A small change dtdt moves the point a distance ∣r′(t)∣ dt|\mathbf{r}'(t)|\,dt, the same arc length element as before:

∫Cf ds=∫abf(r(t)) ∣r′(t)∣ dt\int_C f\,ds = \int_a^b f\big(\mathbf{r}(t)\big)\,\big|\mathbf{r}'(t)\big|\,dt

The answer does not depend on which parametrization is used, as long as it traces CC once.

Work along a path

A constant force F\mathbf{F} moving an object along a straight displacement d\mathbf{d} does work F⋅d\mathbf{F} \cdot \mathbf{d}: only the component of the force along the motion counts. For a varying field and a curved path, cut the path into short pieces. On each piece the displacement is about Δr\Delta\mathbf{r} and the work about F⋅Δr\mathbf{F} \cdot \Delta\mathbf{r}. Adding and taking the limit gives the line integral of F\mathbf{F} along CC:

W=∫CF⋅dr=∫abF(r(t))⋅r′(t) dtW = \int_C \mathbf{F} \cdot d\mathbf{r} = \int_a^b \mathbf{F}\big(\mathbf{r}(t)\big) \cdot \mathbf{r}'(t)\,dt

In components, with F=(P,Q)\mathbf{F} = (P, Q) and dr=(dx,dy)d\mathbf{r} = (dx, dy), the same integral is written ∫CP dx+Q dy\int_C P\,dx + Q\,dy.

Why direction matters for work but not for mass

Arc length is always positive, so a wire has the same mass whichever end you start from: ∫Cf ds\int_C f\,ds ignores direction. Work does not. Walking the path backward reverses every displacement Δr\Delta\mathbf{r}, so every term F⋅Δr\mathbf{F} \cdot \Delta\mathbf{r} changes sign. If −C-C is the curve traced the other way,

∫−CF⋅dr=−∫CF⋅dr\int_{-C} \mathbf{F} \cdot d\mathbf{r} = -\int_C \mathbf{F} \cdot d\mathbf{r}

A curve with a chosen direction is oriented, and every work integral needs one. For a closed curve, the usual orientation is counterclockwise, and the integral is written ∮CF⋅dr\oint_C \mathbf{F} \cdot d\mathbf{r}. When F\mathbf{F} is a fluid’s velocity, this is the circulation: how strongly the flow runs around CC.

The field (x², −xy) along a quarter circle Arrows of the field (x², −xy) at a grid of points in the first quadrant, together with the quarter of the unit circle from (1, 0) to (0, 1). Along the arc the arrows point mostly to the right and down, against the counterclockwise direction of travel, so the work is negative. 11xy (1, 0) (0, 1)
  • C
The field (x², −xy) along a quarter circle

Worked examples

One turn of the helix The helix r(t) = (cos t, sin t, t) for t from 0 to 2π, winding once counterclockwise around the z-axis while rising from height 0 to height 2π. x y z start end
One turn of the helix

Common mistakes

Practice problems

  1. Evaluate ∫Cx ds\int_C x\,ds along the segment from (0,0)(0, 0) to (3,4)(3, 4).

    Answer

    152\tfrac{15}{2}

    Full solution

    With r(t)=(3t,4t)\mathbf{r}(t) = (3t, 4t), ∣r′(t)∣=5|\mathbf{r}'(t)| = 5, so ∫013t⋅5 dt=152\int_0^1 3t \cdot 5\,dt = \tfrac{15}{2}.

  2. Find the length of one turn of the helix (cos⁡t, sin⁡t, t)(\cos t,\ \sin t,\ t), 0≤t≤2π0 \le t \le 2\pi.

    Answer

    2π22\pi\sqrt{2}

    Full solution

    ∣r′(t)∣=sin⁡2t+cos⁡2t+1=2|\mathbf{r}'(t)| = \sqrt{\sin^2 t + \cos^2 t + 1} = \sqrt{2}, so the length is ∫02π2 dt\int_0^{2\pi} \sqrt{2}\,dt.

  3. A wire lies along the upper half of the unit circle, with density yy at the point (x,y)(x, y). Find its mass.

    Answer

    22

    Full solution

    ∫Cy ds=∫0πsin⁡t dt=2\int_C y\,ds = \int_0^\pi \sin t\,dt = 2.

  4. Evaluate ∫C(x+y) ds\int_C (x + y)\,ds along the segment from (0,0)(0, 0) to (1,1)(1, 1).

    Answer

    2\sqrt{2}

    Full solution

    With r(t)=(t,t)\mathbf{r}(t) = (t, t), ds=2 dtds = \sqrt{2}\,dt, so the integral is ∫012t2 dt=2\int_0^1 2t\sqrt{2}\,dt = \sqrt{2}.

  5. Find the work done by F=(x, y)\mathbf{F} = (x,\ y) along the segment from (1,0)(1, 0) to (0,1)(0, 1).

    Answer

    00

    Full solution

    With r(t)=(1−t, t)\mathbf{r}(t) = (1 - t,\ t), F⋅r′=(1−t)(−1)+t=2t−1\mathbf{F} \cdot \mathbf{r}' = (1 - t)(-1) + t = 2t - 1, and ∫01(2t−1) dt=0\int_0^1 (2t - 1)\,dt = 0. Both endpoints are at distance 11 from the origin, and F=∇x2+y22\mathbf{F} = \nabla\tfrac{x^2 + y^2}{2}.

  6. Find the circulation of F=(y, −x)\mathbf{F} = (y,\ -x) around the unit circle, counterclockwise.

    Answer

    −2π-2\pi

    Full solution

    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, so the integral is −2π-2\pi. This field circles clockwise, against the direction of travel.

  7. Evaluate ∫Cx2 dx+y2 dy\int_C x^2\,dx + y^2\,dy along y=x2y = x^2 from (0,0)(0, 0) to (1,1)(1, 1).

    Answer

    23\tfrac{2}{3}

    Full solution

    With r(t)=(t,t2)\mathbf{r}(t) = (t, t^2): ∫01(t2+t4⋅2t) dt=13+13=23\int_0^1 \big(t^2 + t^4 \cdot 2t\big)\,dt = \tfrac{1}{3} + \tfrac{1}{3} = \tfrac{2}{3}.

  8. Without integrating again, find the work done by F=(x2, −xy)\mathbf{F} = (x^2,\ -xy) along the quarter circle from (0,1)(0, 1) to (1,0)(1, 0).

    Answer

    23\tfrac{2}{3}

    Full solution

    This is the path of Example 2 traced backward, so the work changes sign: −(−23)-\left(-\tfrac{2}{3}\right).

  9. A student computes the work of Example 4 as ∫02πF(r(t))⋅r′(t) ∣r′(t)∣ dt\int_0^{2\pi} \mathbf{F}(\mathbf{r}(t)) \cdot \mathbf{r}'(t)\,|\mathbf{r}'(t)|\,dt. On the unit circle they still get 2π2\pi. Why is the method wrong anyway?

    Answer

    The factor ∣r′(t)∣|\mathbf{r}'(t)| does not belong in a work integral; here it happens to equal 11.

    Full solution

    The vector r′(t)\mathbf{r}'(t) already carries the speed. On a circle of radius 22, with r(t)=(2cos⁡t,2sin⁡t)\mathbf{r}(t) = (2\cos t, 2\sin t), the correct circulation is 8π8\pi, while the extra factor 22 would give 16π16\pi.

Frequently asked questions

What is a line integral?

An integral taken along a curve. The scalar version ∫f ds adds up f times arc length; the vector version ∫F · dr adds up the tangential component of a field times arc length.

How do you compute ∫f ds?

Parametrize the curve as r(t) for a ≤ t ≤ b. Then ds = |r′(t)| dt, and ∫f ds = ∫ f(r(t)) |r′(t)| dt from a to b.

How do you compute ∫F · dr?

With the same parametrization, dr = r′(t) dt, so ∫F · dr = ∫ F(r(t)) · r′(t) dt from a to b.

Does the direction of the curve matter?

For ∫F · dr, yes: reversing the direction changes the sign. For ∫f ds, no: arc length is positive either way.

What does ∫F · dr mean physically?

When F is a force, it is the work done by the force on an object moving along the curve. When F is a velocity field and the curve is closed, it is the circulation of the flow around the curve.

What to learn next