MAPLE output for calculating Pi using the Power Series for 4*arctan(x) at x=1.

We know that the arctan(1) = Pi/4.

> 4*arctan(1); evalf(%);

Pi

3.141592654

So, we can get Pi by finding 4 times the Power Series for arctan(x), evaluating the series at x=1.

How can we find the Power Series for arctan(x)?

> sum(x^n, n=0..infinity);

-1/(x-1)

So, 1/(1-x) = 1 + x + x^2 + x^3 + ... for |x|<1.

Substituting -x^2 for x, we find that:

1/(1+x^2) = 1 - x^2 + x^4 -x^6+... for |x|<1.

Now, 1/(1+x^2) is the derivative of arctan(x), so we can integrate to get:

> taylor(arctan(x), x=0, 8);

series(1*x-1/3*x^3+1/5*x^5-1/7*x^7+O(x^8),x,8)

Now that we have the Power Series for the arctan(x), we can find 4 times it, and evaluate it at x=1 in order to get Pi (note: after integration, the series converges for |x| < = 1).

The 3rd order Power Series for 4*arctan(x), and its value at x=1 are:

> mtaylor(4*arctan(x), x=0, 5); evalf(subs(x=1, mtaylor(4*arctan(x), x=0, 5)));

4*x-4/3*x^3

2.666666667

The 9th order Power Series for 4*arctan(x), and its value at x=1 are:

> mtaylor(4*arctan(x), x=0, 10); evalf(subs(x=1, mtaylor(4*arctan(x), x=0, 10)));

4*x-4/3*x^3+4/5*x^5-4/7*x^7+4/9*x^9

3.339682540

The 19th order Power Series for 4*arctan(x), and its value at x=1 are:

> mtaylor(4*arctan(x), x=0, 20); evalf(subs(x=1, mtaylor(4*arctan(x), x=0, 20)));

4*x-4/3*x^3+4/5*x^5-4/7*x^7+4/9*x^9-4/11*x^11+4/13*...

3.041839619

Here are some higher order evaluations:

> evalf(subs(x=1, mtaylor(4*arctan(x), x=0, 50)));

3.181576685

> evalf(subs(x=1, mtaylor(4*arctan(x), x=0, 100)));

3.121594653

> evalf(subs(x=1, mtaylor(4*arctan(x), x=0, 1000)));

3.139592656

Finally, using the 9999th order Power Series, we get Pi correct to 3 places (note: this method causes a systematic error).

> evalf(subs(x=1, mtaylor(4*arctan(x), x=0, 10000))); evalf(Pi-%);

3.141392654

.200000e-3