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(%);
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);
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);
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)));
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)));
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)));
Here are some higher order evaluations:
> evalf(subs(x=1, mtaylor(4*arctan(x), x=0, 50)));
> evalf(subs(x=1, mtaylor(4*arctan(x), x=0, 100)));
> evalf(subs(x=1, mtaylor(4*arctan(x), x=0, 1000)));
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-%);