Compute cos(5°) to 5 decimal places with Maclaurin's Series I'm working on a problem:
Compute cos(5°) to 5 decimal places with Maclaurin's Series
I know that that function cos(x) has a Mclaurin representation of:
$ \sum_{n=0}^\infty \frac{(-1)^n (x)^{2n}}{(2n)!} $
The only part I am unsure of is how to find out many terms n to choose.
I'm not sure if I am supposed to use the alternating series estimation or taylor series estimation or what.
 A: As you've stated
$$
\cos(x) = \sum_{n=0}^\infty \frac{(-1)^n (x)^{2n}}{(2n)!}
$$
If you want to express this as an order $N$ polynomial plus a remainder, you split the summation as follows:
$$
\cos(x) = \sum_{n=0}^N \frac{(-1)^n (x)^{2n}}{(2n)!} + \sum_{n=N+1}^\infty \frac{(-1)^n (x)^{2n}}{(2n)!}
$$
$$
 = \sum_{n=0}^N \frac{(-1)^n (x)^{2n}}{(2n)!} + R_N(x)
$$
If the remainder is convergent, then it is bounded by it's first term because it is an alternating series. For an alternating series to be convergent, it is sufficient for the magnitude of the sequence of terms to approach zero, which our remainder clearly does for any finite value of $x$ (the factorial grows like $n^n$, which is faster than any exponential growth $x^n$ for a fixed $x$). So the alternating series bound applies:
$$
|R_N(x)|\leq \frac{x^{2(N+1)}}{(2(N+1))!}
$$
So for your $x=5^\circ$ (make sure you convert to radians before you use it) and precision of five decimal places (say you want $|R_N|\leq10^{-6}$), you can solve for $N$ that gives you that.  That's how you pick how many terms to keep.
Edit
In general it is hard to "invert" a factorial, so perhaps I was a bit misleading about "solving" that equation for $N$.  You can however guess and check values until you get to the threshold you picked.
A: Use the alternating series estimate. When it is available it is often (i) a lot easier to use and (ii) sharper than the estimate based on the Lagrange form of the remainder. 
When you use the alternating series estimate, you will find that the $\frac{x^4}{4!}$ term is very very small. Cutting off after the $\frac{x^2}{2!}$ term gets you much more accuracy than you need. 
A: You can simply choose enough terms until the 5th decimal place does not change anymore.  Since the terms of this sum get smaller in magnitude as n approaches infinity, once the absolute value of the nth term is less than $10^{-5}$, the fifth decimal place should not change in the subsequent terms. 
