Line Integrals

1 What is a line integral?

In your integral calculus class you learned how to perform integrals like Z b dx f (x) . (1) a

This integral of a single variable is the simplest example of a line integral. A line integral is just anintegral of a function along a path or curve. In this case, the curve is a straight line a segment of thex-axis that starts at x = a and ends at x = b. Just so were clear on notation, Ill write the indefiniteintegral of f (x) with respect to x as Z dx f (x) = F (x) + c , (2)

where dF (x)/dx = f (x) and c is a constant, and the definite integral of f (x) from x = a to x = b as Z b b

dx f (x) = F (x) = F (b) F (a) . (3) a a

The vertical line notation in the second step means evaluate the thing in front at the upper limit,then subtract the thing in front evaluated at the lower limit. Now suppose I gave you a function of three variables, say h(x, y, z), and then described a pathP through space that starts at (xi , yi , zi ) and snakes around until it ends at (xf , yf , zf ). You canintegrate h(x, y, z) along the path P just like you integrated f (x) with respect to x in (1). Here ishow we write such an integral Z f d` h(x, y, z) . (4) P i

What does all this mean? First, the subscript P reminds us that were integrating along a specificpath or curve (Ill use the terms path and curve interchangeably). Integrating along a differentcurve may or may not give a different answer. Second, the limits i and f on the integral refer to thestarting point (xi , yi , zi ) and end point (xf , yf , zf ), respectively. Third, d` is the infinitesimal distancefrom point to point along the path. The really important thing to notice here is that there is a singleintegration variable, because we are integrating along a path. You only need one variable to describewhere you are on a curve, so there is only one variable to integrate! Over the next few sections wellunpack all this and figure out how to evaluate integrals like (4).

2 CurvesBefore we can integrate along a curve, we should spend some time reviewing how to describe curves.Suppose you wanted to describe a curve in the x-y plane (later on well work with three variables, butlets start simple). You may be able to do this by telling me y as a function of x, along with the startand end points. For example, Figure 1 shows the curve y(x) = 21 x2 + x 3 from x = 1 to x = 3. The

1 y 6

0 x 1 2 3 4

-2

1 Figure 1: The curve y(x) = 2 x2 + x 3, from x = 1 to x = 3.

1collection of points (x, y = 2 x2 + x 3) with 1 x 3 is a perfectly good way of describing thiscurve. Of course, this doesnt always work. Consider a curve like the one shown in Figure 2. Do you thinkyou could describe it in the same way as the curve in Figure 1? Its clear that 1 x 1 for this y

0.4

0.2

x -1.0 -0.5 0.5 1.0

-0.2

-0.4

Figure 2: A parametric curve.

curve, but if you try to describe the points in the form (x, y(x)) you run into a problem: there aredifferent points on the curve with the same value of x! As an example, look at values of x close tox = 1. Since a function y(x) cant give two different values for a given x, you cant describe this curvelike the previous one. Instead, you need to give a parametric description of the curve, which meansexpressing both x and y as functions of a parameter t. The curve in Figure 2 is

x(t) = cos(t) y(t) = sin(t) cos(t) with t . (5) 4You could come up with many other parameterizations of this curve, too there is no unique way ofdoing it. The last two examples are curves in the x-y plane, but a path through three dimensional spacewith coordinates (x, y, z) works the same way. For example, you may be able to describe a curve byexpressing y and z as functions of x, as (x, y(x), z(x)). If this isnt possible you can always give aparametric description of the form (x(t), y(t), z(t)) with ti t tf . For example, Figure 3 shows thecurve (x = cos(t), y = sin(t), z = t).

2 1.0 y 0.5 0.0 -0.5 -1.0

15

z 10

0 -1.0 -0.5 0.0 x 0.5 1.0

Figure 3: The curve (x, y, z) = (cos(t), sin(t), t) with 0 t 6.

3 The infinitesimal displacement vector

