Integrals 215 problem 09.mws

1. Approximating arc length by polygons.

In this exercise, we study how to approximate a curve by polygons, that is, we replace the curve with line segments joining some points on the curve. Since we know how to find the length of a line segment exactly, we can approximate the length of the curve by the lengths of the approximating polygonal curves.

Let us study the arclength of the function given by f(x) = x*(4-x)^(1/3) , over the domain given by x = 0 .. 4 .

> f:=x->x*(4-x)^(1/3);

f := proc (x) options operator, arrow; x*(4-x)^(1/3...

To plot a sequence of line segments between points in Maple, we first define the sequence of points. Suppose we want to divide the interval [ a, b ] into n segments. The points are given by a sequence of the form ( x[i], f(x[i]) ), where x[i] = a+i*(b-a)/n . These divisions are the same as we used for Riemann sums. Then the sequence command can be used to list the points as follows.

> points:=proc(n)

> seq([(a+i*(b-a)/n),(f(a+i*(b-a)/n))],i=0..n);

> end;

points := proc (n) seq([a+i*(b-a)/n, f(a+i*(b-a)/n)...

To use this command to list points, you need to define the function f and the endpoints a and b . For example, to make 4 line segments we proceed as follows.

> a:=0;b:=4;

a := 0

b := 4

> points(4);

[0, 0], [1, 3^(1/3)], [2, 2*2^(1/3)], [3, 3], [4, 0...

We can plot the line segments connecting these points as follows.

> plot([points(4)],linestyle=3,color=red);

[Maple Plot]

Let us plot both the curve and the line segments on the same graph in order to see what the picture looks like. We need the package plots to use the display command for multiple plots on the same axes.

> with(plots):

> plot1:=plot(f(x),x=0..4,color=blue):

> plot2:=plot([points(4)],linestyle=3,color=red):

> display(plot1,plot2);

[Maple Plot]

To compute the sum of the lengths of the line segments connecting these points, note that the length of the line segment between the points ( x[i-1], f(x[i-1]) ) and ( x[i], f(x[i]) ) is simply sqrt(((b-a)/n)^2+(f(x[i])-f(x[i-1]))^2) . Thus all we have to do is sum all these lengths up. We can do this easily in Maple as follows.

> n:=4;

n := 4

> evalf(sum(sqrt(((b-a)/n)^2+(f(a+i*(b-a)/n)-f(a+(i-1)*(b-a)/n))^2),i=1..n));


This gives us an approximate value of the arclength of the curve. Let us compare this approximate value with Maple's evaluation of the exact arclength of the curve. To compute the exact arclength, we compute the following integral.

> int(sqrt(1+D(f)(x)^2),x=a..b);

int(sqrt(1+((4-x)^(1/3)-1/3*x/(4-x)^(2/3))^2),x = 0...

Here Maple does not evaluate the integral, because it does not know how to do this exactly. But Maple can give us a floating point estimate for the value of the integral.

> evalf(int(sqrt(1+D(f)(x)^2),x=a..b));


This value is not too far from our estimate using only four intervals. Let us try the same using 100 intervals.

> n:=100;evalf(sum(sqrt(((b-a)/n)^2+(f(a+i*(b-a)/n)-f(a+(i-1)*(b-a)/n))^2),i=1..n));

n := 100


This time the estimate is much closer. Ideally, we would like to have error bounds for our estimates, as we did for the Trapezoid Rule and Simpson's Rule.


Let f(x) = x+sin(x) on the interval [0, 2*Pi] .

1) Divide the interval into 4 pieces and plot the curve and the polygonal path that approximates the curve on the same plot.

2) Find a floating point approximation of the integral that computes the exact length of the curve.

3) Estimate the length of the curve using the division into 4 line segments in part 1.

4) Find an n so that if the interval is divided into n pieces, the error in summing the lenths of the polygonal approximation is less than 0.001.

Submission worksheet:


2. Setting up the integral for arc length:

Suppose that we are given a curve defined by x = ln(sec(y)) , over the interval given by x = 0 .. ln(2) . We could compute the arclength by solving for y as a function of x , but we can avoid doing this and save some time and effort. Recall that the integrand for arclength is sometimes written as sqrt(dx^2+dy^2) . In our example above, if we differentiate implicitly, we obtain dx = tan(y)*dy , so that

sqrt(dx^2+dy^2) = sqrt((1+tan(x)^2)*dy^2) = sec(y)*dy

In order to justify the last step, we need to know the values that y takes on as x goes from 0 to ln(2) . But 0 = ln(sec(0)) and ln(2) = ln(sec(Pi/3)) , so the corresponding interval for y is y = 0 .. Pi/3 . On this interval, sec(y) is always positive, so that sqrt(1+tan(y)^2) = sec(y) .

We can compute the arclength of this curve as simply

> int(sec(y),y=0..Pi/3);


Note that this is one of those rare curves where Maple can compute the integral representing an arc length exactly. Actually, so can you, because the indefinite integral of the secant function can be computed by the following trick

Int(sec(x),x) = Int(sec(x)*(sec(x)+tan(x))/(sec(x)+... .

Even if Maple could not compute the integral exactly, we could always obtain a floating point estimate for the integral in the form below.

> evalf(int(sec(y),y=0..Pi/3));


Let us plot the curve and see if the answer looks at all reasonable. Because x is given as a function of y , if we wish to plot the curve with the axes in the usual positions, we will need to use the implicitplot command. This means that we shall have to load the package plots , if we have not already done so.

> with(plots):

> implicitplot(x=ln(sec(y)),x=0..ln(2),y=0..Pi/3);

[Maple Plot]


For the curve given by x = sqrt(1-y^2) , y = 0 .. 1 , do the following.

1) Set up an integral that represents the arc length.

2) Compute this arc length exactly in Maple.

3) Plot the function. Use scaling=constrained.

