Mathematics 136, section 4 – AP Calculus Lab Day 4: Applications of Integration, Arc Length of Curves November 5, 2003

Goals

Today we will learn Maple’s commands for definite integration, and apply them to some problems about applications of integration.

Maple’s int command

To do definite integrals in Maple, we will use the int command. 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 are specified as a range of values of the integration variable, in the same format as a range of values for plotting.) Your output from this command should be

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

As you can verify, this is just the result of applying the Fundamental Theorem of Calculus to an antiderivative of (x − 4)/(x^{2} + 2x + 5) (the form is # 25 from our table of integrals if you complete the square in the denominator: x^{2} + 2x + 5 = (x + 1)^{2} + 4, and substitute u = x + 1 everywhere to convert to an integral like the table entry).

Important fact: 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 integrate command, capitalized to Int, “inside” a call to the evalf function:

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

This will use a numerical method (basically a Riemann sum with varying Δx’s chosen to yield an approximation good to a large number of decimal places) to compute an approximate value.

Maple can also look for an indefinite integral (it “knows” all the methods we have discussed, and then some!). You would do that using a similar command, but omitting the limits of integration:

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

(The x in the command specifies the integration variable. To remember to include it, you can think of the dx in our usual way of writing the indefinite integral(!))

Lab Questions, part 1

A) Set up the definite integral to compute the volume of the solid obtained by rotating the region bounded by y = xe^{−x}, the x-axis, x = 0, and x = 1 about the line y = −2 in the xy-plane. (What do the cross-sections by planes perpendicular to the x-axis look like?). Use Maple to find this volume.

Another Application of Integrals – 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!) If we knew the density of the wire at each point, we could also ask what its total mass is.

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 learn how to compute the arc length of a graph in mathematical terms. As with other problems we have studied, the basic approach is to subdivide and approximate. Suppose we subdivide [a, b] into n smaller intervals with endpoints

a = x_{0} < x_{1} < x_{2} < ⋯ < x_{n−1} < x_{n} = b

If Δx is small enough (and f is a “nice” function), the segment s_{i} of the graph from (x_{i−1}, f(x_{i−1})) to (x_{i}, f(x_{i})) will be nearly straight, hence can be approximated by a the straight line segment ℓ_{i} joining the two points on the graph. Writing Δy_{i} = f(x_{i})−f(x_{i−1}), we have by the Pythagorean theorem:

length of s_{i} ≐ \sqrt{Δx^{2} + Δy_{i}^{2}}

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

So the total length is approximated by a sum

total length ≐ ∑_{i=1}^{n} \sqrt{1 + (\frac{Δy_{i}}{Δx} )^{2}} · Δx

Even though this is not exactly a Riemann sum as it stands (because the expression \frac{Δy_{i}}{Δx} is not formed by evaluating a particular function at a chosen point x_{i}^{∗}), it is still true that as n → ∞ and Δx → 0 the limit of this sum gives a definite integral. Since

lim_{Δx→0} \frac{Δy_{i}}{Δ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

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));

This command instructs Maple to approximate the definite integral using a Riemann sum method as discussed above.

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, part 2

B) 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. Discuss any patterns or trends you see in the calculations. 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.

C) A thin wire in the shape of the graph y = x^{3}, x ∈ [−1, 1] (in cm’s) has density d(x) = 3 + x g/cm at the point (x, x^{3}).

1) Develop, and fully explain in your solution, a method for approximating the total mass of the wire using the ideas about arclength above. Note that different portions of the wire will have different densities. Hence segments of the same length can have different masses.

2) Use your method and Maple to approximate the total mass. (Answer: ≐ 9.29 g)

Lab Assignment: Writeups for questions A), B), C) as a Maple worksheet, due in class on Monday, November 10.