LineIntegrals PDF
LineIntegrals PDF
LineIntegrals PDF
This integral of a single variable is the simplest example of a ‘line integral’. A line integral is just an
integral of a function along a path or curve. In this case, the curve is a straight line – a segment of the
x-axis that starts at x = a and ends at x = b. Just so we’re clear on notation, I’ll write the indefinite
integral 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 path
P through space that starts at (xi , yi , zi ) and snakes around until it ends at (xf , yf , zf ). You can
integrate h(x, y, z) along the path P just like you integrated f (x) with respect to x in (1). Here is
how 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 we’re integrating along a specific
path or curve (I’ll use the terms ‘path’ and ‘curve’ interchangeably). Integrating along a different
curve may or may not give a different answer. Second, the limits i and f on the integral refer to the
starting point (xi , yi , zi ) and end point (xf , yf , zf ), respectively. Third, d` is the infinitesimal distance
from point to point along the path. The really important thing to notice here is that there is a single
integration variable, because we are integrating along a path. You only need one variable to describe
where you are on a curve, so there is only one variable to integrate! Over the next few sections we’ll
unpack all this and figure out how to evaluate integrals like (4).
2 Curves
Before 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 we’ll work with three variables, but
let’s start simple). You may be able to do this by telling me y as a function of x, along with the start
and 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.
1
collection of points (x, y = 2 x2 + x − 3) with 1 ≤ x ≤ 3 is a perfectly good way of describing this
curve.
Of course, this doesn’t always work. Consider a curve like the one shown in Figure 2. Do you think
you could describe it in the same way as the curve in Figure 1? It’s 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
curve, but if you try to describe the points in the form (x, y(x)) you run into a problem: there are
different points on the curve with the same value of x! As an example, look at values of x close to
x = 1. Since a function y(x) can’t give two different values for a given x, you can’t describe this curve
like the previous one. Instead, you need to give a parametric description of the curve, which means
expressing 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)
4
You could come up with many other parameterizations of this curve, too – there is no unique way of
doing it.
The last two examples are curves in the x-y plane, but a path through three dimensional space
with coordinates (x, y, z) works the same way. For example, you may be able to describe a curve by
expressing y and z as functions of x, as (x, y(x), z(x)). If this isn’t possible you can always give a
parametric description of the form (x(t), y(t), z(t)) with ti ≤ t ≤ tf . For example, Figure 3 shows the
curve (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
d~` = dx x̂ + dy ŷ . (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 haven’t said anything about the points other than the fact that the distance between them is
infinitesimal. But what if they were both on a curve whose points are described by (x, y(x))? Then
one point is at (x, y(x)) and the other is at (x + dx, y(x + dx)). What is the displacement vector
between them in that case? Since y is a function of x, the displacement in the y direction is just dx
times the derivative of y(x) with respect to x
∂y(x)
dy = dx , (8)
∂x
3
y
®
d{
¶ yHxL
dx x̀
¶x
dx x̀
so d ~` is given by
∂y(x)
d~` = dx x̂ + dx ŷ . (9)
∂x
This is illustrated in Figure 4. Notice that the curve looks like a straight line, since we are zooming
in on an infinitesimally small patch of the x-y plane. The magnitude of d~` is
s 2
∂y
d` = dx 1 + , (10)
∂x
which is the distance between two infinitesimally close points on the curve.
Example: Express the distance between two infinitesimally close points on the curve y(x) =
x3 − 2 x2 in terms of dx .
∂y
d~` = dx x̂ + dx ŷ
∂x
= dx x̂ + 3 x2 − 4 x dx ŷ
q
⇒ d` = dx 1 + (3 x2 − 4 x)2 .
Things work in exactly the same way if the curve is given in the parametric form (x(t), y(t)). The
displacement between the two points at (x(t), y(t)) and (x(t + dt), y(t + dt)) is
∂x(t) ∂y(t)
d~` = dt x̂ + dt ŷ , (11)
∂t ∂t
and the distance is
s 2 2
∂x ∂y
d` = dt + . (12)
∂t ∂t
What if we are interested in a curve in three dimensions? If it is given in the parametric form
(x(t), y(t), z(t)) then the displacement and distance between two infinitesimally nearby points are
∂x(t) ∂y(t) ∂z(t)
d~` = dt x̂ + dt ŷ + dt ẑ (13)
∂t ∂t ∂t
s
∂x 2
2 2
∂y ∂z
d` = dt + + . (14)
∂t ∂t ∂t
4
Example: What are d~` and d` for the curve shown in Figure 3?
∂x ∂y ∂z
= − sin(t) = cos(t) =1
∂t ∂t ∂t
Given a curve, what can we do with d~` ? Well, d` is the distance between two infinitesimally nearby
points on the curve, so integrating d` along the curve should give us the length of the curve. Suppose
a and b are two points on the curve. Then the length of the curve between those points, which we’ll
denote 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 we’ll 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. When
the curve is given in parametric form the integral is with respect to the variable that parameterizes
the 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
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
deal with them one piece at a time. Thus, we might have different expressions for things like d~` on
each part of the curve, but aside from that there aren’t any other complications.
As an example, the curve in Figure 5 is a diagonal line from (1, 12 ) to (3, 74 ), then a vertical line
from (3, 74 ) to (3, 11 11 3 11
4 ), and finally a horizontal line from (3, 4 ) to ( 2 , 4 ). Along the first segment we
could describe the path as (x, y = 2 x + 4 ). Thus, d~` on this part is given by
1 1
d~`1 = dx x̂ + dy ŷ (18)
∂y
= dx x̂ + dx ŷ (19)
∂x
1
→ d~`1 = dx x̂ + dx ŷ , (20)
2
p
and its magnitude is d`1 = dx 5/4 1 . On the second leg of the path x is not changing at all (it’s a
1
This makes sense, right? For every dx you move horizontally, you also move up a bit vertically, as well.
6
vertical line!), so dx = 0. Thus, d~`2 = dy ŷ and d`2 = dy on this part. Finally, the third leg of the
path is horizontal, so dy = 0 there. Now, if we’re being careful and following the path as if we were
walking along it, we’d use
along the third leg, since we’re moving in the direction of decreasing x. However, d`3 = dx, since the
magnitude of a vector is always positive.
5 Line Integrals
Okay, so we know how to describe curves, and we understand what d` is. How do we evaluate an
integral like (4)? Well, we actually just evaluated a few examples of these integrals – the arc-length
is what you get when you integrate the function ‘1’ around the curve. But let’s try something a little
more involved. We’ll 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
7
Now, we are integrating this function along the curve, so we’re only concerned with the values the
function f (x, y) takes for points on the curve. In other words, we need to evaluate the function for
points (x, y) = (cos t, sin t):
This integral can be worked out using the change of variable u = cos t, and we get
Z 3π 3π
4
2 1 4
3
dt (cos t) sin t = − (cos t) (26)
− π4 3 − π4
!
1 3 1 3
1 1
= − −√ − − √ (27)
3 2 3 2
1
= √ . (28)
3 2
That’s all there is to it – you work out the appropriate d`, evaluate the rest of the integrand for points
on the curve, and then perform the integral.
It isn’t too hard to see what an integral like (22) means. First, let’s plot the path in the x-y plane,
with a third axis that we’ll use to indicate the value of the function we’re 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
we’ll add the function f (x, y) = x2 y to the plot, along with a black curve that shows the value of
the function at the points along the curve (Figure 8). Finally, let’s take the function out of the plot
but leave the black curve that shows its value along the path we’re interested in. Filling in the area
between 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 isn’t much difference
between the simple integral (1) and the integral along a path in (4). The line integral may be a bit
harder to visualize – especially if the path winds around in three dimensions, so that we can’t make
a plot like Figures 8 or 9 – but it still means basically the same thing.
8
1
y
0
-1
1.0
0.5
f Hx,yL
0.0
-0.5
-1.0
-1
0
x
1
Figure 8: The function f (x, y) = x2 y, and its values on the curve we’re integrating along.
1
y
0
-1
1.0
0.5
f Hx,yL
0.0
-0.5
-1.0
-1
0
x
1
Figure 9: The integral (22) gives the area of the shaded region between the two curves.
6 Vector Fields
Now 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 resulting
integral. But we will encounter other line integrals which do not take quite the same form as (4). These
integrals involve vector fields.
Recall that a vector field is just a vector with components that are functions (a plain old function
is a scalar ). For example, if we’re sticking to the x-y plane, an example of a vector field is
~ = y 2 x̂ − x y ŷ .
V (29)
The x-component is the function y 2 , and the y-component is the function −x y. This vector field is
shown 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
~ = y 2 x̂ − x y ŷ.
Figure 10: The vector field V
If you take a minute to think about what the integrand means, you’ll see that this integral isn’t really
that different than (4). We understand what d~` is – it’s the infinitesimal displacement vector along
the path – and we know how to take its dot product with the vector V ~ . So, to evaluate (30) we take
the 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-dimensional
curve and vector field, there would also be a dz Vz term). Let’s work out a few examples.
d~` · V
~ = y 2 dx − x y dy (32)
1
Along the curve we’re interested in, y = 2 x2 + x − 3, dy = (x + 1) dx, and (32) becomes
2
1 2 1 2
d~` · V
~ = x +x−3 dx − x x +x−3 (x + 1) dx
2 2
1 2 1 3
= − x − x − 3 x + 9 dx .
4 2
10
The curve in Figure 1 runs from x = 1 to x = 3, so the integral is
Z 3 3
1 1 1 5 1 4 3 2
− x4 − x3 − 3 x + 9
dx = − x − x − x + 9 x
1 4 2 20 8 2 1
161
= − .
10
~ is
and the vector field V
The integrand is
d~` · V
~ = − sin t cos2 t + t sin t cos t − sin t cos t dt .
11