When you perform an integral like (1), the factor of dx in the integrand represents an infinitesimaldisplacement along the x-axis you are just moving along the x-axis, adding up little rectangleswith width dx and height f (x). Naturally, when we integrate along a curve we are interested in theinfinitesimal displacement between two nearby points on the curve. Just imagine you are wrappingthe x-axis along the curve in question. First, lets consider two infinitesimally close (but otherwise arbitrary) points in the x-y plane. Oneof them has coordinates (x, y), and the other has coordinates (x+dx, y+dy). What is the displacementvector between them? Following the notation used by Griffiths, well call this vector d~`. The two pointsare separated by an infinitesimal distance dx in the x direction, and an infinitesimal distance dy inthe y direction, so the displacement vector is

d~` = dx x + dy y . (6)

The magnitude of this vector, which we will call d`, is the distance between the two points p p d` = | d~` | = d~` d~` = dx2 + dy 2 . (7)

We havent said anything about the points other than the fact that the distance between them isinfinitesimal. But what if they were both on a curve whose points are described by (x, y(x))? Thenone point is at (x, y(x)) and the other is at (x + dx, y(x + dx)). What is the displacement vectorbetween them in that case? Since y is a function of x, the displacement in the y direction is just dxtimes the derivative of y(x) with respect to x

y(x) dy = dx , (8) x

3 y

d{ yHxL ` dx x x ` dx x

Figure 4: Displacement between two infinitesimally close points on a curve.

so d ~` is given by y(x) d~` = dx x + dx y . (9) xThis is illustrated in Figure 4. Notice that the curve looks like a straight line, since we are zoomingin on an infinitesimally small patch of the x-y plane. The magnitude of d~` is s 2 y d` = dx 1 + , (10) xwhich is the distance between two infinitesimally close points on the curve.

Given a curve, what can we do with d~` ? Well, d` is the distance between two infinitesimally nearbypoints on the curve, so integrating d` along the curve should give us the length of the curve. Supposea and b are two points on the curve. Then the length of the curve between those points, which welldenote by s(a, b), is Z b s(a, b) = d` . (15) a

Now we want to integrate d` along the curve. Since d` is proportional to dx, this just turns into an integral like (1). Z Z p d` = dx x2 + 2x + 2

1 p 2 1 p 2

= (x + 1) x + 2x + 2 + log x + 1 + x + 2x + 2 . 2 2 Okay, this is kind of an ugly integral it will actually come up later this semester and well talk about how it is evaluated. To get the length of the curve we need to evaluate the definite integral from x = 1 to x = 3, which gives Z 3 p dx x2 + 2x + 2 = 6.34 . (16) 1

In this last example the integral of d` along the curve becomes an integral with respect to x. Whenthe curve is given in parametric form the integral is with respect to the variable that parameterizesthe curve.

5 Example: Find the length of the curve shown in Figure 3.

We already saw in a previous example that d` = dt 2 for this curve. To get the length we need to integrate along the curve from t = 0 to t = 6 Z 6 dt 2 = 6 2 . (17) 0

This was a little easier than the previous example.

4 Paths defined piecewise

Sometimes we will encounter paths that are defined piecewise. This means that they are described interms of a number of curves or straight line segments, with each one beginning where the previousone ended. An example is shown below, in Figure 5. Piecewise paths are easy to work with we just y 3.5

3.0

2.5

2.0

1.5

1.0

0.5

0.0 x 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5

Figure 5: A path that is defined piecewise.

deal with them one piece at a time. Thus, we might have different expressions for things like d~` oneach part of the curve, but aside from that there arent any other complications. As an example, the curve in Figure 5 is a diagonal line from (1, 12 ) to (3, 74 ), then a vertical linefrom (3, 74 ) to (3, 11 11 3 11 4 ), and finally a horizontal line from (3, 4 ) to ( 2 , 4 ). Along the first segment wecould describe the path as (x, y = 2 x + 4 ). Thus, d~` on this part is given by 1 1

6vertical line!), so dx = 0. Thus, d~`2 = dy y and d`2 = dy on this part. Finally, the third leg of thepath is horizontal, so dy = 0 there. Now, if were being careful and following the path as if we werewalking along it, wed use

