Mathematics 134 – Intensive Calculus For Science 2 Lab Day 3: Applications of Integration: Arc Length of Curves February 27, 2002

Background

Imagine a thin, curved wire in a plane. A basic measurement problem is to determine the length of the wire (if possible without deforming its shape!) We can model the shape of the wire mathematically by giving a curve in the plane – in simple cases, the graph of a function y = f(x) for x ∈ [a, b]. The length of the graph (measured “along the curve” is called its arc length. Today we will use Maple to compute the arc length of some graphs. As with other problems we have studied, the basic approach is to subdivide and approximate. Suppose we subdivide [a, b] into n smaller intervals. If Δx is small enough (and f is a “nice” function) the segment of the graph between x and x + Δx will be nearly straight, hence can be approximated by a the straight line segment joining the two points on the graph. Writing Δy = f(x + Δx) − f(x), we have by the Pythagorean theorem:

length of segment ≐ \sqrt{Δx^{2} + Δy^{2}}

= \sqrt{1 + (\frac{Δy}{Δx})^{2}} · Δx.

So the total length is approximated by a sum

total length = ∑ \sqrt{1 + (\frac{Δy}{Δx})^{2}} · Δx

As n → ∞ and Δx → 0 the limit of this sum gives a definite integral. Since

lim_{Δx→0} \frac{Δy}{Δx} = f′(x),

the derivative of f, the integral for arclength of the graph y = f(x) is

arc length = ∫_{a}^{b} \sqrt{1 + (f′(x))^{2}} dx

More about the int Command in Maple

1. Indefinite Integrals

To ask Maple calculate an indefinite integral such as

∫ \frac{x − 4}{x^{2} + 2x + 5} dx

we could use a command such as

                         int((x-4)/(x^2+2*x+5),x);

Maple knows all of our basic antiderivative rules, plus a large table of integrals (much more extensive than the one in our textbook). Try this and differentiate the output by hand to check that it is correct. (Note: by completing the square, x^{2} + 2x + 5 = (x + 1)^{2} + 4 which has no real roots. This is an integral of the form # 25 from the table in the text, if you substitute u = x + 1 and convert the entire integrand to an expression in u.)

The general format of the indefinite integral command is

                           int(expression,var);

where expression is the formula for the integrand, and var is the variable you are integrating with respect to. (It may help to think of this as corresponding to the “dx” in the mathematical notation.) The variable can be any variable appearing (or not) in the expression.

On many examples, Maple will not be able to do anything to get an indefinite integral in terms of the usual elementary functions. When this happens it will just echo your input. (For instance, you can try ∫ e^{x^{4}}dx.) In some cases, doing some preliminary substitution “by hand” will give Maple something it can work with. But be aware that even though some functions can be handled by our general methods (and others we have not discussed), very few functions actually have elementary antiderivatives.

2. Definite Integrals

To do definite integrals in Maple, you use the same int command, but in a slightly different format. For instance, suppose we want to compute

∫_{1}^{2} \frac{x − 4}{x^{2} + 2x + 5} dx

We can use the command

                      int((x-4)/(x^2+2*x+5),x=1..2);

(Note the limits of integration added to the previous command, in the same format as a range of values for plotting.) Your output from this command should be equivalent to

\frac{1}{2} ln(13) − \frac{5}{2} arctan(\frac{3}{2}) − \frac{1}{2} ln(8) + \frac{5}{8}π

As you can easily verify, this is just the result of applying the Fundamental Theorem of Calculus with the antiderivative (indefinite integral) from before.

If Maple can generate an exact, symbolic expression for a definite integral it will do that and give that as the output, unless directed otherwise.

If you want a decimal approximation to the value, rather than an exact, symbolic expression you can put the whole int command from above “inside” a call to the evalf function:

                   evalf(int((x-4)/(x^2+2*x+5),x=1..2));

This will use a very accurate numerical method to compute an approximate value.

A Worked Example

Suppose we wanted to find the arc length of y = f(x) = (e^{x} + e^{−x})/2 from x = 0 to x = 1. We can use Maple to attack this as follows. First we can define the function f(x) using

                        f := (exp(x) + exp(-x))/2;

Then the arclength integral (indefinite) is

                       int(sqrt(1 + diff(f,x)^2),x);

Maple should give you as output:

\frac{1}{2}e^{x} − \frac{1}{2} \frac{1}{e^{x}}

This is one of the rare cases where an arclength integral actually has an elementary antiderivative. If you enter the Maple command to find the definite integral:

                    int(sqrt(1 + diff(f,x)^2),x=0..1);

then Maple will use the Fundamental Theorem of Calculus and the indefinite integral above to compute the definite integral.

In most cases, this will not be possible, though, and the best we will be able to do is to generate a numerical appoximation to the arclength, using a command of the form:

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

For instance, if you do this on the integral above, you should get a numerical approximation 1.175201194 to

∫_{0}^{1} \sqrt{1 + (f′(x))^{2}} dx

for f(x) = (e^{x} + e^{−x})/2.

Lab Questions

A) Using Maple as above, get decimal numerical approximation the length of the graphs y = x^{n}, x = 0 to x = 1, for n = 1, 2, 10, 20, 100.

B) For which of the n’s in question A is there an elementary antiderivative for the arc length integrand \sqrt{1 + (nx^{n−1})^{2}} (or at least one that Maple can find)?

C) Discuss any patterns or trends you see in the calculations in question A. In particular, can you guess something about the arc lengths of the graphs y = x^{n}, (x = 0 to x = 1), as n → ∞? Plotting the graphs y = x^{n}, n = 1, 2, 10, 20, 100 together may help to visualize and/or explain this.

Lab Assignment Writeups for questions A) - C) due in class on Wednesday, March 13.