If we use a sixth degree Taylor polynomial to approximate the value of cos 1, how accurate is our answer?

1.9k Views Asked by At

I am well and truly stuck in my approach. Do we use a known cosine value close to $1$ like, $\pi/4$ with the Taylor Series, and then substitute $1$ back in at the end? I feel super confused about the approach, because I tried the Taylor expansion to 6 degrees centered at $1$, but then it all cancels out, leaving me with $\cos1$.

Then I tried the series centered at zero: $1-(x^2/2!)+(x^4/4!)-(x^6/6!)$ So, $T_6(x)$ is approx $0.540278$. So then I tried the error term: $R_6(x)= \sin(c)x^7/7!$ $c$ exists from $]0,x[$ (side question: Why are the endpoints not included on the interval?) I let $x=1$ and since $\sin c$ is less than or equal to $1$, $<1/7!$ $<0.00019841$. So, does that mean we are accurate to $3$ decimal places?? I am so lost!

4

There are 4 best solutions below

1
On

You are properly using the Taylor series centered at $0$. You can get a better error estimate by using the alternating series theorem instead of the normal Taylor series error term. The alternating series theorem says that if you have a convergent series with alternating terms that are monotonically decreasing to zero, the error is smaller than the first neglected term and of opposite sign. This would say the error is less than $\frac 1{8!}$ and negative.

You can do much better if you center the Taylor series at $\frac \pi 4$. Your series is then $$\cos 1 \approx \frac {\sqrt 2}2-(1-\frac \pi 4)\frac {\sqrt 2}2-\frac 1{2!}(1-\frac \pi 4)^2\frac {\sqrt 2}2+\frac 1{3!}(1-\frac \pi 4)^3\frac {\sqrt 2}2+\frac 1{4!}(1-\frac \pi 4)^4\frac {\sqrt 2}2-\frac 1{5!}(1-\frac \pi 4)^5\frac {\sqrt 2}2-\frac 1{6!}(1-\frac \pi 4)^6\frac {\sqrt 2}2$$

The powers of $1-\frac {\sqrt 2}2$ help a lot. That is the advantage of centering nearby.

0
On

Note that when expanding at $x=0$ the sixth Taylor polynomial of $\cos$ is also the seventh, as $cos^{(7)}(0)=0$. From $$\cos x=j^7_0\cos(x)+R_7(x)$$ with $$R_7(x)={x^8\over 8!}\cos^{(8)}(\xi)$$ for some $\xi\in[0,x]$ we therefore obtain that the sixth Taylor polynomial of $\cos$ at $0$, i.e., $$\cos1\approx 1-{1\over2}+{1\over24}-{1\over720}\ ,$$ gives $\cos1$ with an error $<{1\over 8!}$.

1
On

In the same spirit as Ross Millikan's answer, use the fact that $1$ is just a bit smaller than $\frac \pi 3$ and use, around $\epsilon=0$

$$\cos\left(\frac{\pi }{3}-\epsilon\right)=\frac{1}{2}\cos(\epsilon)+\frac{\sqrt 3}2 \sin(\epsilon)$$ Now, using the usual Taylor expansions of the sine and cosine around $\epsilon=0$, you should get $$\cos\left(\frac{\pi }{3}-\epsilon\right)=\frac{1}{2}+\frac{\sqrt{3} }{2} \epsilon-\frac{1}{4}\epsilon ^2-\frac{1}{4 \sqrt{3}}\epsilon ^3+\frac{1}{48}\epsilon ^4+\frac{1}{80 \sqrt{3}}\epsilon ^5+O\left(\epsilon ^6\right)$$ where $\epsilon=\frac \pi 3-1\approx 0.0471976$.

So, if you call $a_n$ the value obtained using the expansion up to $O\left(\epsilon^n\right)$, you would get $$\left( \begin{array}{cc} n & a_n \\ 1 & 0.5408742783 \\ 2 & 0.5403173761 \\ 3 & 0.5403022008 \\ 4 & 0.5403023042 \\ 5 & 0.5403023059 \end{array} \right)$$

1
On

Obviously, the other answers ignore your question about accuracy with respect to a given number of decimal places. So, I add this here.

First a short remark on the error estimate:

You have $\cos{1} = \sum_{n=0}^{\infty}(-1)^n\frac{1}{(2n)!}$. This is obviously an alternating series for the decreasing sequence $a_n = \frac{1}{(2n)!}$. So, you get: $$|\cos{1} - \sum_{n=0}^{3}(-1)^n\frac{1}{(2n)!}| \leq a_4 = \frac{1}{8!}<2.5 \cdot 10^{-5}$$

We say, that an approximation $A$ for a number $x$ is accurate to $k$ decimal places, if $x$ lies in the interval $A - 0.5 \cdot 10^{-k} < x < A + 0.5 \cdot 10^{-k}$, which means

$$|x - A|< 0.5\cdot 10^{-k}= 5 \cdot 10^{-(k+1)}$$. In your case: $$|\cos{1} - \sum_{n=0}^{3}(-1)^n\frac{1}{(2n)!}|<2.5 \cdot 10^{-5} < 5 \cdot 10^{-5} \rightarrow \mbox{ accurate to (at least) } 4 \mbox{ decimal places}$$