# example of Taylor polynomials for $sinx$

In this entry we compute several Taylor polynomials^{} for the function $\mathrm{sin}x$ around $x=0$ and we produce graphs to compare the function with the corresponding Taylor polynomial. Recall that for a given function $y=f(x)$ (here we suppose $f$ is infinitely differentiable^{}) and a point $x=a$, the Taylor polynomial of degree $n$ ($n\ge 0$) is given by:

$${T}_{n}(x)=f(a)+{f}^{\prime}(a)(x-a)+\frac{{f}^{\prime \prime}(a)}{2!}{(x-a)}^{2}+\mathrm{\dots}+\frac{{f}^{(n)}(a)}{n!}{(x-a)}^{n}$$ |

where ${f}^{(n)}$ denotes the $n$th derivative^{} of $f(x)$.

From now on we assume $f(x)=\mathrm{sin}x$ and $a=0$. Notice that the derivatives of $\mathrm{sin}x$ are cyclic:

$${f}^{\prime}(x)=\mathrm{cos}x,{f}^{\prime \prime}(x)=-\mathrm{sin}x,{f}^{\prime \prime \prime}(x)=-\mathrm{cos}x,{f}^{(4)}(x)=\mathrm{sin}x=f(x).$$ |

Therefore, the Taylor polynomials are easy to compute. In fact:

$${f}^{(2n)}(0)=0,{f}^{(2n+1)}(0)={(-1)}^{n}$$ |

Thus, the first Taylor polynomial is given by:

$${T}_{1}(x)=0+1\cdot x=x$$ |

In the following graph one can compare the function ${T}_{1}(x)=x$ and $\mathrm{sin}x$.

The function $y=\mathrm{sin}x$ and the first Taylor polynomial.

Notice that ${T}_{2}(x)={T}_{1}(x)$. More generally, ${T}_{2n}(x)={T}_{2n-1}(x)$ so we will not compute any other even order Taylor polynomials. However, the third degree Taylor polynomial is given by the formula:

$${T}_{3}(x)=x-\frac{{x}^{3}}{3!}=x-\frac{{x}^{3}}{6}$$ |

The function $y=\mathrm{sin}x$ and the third Taylor polynomial.

The Taylor polynomial of degree $5$ is given by:

$${T}_{5}(x)=x-\frac{{x}^{3}}{3!}+\frac{{x}^{5}}{5!}$$ |

The function $y=\mathrm{sin}x$ and the fifth Taylor polynomial.

Next, we compute some Taylor polynomials of higher degree. In particular, the Taylor polynomial of degree $15$ has the form:

$${T}_{15}(x)=x-\frac{{x}^{3}}{6}+\frac{{x}^{5}}{120}-\frac{{x}^{7}}{5040}+\frac{{x}^{9}}{362880}-\frac{{x}^{11}}{39916800}+\frac{{x}^{13}}{6227020800}-\frac{{x}^{15}}{1307674368000}$$ |

The function $y=\mathrm{sin}x$ and the Taylor polynomial of degree $15$.

Finally, we produce a detailed view of the Taylor polynomial of degree $99$. In particular, notice that the graphs are very close until $x=34$ or so, but after that ${T}_{99}(x)$ behaves rather jittery and wildly.

A detail of the Taylor polynomial of degree $99$ (the interval $(34,39)$).

Title | example of Taylor polynomials for $sinx$ |
---|---|

Canonical name | ExampleOfTaylorPolynomialsForsinX |

Date of creation | 2013-03-22 15:03:43 |

Last modified on | 2013-03-22 15:03:43 |

Owner | alozano (2414) |

Last modified by | alozano (2414) |

Numerical id | 7 |

Author | alozano (2414) |

Entry type | Example |

Classification | msc 41A58 |

Related topic | ComplexSineAndCosine |

Related topic | HigherOrderDerivativesOfSineAndCosine |