Math Core

Lesson 5.2 · Vector Calculus

Line integrals

An ordinary integral adds up a quantity along a straight interval of the xx-axis. A line integral adds up a quantity along a curve: the mass of a bent wire whose density varies, or the work a force field does on a particle that travels along a winding path. The trick is always the same: parametrize the curve, and the line integral becomes an ordinary integral in the parameter tt.

Line integrals of functions

Let CC be a smooth curve given by r(t)=⟨x(t),y(t)⟩\mathbf{r}(t) = \langle x(t), y(t)\rangle for a≤t≤ba \le t \le b, and let f(x,y)f(x, y) be a function defined on CC. Chop CC into tiny pieces of arc length Δs\Delta s, multiply the value of ff on each piece by its length, and add. In the limit you get the line integral of ff with respect to arc length.

Recall from arc length that a small change dtdt in the parameter moves you a distance ds=∣r′(t)∣ dtds = \lvert\mathbf{r}'(t)\rvert\,dt along the curve. That gives the formula you actually compute with.

Definition

Line integral with respect to arc length

∫Cf(x,y) ds=∫abf(x(t),y(t)) ∣r′(t)∣ dt,∣r′(t)∣=x′(t)2+y′(t)2.\int_C f(x, y)\,ds = \int_a^b f\big(x(t), y(t)\big)\,\lvert\mathbf{r}'(t)\rvert\,dt, \qquad \lvert\mathbf{r}'(t)\rvert = \sqrt{x'(t)^2 + y'(t)^2}.

In space, add a zz-component: ∣r′(t)∣=x′2+y′2+z′2\lvert\mathbf{r}'(t)\rvert = \sqrt{x'^2 + y'^2 + z'^2}.

If f=1f = 1, the integral is just the length of CC. If ff is the density of a wire (mass per unit length), the integral is the wire's mass. The value does not depend on which parametrization you choose or which way you traverse the curve, because dsds is always a positive length.

Worked example: A straight segment

Evaluate ∫C(x+y) ds\displaystyle\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⟩\mathbf{r}(t) = \langle 3t, 4t\rangle, 0≤t≤10 \le t \le 1. Then r′(t)=⟨3,4⟩\mathbf{r}'(t) = \langle 3, 4\rangle and ∣r′(t)∣=5\lvert\mathbf{r}'(t)\rvert = 5. On the curve, x+y=7tx + y = 7t. So

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

Worked example: A quarter circle

Evaluate ∫Cxy ds\displaystyle\int_C xy\,ds, where CC is the quarter of the circle x2+y2=4x^2 + y^2 = 4 in the first quadrant.

Parametrize: r(t)=⟨2cos⁡t,2sin⁡t⟩\mathbf{r}(t) = \langle 2\cos t, 2\sin t\rangle, 0≤t≤π20 \le t \le \tfrac{\pi}{2}. Then ∣r′(t)∣=4sin⁡2t+4cos⁡2t=2\lvert\mathbf{r}'(t)\rvert = \sqrt{4\sin^2 t + 4\cos^2 t} = 2, and

∫Cxy ds=∫0π/2(2cos⁡t)(2sin⁡t)⋅2 dt=8∫0π/2sin⁡tcos⁡t dt=8⋅12=4.\int_C xy\,ds = \int_0^{\pi/2} (2\cos t)(2\sin t)\cdot 2\,dt = 8\int_0^{\pi/2}\sin t\cos t\,dt = 8\cdot\frac{1}{2} = 4.

Line integrals of vector fields

Now let F\mathbf{F} be a force field and let a particle move along CC. On a tiny piece of the curve, the displacement is dr=r′(t) dtd\mathbf{r} = \mathbf{r}'(t)\,dt, and the work done is the component of force along the motion times the distance: F⋅dr\mathbf{F}\cdot d\mathbf{r}. Adding these up gives the work.

Line integral of a vector field

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

If F=⟨P,Q⟩\mathbf{F} = \langle P, Q\rangle, this is also written ∫CP dx+Q dy\displaystyle\int_C P\,dx + Q\,dy, since dx=x′(t) dtdx = x'(t)\,dt and dy=y′(t) dtdy = y'(t)\,dt. In space, ∫CP dx+Q dy+R dz\displaystyle\int_C P\,dx + Q\,dy + R\,dz.

Equivalently, F⋅dr=(F⋅T) ds\mathbf{F}\cdot d\mathbf{r} = (\mathbf{F}\cdot\mathbf{T})\,ds, where T\mathbf{T} is the unit tangent vector. So the vector line integral is the scalar line integral of the tangential component of F\mathbf{F}. Force perpendicular to the path does no work.

The path y = x² from (0, 0) to (1, 1) used in the work example.Open in grapher →

Worked example: Work along a parabola

Find the work done by F(x,y)=⟨y,x2⟩\mathbf{F}(x, y) = \langle y, x^2\rangle on a particle moving along y=x2y = x^2 from (0,0)(0, 0) to (1,1)(1, 1).

