Question:

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.

\[f\left(x \right) = \frac{1}{1-x}\]

Answer:

So, let’s get the first few derivatives

\[f\left(x\right) = \frac{1}{1-x}\] \[{f}^{\prime}\left(x\right) = \frac{1}{{\left(1-x\right)}^{2}}\] \[{f}^{\prime\prime}\left(x\right) = \frac{2}{{\left(1-x\right)}^{3}}\] \[{f}^{\prime\prime\prime}\left(x\right) = \frac{6}{{\left(1-x\right)}^{4}}\]

So the series looks like this:

\[\frac{\frac{1}{1-c}}{0!} * {\left(x - c \right)}^{0} + \frac{\frac{1}{{\left(1-c\right)}^{2}}}{1!} * {\left(x - c \right)}^{1} + \frac{\frac{2}{{\left(1-c\right)}^{3}}}{2!} * {\left(x - c \right)}^{2} + \frac{\frac{6}{{\left(1-c\right)}^{4}}}{3!} * {\left(x - c \right)}^{3} \]

\[= \frac{1}{1-c} + \frac{\left(x - c\right)}{{\left(1-c\right)}^{2}} + \frac{2{\left(x - c\right)}^{2}}{2!{\left(1-c\right)}^{3}} + \frac{6{\left(x - c\right)}^{3}}{3!{\left(1-c\right)}^{4}} \]

\[= \frac{1}{1-c} + \frac{\left(x - c\right)}{{\left(1-c\right)}^{2}} + \frac{{\left(x - c\right)}^{2}}{{\left(1-c\right)}^{3}} + \frac{{\left(x - c\right)}^{3}}{{\left(1-c\right)}^{4}} \]

So, how come this is popular? Well, we can see that the taylor series expansion is just the formula to the power of n in the numerator and n + 1 in the denominator

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

More familiarly, at \(c = 0\) it is simply a power function:

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

Question:

\[f\left(x \right) = {e}^{x}\]

Answer:

first few derivatives

\[f\left(x\right) = {e}^{x}\] \[{f}^{\prime}\left(x\right) = {e}^{x}\] \[{f}^{\prime\prime}\left(x\right) = {e}^{x}\]

….and here we see that the function always stays the same, so the series looks like this:

\[\frac{{e}^{c}}{0!} * {\left(x - c \right)}^{0} + \frac{{e}^{c}}{1!} * {\left(x - c \right)}^{1} + \frac{{e}^{c}}{2!} * {\left(x - c \right)}^{2} + \frac{{e}^{c}}{3!} * {\left(x - c \right)}^{3} \]

Which simplifies to:

\[= {e}^{c} + \frac{{e}^{c}}{1!}*{\left(x - c \right)}^{1} + \frac{{e}^{c}}{2!}*{\left(x - c \right)}^{2} + \frac{{e}^{c}}{3!}*{\left(x - c \right)}^{3}\]

Now, the summarized function looks like so:

\[\sum _{ n=0 }^{ \infty }{ \frac{{e}^{c}*{\left( x - c\right)}^{n}}{n!}}\]

So, at \(c = 0\), we get:

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

Question:

\[f\left(x \right) = ln\left(1+x\right)\]

Answer:

first few derivatives

\[f\left(x\right) = ln\left(1+x\right)\] \[{f}^{\prime}\left(x\right) = \frac{1}{1 + x}\]

\[{f}^{\prime\prime}\left(x\right) = -\frac{1}{{\left(1 + x\right)}^{2}}\] \[{f}^{\prime\prime\prime}\left(x\right) = \frac{2}{{\left(1 + x\right)}^{3}}\] \[{f}^{\prime\prime\prime\prime}\left(x\right) = -\frac{6}{{\left(1 + x\right)}^{4}}\]

So the series looks like this:

\[\frac{ln\left( 1+c\right)}{0!} * {\left(x - c \right)}^{0} + \frac{\frac{1}{{\left(1 + c\right)}^{1}}}{1!} * {\left(x - c \right)}^{1} + \frac{-\frac{1}{{\left(1 + c\right)}^{2}}}{2!} * {\left(x - c \right)}^{2} + \frac{\frac{2}{{\left(1 + c\right)}^{3}}}{3!} * {\left(x - c \right)}^{3} + \frac{-\frac{6}{{\left(1 + c\right)}^{4}}}{4!} * {\left(x - c \right)}^{4}\] \[= ln\left(1+c\right) + \frac{{\left(x - c \right)}^{1}}{{\left(1 + c\right)}^{1}} - \frac{{\left(x - c \right)}^{2}}{2{\left(1 + c\right)}^{2}} + \frac{{\left(x - c \right)}^{3}}{3{\left(1 + c\right)}^{3}} - \frac{{\left(x - c \right)}^{4}}{4{\left(1 + c\right)}^{4}}\] As in the first example, we can see there is an alternating sign that can be taken care of using \({\left(-1\right)}^{n+1}\). Now, the rest is pretty easy so we can just express the final function:

\[ln\left(1+c\right) +\sum _{ n=1 }^{ \infty }{ {\left(-1\right)}^{n+1} \frac{{\left(x-c\right)^{n}}}{{n\left(1+c \right)}^{n}}}\]

So, if we took \(c = 0\), we can see this equation is:

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