where the following represents the nth derivative of the function with respect to x, evaluated at 0 \[f^n(0)\] Evaluating the first few derivatives below:
\[f^0(x) = (1-x)^{-1}\\ f^1(x) = (-1)(1-x)^{-2}(-1) = (1-x)^{-2}\\ f^2(x) = (-2)(1-x)^{-3}(-1) = 2(1-x)^{-3}\\ f^3(x) = (-3)2(1-x)^{-4}(-1) = 6(1-x)^{-4}\\ In\, general\,the\,pattern\,is:\\ f^n(x) = n!(1-x)^{-(n+1)}\\ \] Using the Taylor formula for calculating the co-efficient of the nth term gives:
\[ a_{n} = f^n(0)/n! = (n!(1-0)^{-(n+1)})/n! = 1\\\] This series is bounded by |-1,1| because the radius of convergence is 1.
The derivative term for the first 5 terms is calculated below:
x=0
for(n in 0:4){
a=factorial(n)/(1-x)^(n+1)
print(a)
}
## [1] 1
## [1] 1
## [1] 2
## [1] 6
## [1] 24
The derivative term cancels out with the factorial in the denominator. We test the sum of the series upto a given number of terms below, using a R library:
library(pracma)
f<-function(x) {1/(1-x)}
s<-taylor(f,x0=0,n=4)
s
## [1] 1.000029 1.000003 1.000000 1.000000 1.000000
The sum converges to exactly 1 very quickly.
\[f^0(x) = e^{x}\,,\, f^0(0) = e^{0} = 1 \\ f^1(x) = e^{x}\,,\, f^1(0) = e^{0} = 1\\ f^2(x) = e^{x}\,,\, f^2(0) = e^{0} = 1\\ f^3(x) = e^{x}\,,\, f^3(0) = e^{0} = 1\\ In\, general\,the\,pattern\,is:\\ f^n(x) = e^{x}\,,\, f^n(0) = e^{0} = 1\\ \] The radius of convergence is in this case is: \[|+\infty,-\infty|\]
Using Taylor’s formula: \[f(x) = \sum_{n=0}^{\infty} f^n(a)(x-a)^n/n!\] Since all the derivatives are = 1, we get: \[f(0) = \sum_{n=0}^{\infty}(x)^n/n!\] Using R to confirm:
f<-function(x) {exp(x)}
s<-taylor(f,x0=0, n=4)
s
## [1] 0.04166657 0.16666673 0.50000000 1.00000000 1.00000000
###3) f(x) = ln(1 + x)
\[f^0(x) = ln(1+x)\,,\, f^0(0) = 1/(1+0)= 0 \\ f^1(x) = (1+x)^{-1}\,,\, f^1(0) = 1/(1+0)^{1} = 1\\ f^2(x) = -1(1+x)^{-2}\,,\, f^2(0) = -1/(1+0)^{2} = -1\\ f^3(x) = (-1)(-2)(1+x)^{-3}\,,\, f^3(0) = 2/(1+0)^{3} = 2\\ f^4(x) = (2)(-3)(1+x)^{-4}\,,\, f^3(0) = -6/(1+0)^{4} = -6\\ In\, general\,the\,pattern\,is:\\ f^n(x) = (-1)^{n-1}(n-1)!/(1+x)^n\,,\, f^n(0) = (-1)^{n-1}(n-1)!\\ \] The radius of convergence is |-1,1|
Using Taylor’s formula: \[f(x) = \sum_{n=0}^{\infty} f^n(a)(x-a)^n/n!\] We get: \[f(x) = 0+x-x^2/2!+2x^3/3!-6x^4/4!+....\\ f(x) = x-x^2/2+x^3/3-x^4/4+....\\ \] Using R to confirm:
f<-function(x) {log(1+x)}
s<-taylor(f,x0=0,n=4)
s
## [1] -0.2500044 0.3333339 -0.5000000 1.0000000 0.0000000