Calculus IV with Maple
Copyright 2002, Dr. Jack Wagner
j.wagner@intelligentsearch.com
Lesson 8: Arc Length and Line Integrals
For curves
, we approximate the arc length by the sum of the lengths of a sequence of chords.
We want to add the lengths of the chords as an estimate of arc length, for any arbitrary number, n, of chords. By increasing the number of chords we refine the estimate of length. The arc length is defined as the limit of this sum as n goes to infinity. When this limit exists, the curve is rectifiable. A necessary and sufficient condition for a curve to be rectifiable is that it be continuously differentiable.
Example 8.1
Let
, and find its arc length between t=1 and t=2.5.
| > | restart: with(plots): with(LinearAlgebra): with(VectorCalculus): |
| > | h := <t*cos(t), t*sin(t), t>; |
| > | P1 := spacecurve(evalm(h), t=1..2.5, color=black, thickness=1): |
Define the chords
| > | pts := [seq(evalm(subs(t=k/2, h)), k=2..5)]: |
Plot the chords
| > | P2 := pointplot3d(pts, connect=true, color=red): |
| > | display(P1, P2, axes=framed); |
Now compute the sum of the lengths of p chords.
| > | L := p->sum(Norm(eval(h, t=1+(3/(2*p))*(k+1))-eval(h, t=1+(3/(2*p))*k), 2), k=0..p-1): |
| > | L(p); |
An approximation of the arc length of the curve
| > | evalf( Limit(L(q), q=infinity) ); |
For a curve parameterized by t,
, the arc length from t=a to t=b is:
=
| > | dh[t] := diff(h, t); |
| > | ds := Norm(dh[t], 2); |
Simplify the expression for ds.
| > | ds := simplify( ds ) assuming real; |
The exact arc length using integration
| > | int(ds, t=1..5/2); |
Numeric approximation of the above
| > | evalf(%); |
Example 8.2
Find the length of the curve
, from t=1 to t=7.
| > | restart: with(plots): with(LinearAlgebra): with(VectorCalculus): |
| > | h := <-t^2+3*t, sin(t), t^3>; |
| > | spacecurve(evalm(h), t=1..7, axes=framed, labels=[x, y, z], color=red); |
| > | df := diff(h, t); |
| > | ds := Norm(df, 2); |
| > | ds := simplify( ds ) assuming real; |
This integral cannot be evaluated in closed form, so Maple simply echoes it back.
| > | int(ds, t=1..7); |
But we can approximate it numerically.
| > | evalf(%); |
Line Integrals
If a particle is moving along the curve,
, under the influence of a force F, now much work will be done as the particle moves from point a to point b, say from t=a to t=b ?
Example 8.3
Returning to Example 1, Let
, compute the work done by a force in the z direction
. First look at the tangents to the curve.
| > | restart: with(plots): with(LinearAlgebra): with(VectorCalculus): |
| > | h := <t*cos(t), t*sin(t), t>; |
| > | dh[t] := diff(h, t); |
| > | dh[s] := simplify( dh[t]/Norm(dh[t], 2) ) assuming real; |
| > | for k to 25 do T||k := evalm(subs(t=k/10, h)+s*subs(t=k/10, dh[s])) end do: |
Note the use of the concatenation operator, "||", to label the tangents.
| > | S1 := spacecurve(evalm(h), t=1..2.5, color=black, thickness=2): |
| > | S2 := seq(spacecurve(eval(T||k), s=0..1, color=red), k=10..25): |
| > | display(S1, S2, axes=framed, labels=[x, y, z]); |
The tangents point upward in the direction of increasing t.
Now we define the force vector and evaluate it on the curve. In the present case the vector expression for F is F=[0, 0, -ln(z)].
| > | F := <0, 0, -ln(z)>; |
| > | Fh := subs({x=h[1], y=h[2], z=h[3]}, F); |
At each point where we have drawn a tangent we would like to see a vector representing the applied force.
| > | for k to 25 do F||k := evalm(subs(t=k/10, h)+s*subs(t=k/10, Fh)) end do: |
Note that for s=0 each Fk is a point on the curve; for s=1 each Fk is the tip of the vector representing F.
| > | S3 := seq(spacecurve(eval(F||k), s=0..1, color=blue), k=10..25): |
| > | display(S1, S2, S3, axes=framed, labels=[x, y, z]); |
The component of the force in the direction of the tangent is easily found and visualized.
| > | k := 'k': |
| > | FT := subs(t=k/10, dh[s]).subs(t=k/10, Fh); |
| > | for k to 25 do v||k := subs(t=k/10, h) + s*subs(t=k/10, dh[s])*FT; end do: |
The parameter range s=0..4 multiplies the length of the force vectors by 4 for ease of visibility.
| > | S4 := seq(spacecurve(evalm(v||k), s=0..4, color=magenta), k=10..25): |
| > | display(S1, S4, axes=framed); |
The components of force in the direction of the tangents point downward along the curve.
The line integral,
integrates the magnitude of the force in the direction of the tangent vectors over the length of the curve. To visualize this we must straighten out the curve and lay it down on the x axis, relabel the the x axis as the s axis, and erect perpendiculars the height of the force magnitude at points along the curve, corresponding to equidistant values of t, along the new s axis. In effect we graphically reparameterize
as a function of s.
First, we compute the arc length from t=1 to points from 1 to 2.5 in steps of 0.1.
| > | ds[t] := simplify( Norm(dh[t], 2) ) assuming real; |
| > | s := k->evalf(int(ds[t], t=1..k/10)): |
We need coordinate points along the s axis corresponding to these distances with t=1 as the zero point.
| > | S1 := seq([s(k), 0], k=10..25); |
Now we need a sequence of points with these same distances as the abscissa and the magnitude of force as the ordinate.
| > | S2 := [seq([s(k), evalf(subs(k=k, FT))], k=10..25)]; |
The peculiar syntax "k=k" works because Maple reads the right side of the equation first. P1 is a sequence of plot structures each of which connects corresponding points in the two sets.
| > | P1 := seq(pointplot([S1[j], S2[j]], color=red, connect=true), j=1..16): |
P2 is a plot structure connecting the points representing the force magnitudes.
| > | P2 := pointplot(S2, connect=true, color=red, thickness=2, labels=[s, 'Force']): |
| > | display(P1, P2); |
fit
| > | with(stats): |
| > | xvals := [seq(S2[k, 1], k=1..16)]; |
| > | yvals := [seq(S2[k, 2], k=1..16)]; |
After two trials, starting with third degree polynomials, we find that the following result produces the plot below.
| > | eq := fit[leastsquare[[s, y], y=mm*s^4+nn*s^3+pp*s^2+qq*s+rr, {mm, nn, pp , qq, rr}]]([xvals, yvals]); |
Values of s corresponding to t=1 and 2.5
| > | x1 := s(10); x2 := s(25); |
| > | P3 := plot(rhs(eq), s=x1..x2, color=blue, thickness=3): |
| > | display(P1, P2, P3); |
The polynomial is visually indistinguishable from the original plot. Actually, the third degree polynomial was almost as good. Integration of the polynomial yields:
| > | int(rhs(eq), s=x1..x2); |
How about the real thing? The line integral is easily found; in this case with the formula
.
| > | int(Fh.dh[t], t=1..2.5); |
Considering the number of calculations involved and the inevitable loss of accuracy due to rounding etc. this is good agreement. The negative sign indicates that the particle must do work in moving up the curve against the resistance of the force.
Example 8.4
Integrate the function,
over the path described by
between
and
.
| > | restart:with(plots): with(LinearAlgebra): with(VectorCalculus): |
| > | f := <t, t^2, t>; |
| > | spacecurve(evalm(f), t=0..10, axes=framed, labels=[x, y, z], color=red); |
| > | df := diff(f, t); |
| > | ds := Norm(df, 2); |
| > | h := exp(-.1*t); |
| > | Int(h*ds, t=0..10); |
| > | evalf(%); |
Practice
1. For each of the following, plot the curve and find its length over the range indicated.
2. For each of the following repeat the exercise of the text; i.e. plot the curve and its unit tangents, together with the "force vectors". Then plot the curve with the "force vector" components in the direction of the unit tangents. Finally, find the line integral of the given force function along the curve over the given range.
3. For each of the problems in #2, graphically reparameterize the "force vector" as a function of s. Now approximate the force function with a polynomial, and integrate the polynomial over s to obtain an approximation to the answer. Check
with the results found in #2.