# Taylor polynomial of sin of given degree and error

Replace the following function by its taylor polynomial of the given grade, and approximate the error in the given interval:

$$f(x) = \sin(x) \textrm{ by } T_3(f,x,0) \textrm{ in } |x| \le\frac{1}{10}$$

My solution and thoughts

We only need the first three derivatives:

$$f'(x) = \cos(x) \\ f''(x) = -\sin(x) \\ f'''(x) = -\cos(x)$$

And by definition we know that

$$T_3(f,x,0) = \sum\limits_{k=0}^3 \frac{f^{(k)}(0)}{k!}x^k$$

we get

$$= 0 + \frac{1}{1!}(x-0)^1 + 0 - \frac{1}{3!}(x-0)^3$$

Is this right so far? It looks suspiciously simple, which merely confuses me.

$$= x - \frac{x^3}{6}$$

I am clueless when it comes to the error. In which points do I have to calculate $T_3(x)$ in order to get the error as

$$R_3(x) = sin(x) - T_3(x)$$

in the given interval $[-\frac{1}{10};\frac{1}{10}]$?

Update

Oh, I'm reading in a book about the Lagrange representation of the error. Can I use it? $f(x)$ looks endlessly differentiable in $0$.

-

Yes, you computed $T_3$ correctly.

Towards estimating the error, you may (might) use the fact that for $-1/10<x<1/10$, the error is given by $$\tag{1} R_3(x) ={f^{(iv)}(c)\over 4!}x^4,$$ for some $c$ between $0$ and $x$.

Note that $c$ depends on $x$. In general, the value of $c$ cannot be found easily (without knowing the exact value of $\sin x$). But that's ok; you were asked to estimate the error. And here it suffices to find an upper bound of the absolute value of $(1)$ that is valid over $(-1/10,1/10)$.

Thus, you need to find a number $M$ so that$$\Bigl|{f^{(iv)}(c)\over 4!}x^4\Bigr|\le M$$ for all $x\in(-1/10,1/10)$. Towards this end, it's useful to note that $|f^{(iv)}(x)|\le 1$ for all $x$.

Can you take it from here?

Once you've found $M$, this will be the desired estimate; you'll know that $|f(x)-P_3(x)|\le M$ for all $x\in(-1/10,1/10)$.

-
"Can you take it from here?" - Hm, but your relation $|R_3|\le M$ does look like the definition of $\lim$, so I just have to look for the $\lim R_3$ over c from 0 to 1/10. Did I misunderstand something (I certainly had)? –  Flavius Dec 6 '12 at 13:26
@Flavius No, it's not a limit. Just do an estimate: Since $|f^{(iv)}(x)|=|\sin(x)|\le1$, we have $$|R_3(x)|\le {1\over 4!}|x^4|;$$ and since $|x|\le 1/10$, we have $$|R_3(x)|\le {1\over 4!}\cdot {1\over 10^4}.$$ Note the first of these is the better estimate for a particular $x$, but the second is an estimate that is valid over the entire interval $(-1/10,1/10)$. –  David Mitra Dec 6 '12 at 13:31
So to wrap it up, if I would start to play with these relations in sagemath: 1. If I plot $T_3$, I get a function similar to sin, but with the given error $R_3$, and 2. if I would calculate $\sin(x) - T_3(x)$ I would get something close to $R_3$? Wow, this sounds really powerful - I've got to test it. Especially if I think about throwing those coefficients of $T_n$ into a matrix and do it like in linear algebra to calculate sin based on that. Now I also start to see where those matrices representing differentials in computer graphics were coming from. –  Flavius Dec 6 '12 at 13:42