d~`3 = dx x (21)

along the third leg, since were moving in the direction of decreasing x. However, d`3 = dx, since themagnitude of a vector is always positive.

5 Line IntegralsOkay, so we know how to describe curves, and we understand what d` is. How do we evaluate anintegral like (4)? Well, we actually just evaluated a few examples of these integrals the arc-lengthis what you get when you integrate the function 1 around the curve. But lets try something a littlemore involved. Well start with an example. Suppose we want to integrate the function f (x, y) = x2 y along the curve (x, y) = (cos t, sin t) with 4 t 3 4 . That is, we want to evaluate the integral Z f d` f (x, y) , (22) P i

where P, shown in Figure 6, is a semi-circle that starts at the point (1/ 2, 1/ 2) and ends at the

point (1/ 2, 1/ 2). We know how to determine d`, but we still need to work out what to do with y 1.5

1.0

0.5

x -1.5 -1.0 -0.5 0.5 1.0 1.5

-0.5

-1.0

-1.5

Figure 6: The curve (x, y) = (cos t, sin t) with 4 t 3

4 .

the function in the integrand. For this curve, d` is just

s x 2 2 y q d` = + = dt sin2 (t) + cos2 (t) = dt . (23) t t

7Now, we are integrating this function along the curve, so were only concerned with the values thefunction f (x, y) takes for points on the curve. In other words, we need to evaluate the function forpoints (x, y) = (cos t, sin t):

f (cos t, sin t) = (cos t)2 sin t . (24)

So the integral (22) is

1 1 = (27) 3 2 3 2 1 = . (28) 3 2Thats all there is to it you work out the appropriate d`, evaluate the rest of the integrand for pointson the curve, and then perform the integral. It isnt too hard to see what an integral like (22) means. First, lets plot the path in the x-y plane,with a third axis that well use to indicate the value of the function were integrating (Figure 7). Next, 1 y 0

-1

1.0

0.5

f Hx,yL 0.0

-0.5

-1.0

-1

0 x 1

Figure 7: The curve (x, y) = (cos t, sin t) with 4 t 3

4 .

well add the function f (x, y) = x2 y to the plot, along with a black curve that shows the value ofthe function at the points along the curve (Figure 8). Finally, lets take the function out of the plotbut leave the black curve that shows its value along the path were interested in. Filling in the areabetween our path and values of the function along the path makes the meaning of an integral like(22) clear: it gives the area of the shaded region in Figure 9. So you see, there isnt much differencebetween the simple integral (1) and the integral along a path in (4). The line integral may be a bitharder to visualize especially if the path winds around in three dimensions, so that we cant makea plot like Figures 8 or 9 but it still means basically the same thing.

Figure 9: The integral (22) gives the area of the shaded region between the two curves.

6 Vector FieldsNow we understand (at least in principle) how to evaluate any integral like (4): describe the curve,determine d`, evaluate the rest of the integrand for points on the curve, and then perform the resultingintegral. But we will encounter other line integrals which do not take quite the same form as (4). Theseintegrals involve vector fields. Recall that a vector field is just a vector with components that are functions (a plain old functionis a scalar ). For example, if were sticking to the x-y plane, an example of a vector field is

~ = y2 x V x y y . (29)

The x-component is the function y 2 , and the y-component is the function x y. This vector field isshown in Figure 10, with the direction and size of each arrow indicating the direction and magnitude,respectively, of the vector field at that point.

9 2

y 0

-1

-2

-2 -1 0 1 2 x

~ = y2 x Figure 10: The vector field V x y y.

~ , we are often interested in the integral

Given a vector field like V Z f d~` V ~ . (30) P i

If you take a minute to think about what the integrand means, youll see that this integral isnt reallythat different than (4). We understand what d~` is its the infinitesimal displacement vector alongthe path and we know how to take its dot product with the vector V ~ . So, to evaluate (30) we takethe integrand

d~` V ~ = dx Vx + dy Vy , (31)

work out what each part is on the curve, and perform the integral (if this were a three-dimensionalcurve and vector field, there would also be a dz Vz term). Lets work out a few examples.