CUNY 605 Homework Week 14
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)\)
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 formula for Taylor Polynomial is:
\[P(x) = \Sigma_{n=0}^{\infty}\frac{f^{(n)}(c)}{n!}(x-c)^n\]
1. \(f(x) = \frac{1}{(1-x)}\)
Let’s expand this function \(f(x)\) into the polynomials. We’ll obtain the first few coefficients.
Via the chain rule, \(f'(x) = \frac{1}{(1-x)^2}\), \(f''(x) = \frac{2}{(1-x)^3}\), and \(f'''(x) = \frac{6}{(1-x)^4}\).
\(P(x) = f(c) + \frac{f'(c)}{1!}(x-c)^1 + \frac{f''(c)}{2!}(x-c)^2 + \frac{f'''(c)}{3!}(x-c)^3 + ...\)
Let’s substitute the derivations from (1) into (2).
\[P(x) = \frac{1}{(1-x)} + \frac{\frac{1}{(1-x)^2}}{1!}(x-c)^1 + \frac{\frac{2}{(1-x)^3}}{2!}(x-c)^2 + \frac{\frac{6}{(1-x)^4}}{3!}(x-c)^3+...\]
Now, let’s suppose that we let \(c = 0\), or in other words, turn this Taylor Polynomial expansion into a Maclaurin polynomial.
\[P(x) = \frac{1}{(1-x)} + \frac{\frac{1}{(1-x)^2}}{1!}x^1 + \frac{\frac{2}{(1-x)^3}}{2!}x^2 + \frac{\frac{6}{(1-x)^4}}{3!}x^3+...\]
We can now find the coefficients for the polynomials.
- \(f(0) = \frac{1}{1-0} = 1\)
- \(f'(0) = \frac{1}{1^2} = 1\). The coefficient for the 1st degree polynomial is \(\frac{1}{1!} = 1\).
- \(f''(0) = \frac{2}{1^3} = 2\). The coefficient for the 2nd degree polynomial is \(\frac{2}{2!} = 1\).
- \(f'''(0) = \frac{6}{1^4} = 6\). The coefficient for the 3rd degree polynomial is \(\frac{6}{3!} = 1\).
As we notice, there appears to be a pattern.
\[P(x) = 1 + x + x^2 + x^3 + ... = \Sigma_{n=0}^{\infty} x^n\]
2. \(f(x) = e^x\)
Following the above steps: This time, we will peform the Maclaurin Polynomial Expansion, which is a type of Taylor Series (where c is centered at 0).
Taking the differentiation of \(f(x)\). \(f'(x) = e^x\), \(f''(x) = e^x\), \(f'''(x) = e^x\), and so forth.
$P(x) = \(P(x) = f(x) + \frac{f'(x)}{1!}x^1 + \frac{f''(x)}{2!}x^2 + \frac{f'''(x)}{3!}x^3 + ...\)
Plug in the derivations.
\[P(x) = e^x + \frac{e^x}{1!}x^1 + \frac{e^x}{2!}x^2 + \frac{e^x}{3!}x^3 +...\]
We can now find the coefficients for the polynomials.
- \(P(0) = e^0 = 1\)
- \(f'(0) = e^0 = 1\). The coefficient for the 1st degree polynomial is: \(\frac{1}{1!} = 1\).
- \(f''(0) = e^0 = 1\). The coefficient for the 2nd degree polynomial is: \(\frac{1}{2!} = \frac{1}{2}\).
- \(f'''(0) = e^0 = 1\). The coefficient for the 3rd degree polynomial is: \(\frac{1}{3!} = \frac{1}{6}\).
We start to see a pattern, which leads to our answer for the Taylor (or in this case, Maclaurin) Series.
\[P(x) = 1 + x + \frac{1}{2!}x^2 + \frac{1}{3!}x^3 + ... = \Sigma_{n=0}^{\infty}\frac{1}{n!}x^n\]
3. \(f(x) = ln(1+x)\)
Following the above steps using the Maclaurin Series.
Taking derivations. \(f'(x) = \frac{1}{1+x}\), \(f''(x) = \frac{-1}{(1+x)^2}\), \(f'''(x) = \frac{2}{(x+1)^3}\), \(f''''(x) = \frac{-6}{(x+1)^4}\).
\(P(x) = f(x) + \frac{f'(x)}{1!}x^1 + \frac{f''(x)}{2!}x^2 + \frac{f'''(x)}{3!}x^3 + ...\)
Substituting (1) into (2).
\[P(x) = ln(1+x) + \frac{\frac{1}{1+x}}{1!}x^1 + \frac{\frac{-1}{(1+x)^2}}{2!}x^2 + \frac{\frac{2}{(x+1)^3}}{3!}x^3 + \frac{\frac{-6}{(x+1)^4}}{4!}x^4 ...\]
Now we can find our coefficients for the polynomials.
- \(P(0) = ln(1+0) = 0\)
- \(f'(0) = \frac{1}{1} = 1\). The coefficient for the 1st degree polynomial is: \(\frac{1}{1!} = 1\).
- \(f''(0) = \frac{-1}{1} = -1\). The coefficient for the 2nd degree polynomial is: \(\frac{-1}{2!} = \frac{-1}{2}\).
- \(f'''(0) = \frac{2}{1} = 2\). The coefficient for the 3rd degree polynomial is: \(\frac{2}{3!} = \frac{2}{6} = \frac{1}{3}\).
- \(f^4(0) = \frac{-6}{1} = -6\). The coefficient for the 4th degree polynomial is: \(\frac{-6}{4!} = \frac{-6}{24} = \frac{-1}{4}\).
Here, we start seeing a pattern, and now we can find the Maclaurin Series for this function.
\[P(x) = x - \frac{1}{2}x^2 + \frac{1}{3}x^3 - \frac{1}{4}x^4 +... = \Sigma_{n=0}^{\infty}(-1)^{n+1}\frac{1}{n}x^n\]