Taylor Series

Taylor’s Theorem states that any function that is infinitely differentiable can be represented as a polynomial of the following form:

\[f(x) =\sum _{n=0 }^{\infty}{\frac {f^{n}(a)}{n!}}(x-a)^{n}\]

\[ = f(a) + f^{(1)}(a)(x-a) + \frac {f^{(2)}}{2!}(x - a) + ...\] where \(f^{(n)(a)}\) represents the nth derivative of \(f(x)\) evaluated at \(x = a\)


Problem 1: \(f(x) = \frac{1}{1-X}\)

Centered at \(x = 0\)

Calculate the derivatives of \(f(x) = \frac{1}{1-X}\):
\(f(x) = (1 - x)^{-1}\) ;      \(f(0) = 1\)
\(f^{(1)}(x) = 1(1 - x)^{-2}\) ;      \(f^{(1)}(0) = 1\)
\(f^{(2)}(x) = -2(1 - x)^{-3}\) ;      \(f^{(2)}(0) = 2\)
\(f^{(3)}(x) = (3 * 2)(1 - x)^{-4}\) ;      \(f^{(3)}(0) = (3 * 2)\)
\(f^{(4)}(x) = -(4 * 3 * 2)(1 - x)^{-5}\) ;      \(f^{(4)}(0) = (4 * 3 * 2)\)
\(f^{(5)}(x) = (5* 4 * 3 * 2)(1 - x)^{-6}\) ;      \(f^{(5)}(0) = (5* 4 * 3 * 2)\)

Plugging these into the Taylors’ theorem polynomial for a = 0:

\(f(a) = 1\)
\(f^{(1)}(a)(x-a) = 1x\)
\(\frac {f^{(2)}}{2!}(x - a) = \frac{2}{2!}x^2\)
\(\frac {f^{(3)}}{3!}(x - a) = \frac{3 * 2 * 1}{3!}x^3\)
\(\frac {f^{(4)}}{4!}(x - a) = \frac{4 * 3 * 2 * 1}{4!}x^4\)
\(\frac {f^{(5)}}{5!}(x - a) = \frac{5 * 4 * 3 * 2 * 1}{4!}x^5\)

Combining terms we get:

\[ 1 + 1x + \frac{2}{2!}x^2 + \frac{3 * 2 * 1}{3!}x^3 + \frac{4 * 3 * 2 * 1}{4!}x^4 + \frac{5 *4 * 3 * 2 * 1}{5!}x^5\]

which reduces to:

\[ 1 + x + x^2 + x^3 + x^4 + x^5\]

\[= \sum _{n=0 }^{\infty}x^n \]


Problem 2: \(f(x) = e^x\)

Centered at \(x = 0\)

Calculate the derivatives of \(f(x) = e^x\) which in this special case is always \(e^x\):

\(f(x) = e^x\) ;      \(f(0) = 1\)
\(f^{(1)}(x) = e^x\) ;      \(f^{(1)}(0) = 1\)
\(f^{(2)}(x) = e^x\) ;      \(f^{(2)}(0) = 1\)
\(f^{(3)}(x) = e^x\) ;      \(f^{(3)}(0) = 1\)
\(f^{(4)}(x) = e^x\) ;      \(f^{(4)}(0) = 1\)

Plugging these into the Taylors’ theorem polynomial for a = 0:

\(f(a) = 1\)
\(f^{(1)}(a)(x-a) = 1x\)
\(\frac {f^{(2)}}{2!}(x - a) = \frac{1}{2!}x^2\)
\(\frac {f^{(3)}}{3!}(x - a) = \frac{ 1}{3!}x^3\)
\(\frac {f^{(4)}}{4!}(x - a) = \frac{ 1}{4!}x^4\)
\(\frac {f^{(5)}}{4!}(x - a) = \frac{ 1}{5!}x^5\)

Combining terms we get:

\[ 1 + x + \frac{1}{2!}x^2 + \frac{1}{3!}x^3 + \frac{1}{4!}x^4 + \frac{1}{5!}x^5 = 1 + \frac{x^2}{2} + \frac{x^3}{3} + \frac{x^4}{4} + \frac{x^5}{5}\]

\[ = \sum _{n=0 }^{\infty}\frac{x^n}{n!} \]


Problem 3: \(f(x) = ln(1 + x)\)

Centered at \(x = 0\)

Calculate the derivatives of \(f(x) = ln(1 + x)\):

\(f(x) = ln(1 + x)\) ;        \(f(0) = 0\)
\(f^{(1)}(x) = (1 + x)^{-1}\) ;      \(f^{(1)}(0) = 1\)
\(f^{(2)}(x) = -1(1 + x)^{-2}\) ;      \(f^{(2)}(0) = -1\)
\(f^{(3)}(x) = 2(1 + x)^{-3}\) ;      \(f^{(3)}(0) = 2\)
\(f^{(4)}(x) = -(3 * 2)(1 + x)^{-4}\) ;      \(f^{(4)}(0) = -(3 * 2)\)
\(f^{(5)}(x) = (4* 3 * 2)(1 + x)^{-5}\) ;      \(f^{(5)}(0) = (4 * 3 * 2)\)

Plugging these into the Taylors’ theorem polynomial for a = 0:

\(f(a) = 0\)
\(f^{(1)}(a)(x-a) = 1x\)
\(\frac {f^{(2)}}{2!}(x - a) = \frac{-1}{2!}x^2 = \frac{-1}{ 2 * 1} x^2\)
\(\frac {f^{(3)}}{3!}(x - a) = \frac{2}{3!}x^3 = \frac{2*1}{3 * 2 * 1} x^3\)
\(\frac {f^{(4)}}{4!}(x - a) = \frac{-(3 * 2)}{4!}x^4 = \frac{-(3 * 2)}{4 * 3 * 2 * 1} x^4\)
\(\frac {f^{(5)}}{4!}(x - a) = \frac{(4 * 3 * 2)}{5!}x^5 = \frac{(4 * 3 * 2)}{5 * 4 * 3 * 2 * 1} x^5\)

Reducing and combining terms we get:

\[ 0 + x - \frac{1}{2}x^2 + \frac{1}{3}x^3 - \frac{1}{4}x^4 + \frac{1}{5}x^5 = x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \frac{x^5}{5} \]

\[ = \sum _{n=0 }^{\infty}(-1)^{n+1}\frac{x^n}{n!} \]