Key Idea 8.8.1 gives the nth term of the Taylor series of common functions. In Exercises 3 - 6, verify the formula given in the Key Idea by finding the first few terms of the Taylor series of the given function and identifying

6. \(f(x) = tan^{-1}x\) ; c = 0

Answer:

We can use the R derive function (‘D’) to help with the derivations since after n > 3, the functions become unweildy:

f=expression( atan(x) )
f
## expression(atan(x))
f_1 <- D(f,'x')   # 1st derivative
f_1 
## 1/(1 + x^2)
f_2 <- D(f_1,'x') # 2nd derivative
f_2
## -(2 * x/(1 + x^2)^2)
f_3 <- D(f_2,'x') # 3rd derivative
f_3
## -(2/(1 + x^2)^2 - 2 * x * (2 * (2 * x * (1 + x^2)))/((1 + x^2)^2)^2)
f_4 <- D(f_3,'x') # 4th derivative
f_4
## 2 * (2 * (2 * x * (1 + x^2)))/((1 + x^2)^2)^2 + ((2 * (2 * (2 * 
##     x * (1 + x^2))) + 2 * x * (2 * (2 * (1 + x^2) + 2 * x * (2 * 
##     x))))/((1 + x^2)^2)^2 - 2 * x * (2 * (2 * x * (1 + x^2))) * 
##     (2 * (2 * (2 * x * (1 + x^2)) * ((1 + x^2)^2)))/(((1 + x^2)^2)^2)^2)
f_5 <- D(f_4,'x') # 5th derivative
f_5
## 2 * (2 * (2 * (1 + x^2) + 2 * x * (2 * x)))/((1 + x^2)^2)^2 - 
##     2 * (2 * (2 * x * (1 + x^2))) * (2 * (2 * (2 * x * (1 + x^2)) * 
##         ((1 + x^2)^2)))/(((1 + x^2)^2)^2)^2 + ((2 * (2 * (2 * 
##     (1 + x^2) + 2 * x * (2 * x))) + (2 * (2 * (2 * (1 + x^2) + 
##     2 * x * (2 * x))) + 2 * x * (2 * (2 * (2 * x) + (2 * (2 * 
##     x) + 2 * x * 2)))))/((1 + x^2)^2)^2 - (2 * (2 * (2 * x * 
##     (1 + x^2))) + 2 * x * (2 * (2 * (1 + x^2) + 2 * x * (2 * 
##     x)))) * (2 * (2 * (2 * x * (1 + x^2)) * ((1 + x^2)^2)))/(((1 + 
##     x^2)^2)^2)^2 - (((2 * (2 * (2 * x * (1 + x^2))) + 2 * x * 
##     (2 * (2 * (1 + x^2) + 2 * x * (2 * x)))) * (2 * (2 * (2 * 
##     x * (1 + x^2)) * ((1 + x^2)^2))) + 2 * x * (2 * (2 * x * 
##     (1 + x^2))) * (2 * (2 * (2 * (1 + x^2) + 2 * x * (2 * x)) * 
##     ((1 + x^2)^2) + 2 * (2 * x * (1 + x^2)) * (2 * (2 * x * (1 + 
##     x^2))))))/(((1 + x^2)^2)^2)^2 - 2 * x * (2 * (2 * x * (1 + 
##     x^2))) * (2 * (2 * (2 * x * (1 + x^2)) * ((1 + x^2)^2))) * 
##     (2 * (2 * (2 * (2 * x * (1 + x^2)) * ((1 + x^2)^2)) * (((1 + 
##         x^2)^2)^2)))/((((1 + x^2)^2)^2)^2)^2))
# center at x = 0
x <- 0   

# Because x = 0, we're dealing with a Maclaurin series and we get the coefficients
# for the series of f^n(0)/n!
eval(f)/factorial(0)
## [1] 0
eval(f_1)/factorial(1)
## [1] 1
eval(f_2)/factorial(2)
## [1] 0
eval(f_3)/factorial(3)
## [1] -0.3333333
eval(f_4)/factorial(4)
## [1] 0
eval(f_5)/factorial(5)
## [1] 0.2

So referring to the Maclaurin series and the coefficients above we get:

\(\sum_{n=0}^{\inf} \frac{f^n(0)}{n!}x^n\)
\(0 + x^1 + 0 - \frac{1}{3}x^3 + 0 + \frac{1}{5}x^5+...\)

Which matches Key idea 8.8.1 for \(tan^{-1}x\):
\(x - \frac{x^3}{3} + \frac{x^5}{5}+...\)