Mathematics 36, section 1 -- AP Analysis

Lab Day 5

October 8, 1997

Background and Goals

Mathematicians have long been interested in computing numerical approximations to the number pi, the ratio of the circumference to the diameter in a circle in the plane. Apart from the simple desire to know the value of pi accurately, these efforts have also served as a test of the computing power humans have mastered, and of our understanding of the mathematics underlying the universe. The current state of the art includes methods of computing pi accurate to hundreds of millions of decimal digits. We will not be able to get results that good, but we will use Taylor series approximations in Maple to generate numerical approximations to the number pi and see how one method can be better than another. The starting point for today's work is the observation that pi can be computed in various ways using the arctangent function. For example, since arctan(1) = pi/4,

(1) pi = 4 arctan(1)

Lab Questions

A) Use the Maple taylor function to compute the Taylor polynomials of degree n = 10,20,30 for arctan(x) at a = 0. What is the pattern? Can you guess what the full Taylor series will look like?

B) (Note: you may want to do this problem by hand after the lab and submit your work on a separate sheet.) To provide confirmation for the pattern from A, we can do the following. First, from the geometric series sum formula we talked about in class on Tuesday, Oct. 7,

1/(1 - u) = 1 + u + u2 + u3 + ...

which is valid for u with |u| < 1. If u = -x2 for some x with |x| < 1, then |u| = |x2| < 1, so substituting in, we get:

(2) 1/(1 + x2) = 1 - x2 + x4 - x6 + ... .

What happens when you integrate -- that is antidifferentiate -- both sides of the previous equation (computing the integral of the series term by term) and use the fact that arctan(0) = 0. How does your answer relate to the Taylor series for arctan(x) from part A?

C) Since the series (2) does not add up to a definite result for x = 1, we have no real reason to expect the Taylor series for arctan(x) adds up to a finite result either. But here is a way to test things out. Maple has a built in {tt sum} function that can be used to add up collections of terms. The general format of the command to compute a sum like term(low) + term(low+1) + ... + term(high) is

sum(term(k),k=low..high);

For the arctangent series, the {tt term(k)} is (-1)^k/(2*k+1). For instance, what happens if you enter

4*sum(evalf((-1)^k/(2*k+1)),k=0..10);

then change {tt high to 20,50,100,200,500? Make a general conjecture what will happen for the infinite sum:

4*sum(evalf((-1)^k/(2*k+1)),k=0..infinity);

D) From the point of view of efficiency, the basic approach to computing approximations to pi from question C is pretty clearly bad because you need to take so many terms in the sum to get even two decimal places accuracy. Here is another approach. Instead of (1), we can use another equation for pi:

(3) pi = 4(arctan(1/2) + arctan(1/3))

and approximate the terms on the right by adding together some number of terms of the arctangent series with x = 1/2 then with x = 1/3. The sum you were evaluating in part C was the arctangent series with x = 1. What do you need to change in the Maple command to compute the sum for x = 1/2 or x = 1/3. Use this approach to compute an approximation to pi. How many decimal places are correct if you add starting from k = 0 and going to k = 10 here? (You can check against the correct value by entering evalf(Pi);.) Is this method better? Explain. bigskip item{E)} (Extra credit) Why is the equation (3) true? Hint:

tan(A + B) = (tan(A) + tan(B))/(1 - tan(A)tan(B)).

Assignment

Lab write-ups due Friday, October 17 (Friday of week after Columbus Day)