Find a formula for the \(n^{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.
\(f(x) = \frac{1}{x}\); \(c = 1\)
# Reference: https://www.math.ucla.edu/~anderson/rw1001/library/base/html/curve.html
fct_exp <- function(x){1/x}
curve(fct_exp, from = 0.01, to = 5, type = "l", col = "blue", ylab = "1/x")
Let’s find the first few coefficients.
Each \(\frac{f^{(n)}(c)}{n!}\) is the coefficient in front of each polynomial.
\(f(c) = \frac{1}{1} = 1\) 1st coefficient = 1
\(\frac{f^{(1)}(c)}{1!}(x-c)^1\)
find the first derivative
\(f'(x) = \frac{-1}{x^2}\) coefficient of first degree polynomial = \(\frac{-1/x^2}{1!} = -\frac{1}{x^2}\)
plug \(c = 1\); \(f'(1) = -\frac{1}{1!} = -1\)
\(\frac{f^2(c)}{2!}(x-c)^2\) find the second derivative
\(f''(x) = \frac{2}{x^3}\) coefficient of second degree polynomial = \(\frac{2/x^3}{2!} = \frac{1}{x^3}\)
plug \(c = 1\); \(f''(1) = \frac{1}{1^3} = 1\)
\(\frac{f^3(c)}{3!}(x-c)^3\)
find the third derivative
\(f'''(x) = \frac{-6}{x^4}\) coefficient of third degree polynomial = \(\frac{-6/x^4}{3!} =-\frac{1}{x^4}\)
plug \(c = 1\); \(f'''(1) = \frac{-1}{1^4} = -1\)
As it appears, the formula for the Taylor polynomial look like
\(P(x)=1−(x−c)+(x−c)^2−(x−c)^3+...\)
Formula after plugging c=1,
\(P(x)=1−(x−1)+(x−1)^2−(x−1)^3+...\)
Can be generalized for the \(n^{th}\) term as follows,
\(P^n(x) = \sum_{n=0}^{\infty}(-1)^n(x-1)^n\)