# 009C Sample Final 2, Problem 8

Find  ${\displaystyle n}$  such that the Maclaurin polynomial of degree  ${\displaystyle n}$  of  ${\displaystyle f(x)=\cos(x)}$  approximates  ${\displaystyle \cos {\frac {\pi }{3}}}$  within 0.0001 of the actual value.

Foundations:
Taylor's Theorem
Let  ${\displaystyle f}$  be a function whose  ${\displaystyle (n+1)^{\mathrm {th} }}$ derivative exists on an interval  ${\displaystyle I}$,  and let  ${\displaystyle c}$  be in  ${\displaystyle I.}$
Then, for each  ${\displaystyle x}$  in  ${\displaystyle I,}$  there exists  ${\displaystyle z_{x}}$  between  ${\displaystyle x}$  and  ${\displaystyle c}$  such that
${\displaystyle f(x)=f(c)+f'(c)(x-c)+{\frac {f''(c)}{2!}}(x-c)^{2}+\cdots +{\frac {f^{(n)}(c)}{n!}}(x-c)^{n}+R_{n}(x),}$
where  ${\displaystyle R_{n}(x)={\frac {f^{n+1}(z_{x})}{(n+1)!}}(x-c)^{n+1}.}$
Also,  ${\displaystyle |R_{n}(x)|\leq {\frac {\max |f^{n+1}(z)|}{(n+1)!}}|(x-c)^{n+1}|.}$

Solution:

Step 1:
Using Taylor's Theorem, we have that the error in approximating  ${\displaystyle \cos {\frac {\pi }{3}}}$  with
the Maclaurin polynomial of degree  ${\displaystyle n}$  is  ${\displaystyle R_{n}{\bigg (}{\frac {\pi }{3}}{\bigg )}}$  where
${\displaystyle {\bigg |}R_{n}{\bigg (}{\frac {\pi }{3}}{\bigg )}{\bigg |}\leq {\frac {\max |f^{n+1}(z)|}{(n+1)!}}{\bigg |}{\bigg (}{\frac {\pi }{3}}-0{\bigg )}^{n+1}{\bigg |}.}$
Step 2:
We note that
${\displaystyle |f^{n+1}(z)|=|\cos(z)|\leq 1}$  or  ${\displaystyle |f^{n+1}(z)|=|\sin(z)|\leq 1.}$
Therefore, we have
${\displaystyle {\bigg |}R_{n}{\bigg (}{\frac {\pi }{3}}{\bigg )}{\bigg |}\leq {\frac {1}{(n+1)!}}{\bigg (}{\frac {\pi }{3}}{\bigg )}^{n+1}.}$
Now, we have the following table.
 ${\displaystyle n}$ ${\displaystyle \approx {\frac {1}{(n+1)!}}{\bigg (}{\frac {\pi }{3}}{\bigg )}^{n+1}}$ ${\displaystyle 1}$ ${\displaystyle 0.548311}$ ${\displaystyle 2}$ ${\displaystyle 0.191396}$ ${\displaystyle 3}$ ${\displaystyle 0.050107}$ ${\displaystyle 4}$ ${\displaystyle 0.01049}$ ${\displaystyle 5}$ ${\displaystyle 0.00183}$ ${\displaystyle 6}$ ${\displaystyle 0.000274}$ ${\displaystyle 7}$ ${\displaystyle 0.0000358}$
So,  ${\displaystyle n=7}$  is the smallest value of  ${\displaystyle n}$  where the error is less than or equal to 0.0001.
Therefore, for  ${\displaystyle n=7}$  the Maclaurin polynomial approximates  ${\displaystyle \cos {\frac {\pi }{3}}}$  within 0.0001 of the actual value.

${\displaystyle n=7}$