Calculus II Project Report, compiled from two groups of 2009. Estimating π Introduction There are many ways to approximate the number π. One of which is to use infinite series as did by James Gregory in the 1600’s. His series is given by the following: π 1 1 1 =1− + − +β― 4 3 5 7 In this project, an infinite series method will be developed and then compared against Gregory’s formula. The motivation goal is to improve the approximation accuracy and computation efficiency as compared to Gregory’s scheme. Analysis In fact, Gregory’s series is closely related to arctangent function, tan−1 π₯, because of this identity: π = tan−1 1 4 and the fact that the function has a power series presentation in the interval [−1,1] as follows ∞ tan −1 π₯ = ∑(−1)π−1 π=1 π₯ 2π−1 2π − 1 Gregory’s formula is simply the consequence of the continuity of the arctangent function everywhere and its power series’ convergence in the said closed interval including its right end point, that is, = 4 ∑∞π=1(−1)π−1 1 2π−1 . We begin our analysis by presenting a slightly different approach, namely the Taylor polynomial approximation of functions. We use the Taylor polynomial of order 2, π2 (π₯), as a specific example. By definition and Taylor’s Remainder Theorem, we find π2 (π₯) = π₯ with remainder π 2 (π₯) = π(3) (π) (π+1)! π₯ π+1 , for tan−1 π₯ = π2 (π₯) + π 2 (π₯), where π is a number between 0 and π₯. Thus, at π₯ = 1 we can approximate π by 4π2 (1) = 4 with an error of πΈ2 = |π − 4π2 (1)| ≤ |4π 2 (1)| = 4 |π(3) (π)| 3! . Because π (3) (π ) = 6π 2 −2 (1+π 2 )3 is bounded by its maximum |π (3) (0)| = 2 by the method of finding extremes of onevariable function from Calculus I (see also Fig.1), the error is bounded by πΈ2 ≤ 4/3. This is the same estimate as obtained by applying the converging rate of alternating series to 1 1 3 5 1 Gregory’s series since π = 4 (1 − + − + 7 1 1 1 4 3 5 7 3 β― ) and|π − 4| = 4 ( − + − β― ) ≤ . In other words, using Taylor polynomial estimate does not offer a more accurate estimate than Gregory’s formula nor simplify the error estimate with a more complicated remainder term π π (π₯). Fig.1: The graph of |π (π) (π±)| In general, by the alternating series’ error estimate for Gregory’s series, the error by the πth partial sum is πΈπ = |π − 1 4 ∑ππ=1(−1)π−1 need to have |≤ 2π−1 4 2π+1 ≤ 10 4 2π+1 −π−2 . Thus, to get an accuracy of π many decimal places, we , or π ≥ 2(10π+2 ). In other words, each decimal place improvement in accuracy requires 10 times more terms. For example, to have an accuracy of 100 digits after the decimal we need 2(10102 ) many terms, a number greater than the total number of all atoms in the universe. We now introduce the alternative method of this project. The idea is based on the observation that if we can find two positive numbers π₯, π¦ so that π 4 = tan−1 π₯ + tan−1 π¦ (1) then we know they must be in the interval (0,1) since π 4 = tan−1 1, and by the convergence of the arctangent’s power series we have: π = 4 (∑∞π=1 (−1)π−1 π₯ 2π−1 2π−1 + ∑∞π=1 (−1)π−1 π¦ 2π−1 2π−1 ) = 4 ∑∞π=1(−1)π−1 π₯ 2π−1 +π¦ 2π−1 2π−1 . (2) By the alternating series’ error estimate again, we have instead πΈπ = |π − 4 ∑ππ=1(−1)π−1 π₯ 2π−1 +π¦ 2π−1 2π−1 |≤ 4(π₯ 2π+1 +π¦ 2π+1 ) 2π+1 ≤ 8 2π+1 π 2π+1 , a geometrically converging rate, where π = max{π₯, π¦} < 1. Thus, for an accuracy to the πth decimal place, we only need to have πΈπ ≤ 1 π+2 2 1 πππ π 3 or π ≥ ( 8 2π+1 π 2π+1 ≤ π 2π+1 ≤ 10−π−2 for π ≥ 3 1 π+2 7 2 πππ − 1). For example, if π = , then π = π + 2 ≥ ( 1 π − 1). That is, we need about the same number of terms to approximate π to the same number of decimal places, an astronomical improvement in both accuracy and efficiency over Gregory’s scheme. We now demonstrate below this is indeed the case. The Eq. (1) for π₯, π¦ can be translated into 1= π₯+π¦ 1−π₯π¦ , (3) using this trigonometric identity tan(π + π) = tan π+ tan π 1−tan π tan π . The graph of the equation is shown in Fig.2. To find the smallest possible π₯, π¦, we consider the distance squared of points from the curve to the origin, π· 2 = π₯ 2 + π¦ 2 , and minimize it. We can express the squared distance as a function of π₯ upon substituting π¦ = 1−π₯ 1+π₯ Fig.2: The graph of π = π+π π−ππ which is solved from Eq.(3) as a constraint for the point (π₯, π¦), and minimize the resulting one variable function π· 2 = π₯ 2 + ( 1−π₯ 2 1+π₯ ) = π (π₯ ) . Denoting the solution as π₯Μ . Similarly, we can express π· 2 = π(π¦) as a function of π¦ and minimize it to get π¦Μ . Because of the symmetry of Eq.(1) in both variables, both onevariable functions must have exactly the same form π(π₯) = π (π₯), and as a result the minima in the both variables must be the same, π₯Μ = π¦Μ . Hence, the minimizer can be solved from the pair of equations: π₯ = π¦, 1 = π₯+π¦ 1−π₯π¦ , and they are π₯Μ = π¦Μ = √2 − 1 = 2 .41421356 … . As an approximation to the irrational solution, we can use π₯ = = .4~π₯Μ 5 and solve from Eq.(3) the exact corresponding π¦ value as π¦ = 3/7=.425… ~π¦Μ . That is, the analysis of the previous paragraph indeed holds. Conclusion To give a perspective as to how much improvement our method is over Gregory’s scheme, we assume hypothetically that there is a program that takes 1 microsecond to compute a term and add it to the previous one. To find π accurate to the 100th decimal place using Gregory’s series, the program would have to run for roughly 10102 microseconds which is about to 1086 years, 1072 times longer than the age of the universe. It is a practical impossibility. However, using our new series it would only take the program 10−4 seconds. Similarly, to approximate it to the 10,000th decimal place, our method would take about 10−2 seconds, or less than one tenth of a second. Clearly, our method is much more efficient beyond comparison.