R Markdown

Taylor and Maclaurin Series Definition 8.8.1 Taylor and Maclaurin Series

let

\(f(x)\) have derivatives of all orders at \(x=c\). 1. The Taylor Series of

\(\mathrm{f}(\mathrm{x})\) centered at \(\mathrm{c}\) is: \(\sum_{n=0}^{\infty} \frac{f^{(n)}(c)}{n !}(x-n)^{n}\)

  1. The Maclaurin Series of

\(\mathrm{f}(\mathrm{x})\) where \(\mathrm{c}=0\) is: \(\sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n !}(x)^{n}\)

Exercise 4

Find the formula for the \(n^{\text {th }}\) term of the Taylor Series of \(f(x)\), centered at \(c\), by finding the coefficients of the first few powers of \(x\) and looking for a pattern.

\[\begin{aligned} &f(x)=\sin (x) \\ &f^{\prime}(x)=\cos (x) \\ &f^{\prime \prime}(x)=-\sin (x) \\ &f^{(3)}(x)=-\cos (x) \\ &f^{(4)}(x)=\sin (x) \\ &f^{(5)}(x)=\cos (x) \\ &f^{(6)}(x)=-\sin (x) \\ &f^{(7)}(x)=-\cos (x) \\ &\sin (0)=0 \\ &\cos (0)=1 \\ &-\sin (0)=0 \\ &-\cos (0)=-1 \\ &\sin (0)=0 \\ &\cos (0)=1 \\ &-\sin (0)=0 \\ &-\cos (0)=-1 \\ &\sin x=\frac{x}{1 !}-\frac{x^{3}}{3 !}+\frac{x^{5}}{5 !}-\frac{x^{7}}{7 !}+\frac{x^{9}}{9 !}-\ldots \end{aligned}\]

Using sigma notation, the series would be: \[ \sum_{n=0}^{\infty} \frac{(-1)^{n}}{(2 n+1) !} x^{(2 n+1)} \]

library(pracma)
f <- function(x) sin(x)
m <- taylor(f,0,7)
m
## [1] -0.0001983869  0.0000000000  0.0083332754  0.0000000000 -0.1666666439
## [6]  0.0000000000  1.0000000000  0.0000000000