HW14 - Taylor Series

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 a R-Markdown document.

The Taylor series is defined as

\(\sum\limits_{n=0}^{\infty} \frac{f^{(n)}(a)}{n!}(x-a)^n = f(a) + \frac{f'(a)}{1!}(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \frac{f'''(a)}{3!}(x-a)^3 + \frac{f''''(a)}{4!}(x-a)^4 + ...\)

If we center the series at \(a=0\) then we obtain

\(\sum\limits_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!}(x)^n = f(0) + \frac{f'(0)}{1!}(x) + \frac{f''(0)}{2!}(x)^2 + \frac{f'''(0)}{3!}(x)^3 + \frac{f''''(0)}{4!}(x)^4 + ...\)

1. \(f(x) = \frac{1}{1-x}\)

This is \(f(x) = \frac{1}{(1-x)}=(1-x)^{-1}\) .

Taking derivatives, we obtain:

\(f'(x) = -(1-x)^{-2}\cdot(-1)=\frac{1}{(1-x)^2}\)

\(f''(x) = -2(1-x)^{-3}\cdot(-1)=\frac{2}{(1-x)^3}\)

\(f'''(x) = -3\cdot 2\cdot(1-x)^{-4}\cdot(-1)=\frac{6}{(1-x)^4}\)

\(f''''(x) = -4\cdot 6\cdot(1-x)^{-5}\cdot(-1)=\frac{24}{(1-x)^5}\)

Evaluating the above at x=0, we obtain:

\(f(0) = \frac{1}{(1-0)} = 1 = 0!\)
\(f'(0) = \frac{1}{(1-0)^2} = 1 = 1!\)
\(f''(0) = \frac{2}{(1-0)^3} = 2 = 2!\)
\(f'''(0) = \frac{6}{(1-0)^4} = 6 = 3!\)
\(f''''(0) = \frac{24}{(1-0)^5} = 24 = 4!\)

Thus, we obtain

\[\begin{aligned} \frac{1}{(1-x)} &= \sum\limits_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!}(x)^n \\ &= 1 + \frac{1}{1!}x + \frac{2}{2!}x^2 + \frac{6}{3!}x^3 + \frac{24}{4!}x^4 + ... \\ &= 1 + x + x^2 + x^3 + x^4 + ... \end{aligned}\]

This is the sum of a geometric series, which converges when \(|x|<1\) .

2. \(f(x) = e^x\)

\(f'(x) = e^x = f(x)\)
\(f''(x) = e^x = f(x)\)
\(f'''(x) = e^x = f(x)\)
\(f''''(x) = e^x = f(x)\)

Evaluating the above at x=0, we obtain:

\(f(0) = e^0 = 1\)
\(f'(0) = e^0 = 1\)
\(f''(0) = e^0 = 1\)
\(f'''(0) = e^0 = 1\)
\(f''''(0) = e^0 = 1\)

Thus, we obtain
\[\begin{aligned} e^{x} &= \sum\limits_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!}(x)^n \\ &= 1 + \frac{1}{1!}x + \frac{1}{2!}x^2 + \frac{1}{3!}x^3 + \frac{1}{4!}x^4 + ... \\ &= \sum\limits_{n=0}^{\infty} \frac{x^n}{n!} \end{aligned}\]

This sum converges \(\forall x \in R\) .

3. \(f(x) = ln(1 + x)\)

Taking derivatives, we obtain:

\(f'(x) = \frac{1}{1+x} = (1+x)^{-1}\) \(f''(x) = -1\cdot(1+x)^{-2}=\frac{-1}{(1+x)^2}\)
\(f'''(x) = 2\cdot(1+x)^{-3}=\frac{2}{(1+x)^3}\)
\(f''''(x) = -6\cdot(1+x)^{-4}=\frac{-6}{(1+x)^4}\)

Evaluating the above at x=0, we obtain:

\(f(0) = ln(1+0) = ln(1) = 0\)
\(f'(0) = (1+0)^{-1} = 1\)
\(f''(0) = -1\cdot(1+0)^{-2} = -1\)
\(f'''(0) = 2\cdot(1+0)^{-3} = 2\)
\(f''''(0) = -6\cdot(1+0)^{-4} = -6\)

and note that \(f^{(n)}(0)=(-1)^{(n+1)}(n-1)!\) for \(n \ge 1\) .

We obtain

\[\begin{aligned} ln(1+x) &= \sum\limits_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!}(x)^n \\ &= 0+ \sum\limits_{n=1}^{\infty} \frac{(-1)^{(n+1)}(n-1)!}{n!}x^n \\ &= \sum\limits_{n=1}^{\infty} \frac{(-1)^{(n+1)}x^n}{n} \end{aligned}\]

This series converges for \(-1 < x \le 1\) .
(However, as one approaches the endpoints of this range, the convergence becomes quite slow…)