Math 166
 A Little Help on Computer Lab # 9
 Taylor Series

4.  In the previous lab we investigated some formulas which gave approximations to º. Here we look at a Taylor series expansion  which leads to much more efficient computations of º than the previous ones we considered.

c.  In our approximation in (b) we used the same degree Taylor polynomial to approximate arctan(1/5) and arctan(1/239). 

However, from our series expansion we see that if we use a polynomial of degree (k-1) then the next term (which is a rough measure of the error) is of the order x^k.  

Clearly, for any integer k that we pick, the rough error estimate (1/239)^k is much smaller than (1/5)^k.  

Therefore, if we use one Taylor polynomial to approximate arctan at both x=1/239 and at x=1/5, the error will probably be much larger at x=1/5.

So our value at 1/239 will always be much more accurate than our
value at 1/5.

Instead, we can use a low order Taylor polynomial for our approximations at x=1/239, and a higher order polynomial at x=1/5.  

Suppose we use a first degree Taylor polynomial to approximate arctan(1/239).

Then what degree Taylor polynomial should we use to approximate arctan(1/5)?  

To decide this we will try to make the errors in the computation of the two arctangents about the same. 

  Step 1: Figure out the first degree Taylor polynomial approximation to arctan(x), evaluate it at x=1/239, and then compute the error between your estimate, and the exact value arctan(1/239).
  
  Step 2: Figure out the first ten or so Taylor polynomial approximations to arctan(x), evaluate each at x=1.5, and compute the error between your estimate and the exact value of arctan(1/5).
  
  Step 3: From the results of Step 2, pick a value of k which makes the error in approximating arctan(1/5) about the same as the error in approximating arctan(1/239) in Step 1.
  
  Step 4: Make your approximation to Pi, using the approximate value of arctan(1/239) from Step 1, and the approximate value of arctan(1/5) that you chose in Step 3.