IS 605 FUNDAMENTALS OF COMPUTATIONAL MATHEMATICS - 2021 This week, we’ll work out some Taylor Series expansions of popular functions.
For each function, only consider its valid ranges as indicated in the notes when you are computing the Taylor Series expansion. Please submit your assignment as an R- Markdown document.
f(x)=∑_n=0^∞ (f^(n)(a))/n! (x−a)^n
f(a)+f(1)(a)(x−a)+(f(2))/2!(a)(x−a)+…
f(x)=1/(1−x)
library(pracma)
equation = function(x) {1/(1-x)}
p = taylor(equation, x0 = 0, n = 4)
p
## [1] 1.000029 1.000003 1.000000 1.000000 1.000000
f’(a)=e^a;f’(0)=1
f’‘(a)=e^a;f’’(0)=1
f’’‘(a)=e^a;f’’’(0)=1
(f(4))(a)=ea;(f^(4))(0)=1
equation = function(x) {exp(x)}
p = taylor(equation, x0 = 0, n = 4)
p
## [1] 0.04166657 0.16666673 0.50000000 1.00000000 1.00000000
f(a)=ln(1+a);=f(0)=0
f’(a)=1/(1+a);=f’(0)=1
f’‘(a)=-1/(1+a)^2;=f’’(0)=−1
f’’‘(a))=2/(1+a)^3;=f’’’(0)=2
f(4)(a)=−6/(1+a)4;=(f(4))(0)=−6
equation = function(x) {log(1+x)}
p = taylor(equation, x0 = 0, n = 4)
p
## [1] -0.2500044 0.3333339 -0.5000000 1.0000000 0.0000000
f(x)=x^(1/2) f(0)=0
f′(x)=x^(1/2)/2 f′(0)=Undefined
The Taylor series expansion for x1/2 is not possible as the first derivative of the function is undefined at f(0).