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.

My Answers

There are lots of ways to represent the Taylor Series expansion. I find this one convient:

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

It shows we need to find the various derivatives of \(f(x)\), evaluate them at the points of interest and try to figure out the pattern that gives us a simplified expression for this \(f(x)\) Taylor series. This leads me to a table.

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

func form \(f(2)\) \(f(1)\) \(f(0)\) \(f(-1)\) \(f(-2)\)
\(f(x)\) \(\frac{1}{(1 - x)}\) -1 1/0 =UD 1 0.500 0.333
\(f^{(1)}(x)\) \(\frac{1}{(x - 1)^2}\) 1 1/0 =UD 1 0.250 0.111
\(f^{(2)}(x)\) \(\frac{-2}{(x - 1)^3}\) -2 -2/0 =UD 2 0.250 0.074
\(f^{(3)}(x)\) \(\frac{6}{(x - 1)^4}\) 6 6/0 =UD 6 0.375 0.074
\(f^{(4)}(x)\) \(\frac{-24}{(x - 1)^5}\) -24 24/0 =UD 24 0.750 0.099
\(f^{(5)}(x)\) \(\frac{120}{(x - 1)^6}\) 120 120/0 =UD 120 1.875 0.165

With center \(a = 0\), we get:

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

We can see the general pattern is \(\frac{n!x^n}{n!}\), which gives us \(x^n\).

\(\frac{1}{(1 - x)} = \sum_{n=0}^{\infty} x^n\),

which is what they got in our notes. We can see that \(f(1)\) is not defined (even though \(f(2)\) is ok), \(f(0), f(-1)\) and \(f(-2)\) all seem fine, so -1 <= x < 1 works for me.

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

func form \(f(2)\) \(f(1)\) \(f(0)\) \(f(-1)\) \(f(-2)\)
\(f(x)\) \(e^x\) 7.389 2.718 1 0.368 0.135
\(f^{(1)}(x)\) \(e^x\) 7.389 2.718 1 0.368 0.135
\(f^{(2)}(x)\) \(e^x\) 7.389 2.718 1 0.368 0.135
\(f^{(3)}(x)\) \(e^x\) 7.389 2.718 1 0.368 0.135
\(f^{(4)}(x)\) \(e^x\) 7.389 2.718 1 0.368 0.135
\(f^{(5)}(x)\) \(e^x\) 7.389 2.718 1 0.368 0.135

All derivatives are of the form \(e^x\), so with center \(a = 0\) they evaluate to 1. Thus the Taylor series has the form:

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

\(e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!}\) is also what was in the notes. This is true for around zero, and I think because \(f'(e^x) = e^x\) and for all the values we checked \(f(x\)) was defined, it holds for all x, but not sure how to prove it.

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

func form \(f(2)\) \(f(1)\) \(f(0)\) \(f(-1)\) \(f(-2)\)
\(f(x)\) \(ln(1 + x)\) 1.099 0.693 0 undef ln(-1) = UD or \(\pi i\)
\(f^{(1)}(x)\) \(\frac{1}{(x + 1)}\) 0.333 0.500 1 1/0 =UD -1
\(f^{(2)}(x)\) \(\frac{-1}{(x + 1)^2}\) -0.111 -0.250 -1 -1/0 =UD -1
\(f^{(3)}(x)\) \(\frac{2}{(x + 1)^3}\) 0.074 0.250 2 2/0 =UD -2
\(f^{(4)}(x)\) \(\frac{-6}{(x + 1)^4}\) -0.074 -0.375 -6 -6/0 =UD -6
\(f^{(5)}(x)\) \(\frac{24}{(x + 1)^5}\) 0.099 0.750 24 24/0 =UD -24

With center \(a = 0\), we get:

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

We can see the general pattern of \(\frac{(n - 1)!x^n}{n!}\). To get the signs correct we need \((-1)^{(n+1)}\), which gives us:

\(ln(1 + x) = \sum_{n=0}^{\infty} (-1)^{(n+1)} \frac{(n - 1)!x^n}{n!}\), which if you cancel out the factorials is the same as what they got in our notes.

\(ln(1 + x) = \sum_{n=0}^{\infty} (-1)^{(n+1)} \frac{x^n}{n}\)

Weird stuff happens as we approach -1 and ln(0), which is undefined for all derivatives and -2 is undefined for \(f(x)\), so I guess we can say for -1 < x < 1. My values for 1 and 2 make it seem we may be able to go on to 2 and higher.