# estimating the error of $\sin(x) = x$ with Taylor's Theorem

I want to calculate the numerical error in approximating $\sin(x)=x$ with Taylor's Theorem. Furthermore, what values of $x$ will this approximation be correct to within $7$ decimal places?

Here is what I have done:

$\sin(x) = \sum\limits_{k=0}^n (-1)^k\dfrac{x^{2k+1}}{(2k+1)!} + E_n(x)$

Where $E_n(x) =\dfrac{f^{(n+1)}(\xi)}{(n+1)!}x^{n+1}$, $x\in (-\infty, \infty)$ and $\xi$ is between $x$ and $0$. (This is just Taylor's Theorem with Lagrange remainder)

Let $\xi = 0$ (why not). I am unsure of how I made $E_n(x)$:

\begin{align} \left|\sin(x)-x\right| =& \sum\limits_{k=0}^n (-1)^k\dfrac{x^{2k+1}}{(2k+1)!} + (-1)^{2n+3}\dfrac{x^{2n+3}}{(2n+3)!} -x \\ \left|\sin(x)-x -\sum\limits_{k=0}^n (-1)^k\dfrac{x^{2k+1}}{(2k+1)!}\right| =& \left|(-1)^{2n+3}\dfrac{x^{2n+3}}{(2n+3)!} -x\right| \\ =&\left|\dfrac{x^{2n+3}}{(2n+3)!}-x\right| \end{align}

Continuing in this way find the values of $n$ and $x$ that solve: $$\left|\dfrac{x^{2n+3}}{(2n+3)!}-x\right| \leq 10^{-7}$$

Intuitively this seems off because $(2n+3)!$ grows faster than $x^{2n+3}$, and so taking the limit as $n\to\infty$ we get $\left|-x\right|=x$ and thus any value of $x \leq 10^{-7}$ would work. This just does not seem right.

All help is greatly appreciated!

• I cannot follow your logic since you pick $\xi = 0$... – Tunococ Jun 21 '13 at 2:28
• You can't pick the value of $\xi$, the generalization of the mean value theorem just tells you that there exists some $\xi$ on the closed interval that works there. – Ben Grossmann Jun 21 '13 at 2:33

We are using the Taylor polynomial $P_1(x)=x$ to approximate $\sin x$. We could therefore call the error term $E_1$. But in this case the second term in the Taylor expansion is $0$, so $P_1(x)=P_2(x)$, and therefore $E_1$ and $E_2$ are equal.
By the Lagrange form of the remainder, we have $$|E_2|=\left|\frac{-\cos \xi}{3!}x^3\right|\tag{1}$$ for some $\xi$ between $0$ and $x$. Since the absolute value of the cosine is $\le 1$, from (1) we obtain the estimate $$|E_2| \le \frac{|x|^3}{3!}.\tag{2}$$ It should now be straightforward to find the range of $x$ for which the right-hand side of (2) is $\lt 10^{-7}$.
• Why are you fixing $n$ With $P_1, P_2$ and $E_2$? Or is this just for example so that I may understand $E_n(x)$ and $\xi$? – CodeKingPlusPlus Jun 21 '13 at 2:51
• No, not pedagogy! I am fixing $n$ because the problem asks you to. It asks for an estimate of the error when we approximate $\sin x$ by $x$. If it asked you about the error when we approximate $\sin x$ by $x-\frac{x^3}{3!}$, I would have to choose $n=3$ or $4$. – André Nicolas Jun 21 '13 at 2:54
• I see now, the first term in the taylor polynomial for $\sin(x)$ is $x$... – CodeKingPlusPlus Jun 21 '13 at 2:57
• No I did not. I picked $n=2$ because the problem asks us to approximate $\sin x$ by $x$, not by a higher degree Taylor polynomial. – André Nicolas Jun 21 '13 at 2:58