Question
This week, we’ll work out some Taylor Series expansions of
popular functions. We’ll explore the following functions and compute
their Taylor Series expansions:
\(f(x) = 1/(1 - x)\)
\(f(x) = e^x\)
\(f(x) = \ln(1 + x)\)
\(f(x) = x^{1/2}\)
For each function, we will only consider its valid ranges as indicated in the notes when computing the Taylor Series expansion. Please submit your assignment as an R- Markdown document.
library(Ryacas0)
x <- Sym("x")
f1<- 1/(1 - x)
f2<- exp(x)
f3<- log(1 + x)
f4<- x^(1/2)
#x = 0 to the 4th
taylor_f1 <- Taylor(f1, x, 0, 4)
taylor_f2 <- Taylor(f2, x, 0, 4)
taylor_f3 <- Taylor(f3, x, 0, 4)
taylor_f4 <- Taylor(f4, x, 0, 4)
# answers
print(taylor_f1)
## yacas_expression(x + x^2 + x^3 + x^4 + 1)
print(taylor_f2)
## yacas_expression(x + x^2/2 + x^3/6 + x^4/24 + 1)
print(taylor_f3)
## yacas_expression(x - x^2/2 + x^3/3 - x^4/4)
print(taylor_f4)
## yacas_expression(Inf * x + Inf * x^2 + Inf * x^3 + Inf * x^4)