Mathwizurd.com is created by David Witten, a mathematics and computer science student at Vanderbilt University. For more information, see the "About" page.

Apr 27 Taylor Polynomials

A long time ago, I wrote about differentials. That estimates the function as a line at a specific point.

MathJax TeX Test Page If you want to be more accurate by using the second derivative, or third derivative, you need to use somethings called a Taylor polynomial.

Theorem: If f has n derivatives at c, then the polynomial $$P_n(x) = f(c) + f'(c)(x-c) + \frac{f''(c)}{2!}(x-c)^2 + ... + \frac{f^{(n)}(c)}{n!}(x-c)^n$$ is the nth Taylor polynomial for f at c. Recall that this is an n-degree polynomial approximation for f(x). Maclaurin polynomials come up a lot, and those are just Taylor polynomials centered at the origin, so c = 0.

Example: Estimating e

MathJax TeX Test Page Let $f(x) = e^x$, so the taylor polynomial is $$P_n(x) = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + ... + \frac{x^n}{n!}$$ Let's say we want to know e, so when x = 1, f(x) = e, so $$P_n(1) = 2 + \frac{1}{2} + \frac{1}{6} + \frac{1}{24} + ... + \frac{1}{n!}$$ This is very accurate, with $P_7(1) = 2.71805$, while $e = 2.71828$

Remainder of a Taylor Polynomial

A taylor polynomial is just an approximation, so it isn't equal to f(x), but it's close. So, you can say this:

MathJax TeX Test Page $$f(x) = P_n(x) + R_n(x)$$ $R_n(x)$ is the remainder function, which is also the error of the Taylor polynomial. $$\text{Error = } |R_n(x)| = |f(x) - P_n(x)|$$

There's a theorem that gives a general procedure for estimating the remainder. This is called Taylor's Theorem, and the remainder is called the Lagrange Error Bound.

MathJax TeX Test Page Theorem If a function f is differentiable through order n + 1 in and interval I containing c, then $\forall{}x\in I, \exists$ z between x and c such that $$f(x) = f(c) + f'(c)(x-c) + \frac{f''(c)}{2}(x-c)^2 + ... + \frac{f^{(n)}(x)}{n!}(x-c)^n + R_n(x)$$ where $$R_n(x) = \frac{f^{(n+1)}(z)}{(n+1)!}(x-c)^{n+1}$$ We can also say this: $$\boxed{|R_n(x)| \leq \frac{|x-c|^{n+1}}{(n+1)!}\times max|f^{(n+1)}(x)|}$$ where max$|f^{(n+1)}(x)|$ is the maximum value of $f^{(n+1)}(x)$ between x and c.

Example- Approximating to a Desired Accuracy

MathJax TeX Test Page Determine the degree of a taylor polynomial $P_n(x)$ exapnded about c = 1 that should be used to approximate $\ln{1.2}$ so that the error $\lt$ 0.001

$$\text{We know } R_n = \frac{f^{(n+1)}(z)}{(n+1)!}(x-c)^{n+1}$$ So, we need to figure out the (n+1)st derivative $$f'(x) = x^{-1}, f''(x) = -x^{-2}, f'''(x) = 2x^{-3}, f^{(4)} = -6x^{-24}$$ So, there's an evident pattern: $$f^{(n)}(x) = (-1)^{n - 1} * \frac{(n-1)!}{x^n}$$ $$f^{(n+1)}(x) + -1^{n} * \frac{n!}{x^{n+1}}$$ We can plug that in $$|R_n| = |\frac{n!}{x^{n+1}}\times\frac{1}{(n+1)!}\times(1.2-1)^{n+1}|$$ $$= \frac{(0.2)^{n+1}}{z^{n+1}(n+1)}$$ z > 1, so that's less than $$\frac{(0.2)^{n+1}}{n+1} < 0.001$$ Plug in values for n, and the smallest value that works is n = 3. Note: I didn't use the equation involving the max (n+1)st derivative. Sometimes that's not necessary
David Witten