Parametrize with x=tx = t: r(t)=⟨t,t2⟩\mathbf{r}(t) = \langle t, t^2\rangle, 0≤t≤10 \le t \le 1, so r′(t)=⟨1,2t⟩\mathbf{r}'(t) = \langle 1, 2t\rangle. On the curve F=⟨t2,t2⟩\mathbf{F} = \langle t^2, t^2\rangle. Then

W=∫01⟨t2,t2⟩⋅⟨1,2t⟩ dt=∫01(t2+2t3)dt=13+12=56.W = \int_0^1 \langle t^2, t^2\rangle\cdot\langle 1, 2t\rangle\,dt = \int_0^1 \left(t^2 + 2t^3\right)dt = \frac{1}{3} + \frac{1}{2} = \frac{5}{6}.

Worked example: A helix in space

Evaluate ∫CF⋅dr\displaystyle\int_C \mathbf{F}\cdot d\mathbf{r} for F=⟨z,x,y⟩\mathbf{F} = \langle z, x, y\rangle along one turn of the helix r(t)=⟨cos⁡t,sin⁡t,t⟩\mathbf{r}(t) = \langle \cos t, \sin t, t\rangle, 0≤t≤2π0 \le t \le 2\pi.

r′(t)=⟨−sin⁡t,cos⁡t,1⟩\mathbf{r}'(t) = \langle -\sin t, \cos t, 1\rangle and F(r(t))=⟨t,cos⁡t,sin⁡t⟩\mathbf{F}(\mathbf{r}(t)) = \langle t, \cos t, \sin t\rangle. The dot product is −tsin⁡t+cos⁡2t+sin⁡t-t\sin t + \cos^2 t + \sin t. Integrate each piece over [0,2π][0, 2\pi]:

∫02π−tsin⁡t dt=[tcos⁡t−sin⁡t]02π=2π,∫02πcos⁡2t dt=π,∫02πsin⁡t dt=0.\int_0^{2\pi} -t\sin t\,dt = \Big[t\cos t - \sin t\Big]_0^{2\pi} = 2\pi, \qquad \int_0^{2\pi}\cos^2 t\,dt = \pi, \qquad \int_0^{2\pi}\sin t\,dt = 0.

The total is 3π3\pi.

Orientation matters

Traversing CC in the opposite direction (written −C-C) flips every drd\mathbf{r}, so

∫−CF⋅dr=−∫CF⋅dr,but∫−Cf ds=∫Cf ds.\int_{-C}\mathbf{F}\cdot d\mathbf{r} = -\int_C \mathbf{F}\cdot d\mathbf{r}, \qquad\text{but}\qquad \int_{-C} f\,ds = \int_C f\,ds.

A curve made of several pieces, like the sides of a triangle, is handled one piece at a time; add the results.

Common mistake

Don't forget the factor ∣r′(t)∣\lvert\mathbf{r}'(t)\rvert in ∫Cf ds\displaystyle\int_C f\,ds, and don't insert it into ∫CF⋅dr\displaystyle\int_C \mathbf{F}\cdot d\mathbf{r}. The vector integral uses r′(t)\mathbf{r}'(t) itself, dotted with F\mathbf{F}, with no square root anywhere.

Tip

To parametrize the segment from PP to QQ, use r(t)=(1−t)P+tQ\mathbf{r}(t) = (1 - t)P + tQ for 0≤t≤10 \le t \le 1. Then r′(t)=Q−P\mathbf{r}'(t) = Q - P, a constant vector.

Practice

Practice 1

Evaluate ∫C2x ds\displaystyle\int_C 2x\,ds, where CC is the segment from (0,0)(0, 0) to (1,1)(1, 1).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

Evaluate ∫C(x2+y2) ds\displaystyle\int_C (x^2 + y^2)\,ds, where CC is the full circle x2+y2=9x^2 + y^2 = 9.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

Evaluate ∫CF⋅dr\displaystyle\int_C \mathbf{F}\cdot d\mathbf{r} for F(x,y)=⟨x,y⟩\mathbf{F}(x, y) = \langle x, y\rangle along r(t)=⟨t,t2⟩\mathbf{r}(t) = \langle t, t^2\rangle, 0≤t≤20 \le t \le 2.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

Find the work done by F(x,y)=⟨−y,x⟩\mathbf{F}(x, y) = \langle -y, x\rangle on a particle that travels once counterclockwise around the unit circle.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Evaluate ∫Cy dx+x2 dy\displaystyle\int_C y\,dx + x^2\,dy, where CC is given by x=tx = t, y=2ty = 2t, 0≤t≤10 \le t \le 1.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

For a curve CC, ∫Cf ds=6\displaystyle\int_C f\,ds = 6 and ∫CF⋅dr=4\displaystyle\int_C \mathbf{F}\cdot d\mathbf{r} = 4. If you traverse the curve in the opposite direction, what are the two integrals?

Practice 7

A thin wire lies along the segment r(t)=⟨t,2t,2t⟩\mathbf{r}(t) = \langle t, 2t, 2t\rangle, 0≤t≤10 \le t \le 1, and has density δ(x,y,z)=xyz\delta(x, y, z) = xyz. Find its mass.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.