4) Explain why the graph leads to an explanation of the answer you obtained in 2).

Submission worksheet:


3. Arc length for parameterized curves.

Recall that if a curve is given parametrically in terms of the parameter t , in the form x = x(t) and y = y(t) , where t = alpha .. beta , then the parametric formula for the length L of the curve is

L = int(sqrt(D(x)(t)^2+D(y)(t)^2),t = alpha .. beta... .

For example, suppose that x = cos(t) and y = t+sin(t) , for t = 0 .. Pi . Then we can compute this integral easily as follows.

> x:=t->cos(t);y:=t->t+sin(t);

x := cos

y := proc (t) options operator, arrow; t+sin(t) end...

> int(sqrt(D(x)(t)^2+D(y)(t)^2),t = 0..Pi);


Let us plot this curve parametrically as well. The form for a parametric plot of a single curve is as follows.

> plot([cos(t),t+sin(t),t=0..Pi]);

[Maple Plot]

Let us try to solve for y as a function of x . Note that x^2 = cos(t)^2 = 1-sin(t)^2 , so that sin(t)^2 = 1-x^2 , and thus we have sin(t) = sqrt(1-x^2) . Since t = arccos(x) , we can express y = arccos(x)+sqrt(1-x^2) . Let us check this formula by plotting, and comparing to our parametric plot.

> plot(arccos(x)+sqrt(1-x^2),x=-1..1);

[Maple Plot]

Using the expression for y as a function of x , we could compute the arclength directly. Note that x = -1 .. 1 , so our integral can be computed as follows:

> f:=x->arccos(x)+sqrt(1-x^2);

f := proc (x) options operator, arrow; arccos(x)+sq...

> int(sqrt(1+D(f)(x)^2),x=-1..1);


Thus we could either solve for one of the variables as a function of the other, and then use the standard methods of computing arc length, or we can use the parametric formula to compute the length of the curve directly. However, in many cases, it might be impossible to solve for one variable in terms of the other, so that the parametric form for arc length is the only method available to us.


Suppose that a curve is given by the parametric equations x = exp(t)*cos(t) , y = exp(t)*sin(t) , t = 0 .. Pi .

1) Compute the length of this curve using the parametric formula for arc length.

2) Plot this curve parametrically.

Submission worksheet:


4. More on arc length.

Consider the curve given by the equation y = int(sqrt(sec(t)^2-1),t = 0 .. x) . on x = -Pi/3 .. Pi/3 .

Submission worksheet:

1) The right hand side of the equation is an expression which determines y as a function of x . Find the derivative of

this function. ( Hint : Use the fundamental theorem of calculus, not Maple, to solve it.)

2) Plot the curve in Maple.

3) Find the length of the curve.

Submission worksheet: