# 009C Sample Final 2, Problem 8

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

Foundations:
Taylor's Theorem
Let  $f$ be a function whose  $(n+1)^{\mathrm {th} }$ derivative exists on an interval  $I$ ,  and let  $c$ be in  $I.$ Then, for each  $x$ in  $I,$ there exists  $z_{x}$ between  $x$ and  $c$ such that
$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  $R_{n}(x)={\frac {f^{n+1}(z_{x})}{(n+1)!}}(x-c)^{n+1}.$ Also,  $|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  $\cos {\frac {\pi }{3}}$ with
the Maclaurin polynomial of degree  $n$ is  $R_{n}{\bigg (}{\frac {\pi }{3}}{\bigg )}$ where
${\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
$|f^{n+1}(z)|=|\cos(z)|\leq 1$ or  $|f^{n+1}(z)|=|\sin(z)|\leq 1.$ Therefore, we have
${\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.
 $n$ $\approx {\frac {1}{(n+1)!}}{\bigg (}{\frac {\pi }{3}}{\bigg )}^{n+1}$ $1$ $0.548311$ $2$ $0.191396$ $3$ $0.050107$ $4$ $0.01049$ $5$ $0.00183$ $6$ $0.000274$ $7$ $0.0000358$ So,  $n=7$ is the smallest value of  $n$ where the error is less than or equal to 0.0001.
Therefore, for  $n=7$ the Maclaurin polynomial approximates  $\cos {\frac {\pi }{3}}$ within 0.0001 of the actual value.

$n=7$ 