This week, we’ll work out some Taylor Series expansions of popular functions.

• f(x) = \(\frac{1}{(1−x)}\)

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

• f(x) = ln(1 + x)

• f(x)=\(x^{(1/2)}\)

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

Solution:

By definition, Taylor Series can be defined as follows:

f(x) = \(\sum_{n=0}^{\infty} \frac {f^{(n)}(c)}{n!} (x-c)^{n}\)

CASE 1:

For f(x) = \(\frac{1}{(1−x)}\)

First derivatives for the given function f(x):

\(f^{(0)}(c)\) = \(\frac {1}{(1-c)}\)

\(f^{(1)}(c)\) = \(\frac {1}{(1-c)^2}\)

\(f^{(2)}(c)\) = \(\frac {2}{(1-c)^3}\)

\(f^{(3)}(c)\) = \(\frac {6}{(1-c)^4}\)

\(f^{(4)}(c)\) = \(\frac {24}{(1-c)^5}\)

Applying the Taylor’s series given above:

==> f(x) = \(\frac{1}{(1-c)0!}(x-c)^0 + \frac{1}{(1-c)^2 1!}(x-c)^1 + \frac{2}{(1-c)^3 2!}(x-c)^2 + \frac{6}{(1-c)^4 3!}(x-c)^3 + \frac{24}{(1-c)^5 4!}(x-c)^4 + ...\)

= \(\frac{1}{(1-c)} + \frac{1}{(1-c)^2}(x-c) + \frac{2!}{(1-c)^3 2!}(x-c)^2 + \frac{3!}{(1-c)^4 3!}(x-c)^3 + \frac{4!}{(1-c)^5 4!}(x-c)^4 + ...\)

= \(\frac{1}{(1-c)} + \frac{1}{(1-c)^2}(x-c) + \frac{1}{(1-c)^3}(x-c)^2 + \frac{1}{(1-c)^4}(x-c)^3 + \frac{1}{(1-c)^5}(x-c)^4 + ...\)

= \(\sum\limits_{n=0}^{\infty} \frac{1}{(1-c)^{n+1}}(x-c)^n\)

Setting c = 0 gives the Maclaurin Series of f(x):

\(f(x) \approx P(x) = \sum_{n=0}^{\infty} x^{n} = 1 + x + x^{2} + x^{3} + x^{4} + ...\)

CASE 2:

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

First Derivatives

\(f^{(0)}(c)\) = \(e^{c}\)

\(f^{(1)}(c)\) = \(e^{c}\)

\(f^{(2)}(c)\) = \(e^{c}\)

\(f^{(3)}(c)\) = \(e^{c}\)

\(f^{(4)}(c)\) = \(e^{c}\)

Applying the Taylor’s series given above:

f(x) = \(\frac{e^c}{0!}(x-c)^0 + \frac{e^c}{1!}(x-c)^1 + \frac{e^c}{2!}(x-c)^2 + \frac{e^c}{3!}(x-c)^3 + ...\)

= \(e^c + e^c(x-c) + e^c\frac{(x-c)^2}{2!} + e^c\frac{(x-c)^3}{3!} + ...\)

= \(e^c \sum\limits_{n=0}^{\infty} \frac{(x-c)^n}{n!}\)

Setting c = 0 gives the Maclaurin Series of f(x):

\(f(x) \approx P(x) = \sum_{n=0}^{\infty} \frac {x^{n}}{n!} = 1 + x + \frac {x^{2}}{2!} + \frac {x^{3}}{3!} + \frac {x^{4}}{4!} + ...\)

CASE 3:

For f(x) = ln(1 + x)

First derivatives for the given function f(x):

\(f^{(0)}(c) = ln(1 + c)\)

\(f^{(1)}(c)=\frac{1}{(c+1)}\)

\(f^{(2)}(c)= -\frac{1}{(c+1)^2}\)

\(f^{(3)}(c)= \frac{2}{(c+1)^3}\)

\(f^{(4)}(c)= -\frac{6}{(c+1)^4}\)

Applying the Taylor’s series given above:

\[\begin{split} &==> \frac{ln(c+1)}{0!}(x-c)^0 + \frac{1}{(c+1)1!}(x-c)^1 - \frac{1}{(c+1)^2 2!}(x-c)^2 + \frac{2}{(c+1)^3 3!}(x-c)^3 - \frac{6}{(c+1)^4 4!}(x-c)^4 + ...\\ &= ln(c+1) + \frac{1}{(c+1)}(x-c) - \frac{1!}{(c+1)^2 2\times1!}(x-c)^2 + \frac{2!}{(c+1)^3 3\times2!}(x-c)^3 - \frac{3!}{(c+1)^4 4\times3!}(x-c)^4 + ...\\ &= ln(c+1) + \frac{1}{(c+1)}(x-c) - \frac{1}{2(c+1)^2}(x-c)^2 + \frac{1}{3(c+1)^3}(x-c)^3 - \frac{1}{4(c+1)^4}(x-c)^4 + ...\\ &= ln(c+1) + \sum\limits_{n=1}^{\infty} (-1)^{n+1}\frac{(x-c)^n}{n(c+1)^n} \end{split}\]

Setting c = 0 gives the Maclaurin Series of f(x):

\(f(x) \approx P(x) = \sum_{n=1}^{\infty} (-1)^{n+1} \frac {(x)^{n}}{n} = x - \frac {x^{2}}{2} + \frac {x^{3}}{3} - \frac {x^{4}}{4} + ...\)

CASE 4:

For f(x) = \(x^{(1/2)}\)

First derivatives for the given function f(x):

\(f^{(0)}(c) = c^{1/2}\)

\(f^{(1)}(c) = \frac {1}{2 (c^{1/2})}\)

\(f^{(2)}(c) = -\frac {1}{4 (c^{3/2})}\)

\(f^{(3)}(c) = \frac {3}{8 (c^{5/2})}\)

\(f^{(4)}(c) = -\frac {15}{16 (c^{7/2})}\)

Applying the Taylor’s series given above:

\[\begin{split} f(c) &= \frac{c^{1/2}}{0!}(x-c)^0 + \frac{c^{-1/2}}{2*1!}(x-c)^1 - \frac{c^{-3/2}}{4 * 2!}(x-c)^2 + \frac{3c^{-5/2}}{8 * 3!}(x-c)^3 + \frac{15c^{-7/2}}{16 * 4!}(x-c)^4 + ... \\ &= c^{1/2} + \frac{c^{-1/2}}{2}(x-c) - \frac{c^{-3/2}}{8}(x-c)^2 + \frac{c^{-5/2}}{16}(x-c)^3 + \frac{c^{-7/2}}{128}(x-c)^4 + ... \\ &= \sum\limits_{n=0}^{\infty} \frac{c^{1/2 - n}}{2^{n}}(x-c)^n\\ f(c) &= \sum\limits_{n=0}^{\infty} \binom{1/2}{n}(x-c)^n\\ \end{split}\]