next up previous
Next: About this document ...


11.1: Taylor polynomials
The derivative as the first Taylor polynomial

If $f(x)$ is differentiable at $a$, then the function $p(x) = b + m(x-a)$ where $b = f(0)$ and $m = f'(x)$ is the ``best'' linear approximation to $f$ near $a$.

For $x \approx a$ we have $f(x) \approx p(x)$.

Note that $f(a) = b = p(a)$ and $f'(a) = m = p'(a)$.


Higher degree Taylor polynomials

If $f(x)$ is a function which is $n$ times differentiable at $a$, then the $n^\text{th}$ Taylor polynomial of $f$ at $a$ is the polynomial $p(x)$ of degree (at most $n$) for which $f^{(i)}(a) = p^{(i)}(a)$ for all $i \leq n$.


Example

Compute the third Taylor polynomial of $f(x) = e^x$ at $a = 0$.


Solution

Write $p(x) = c_0 + c_1 x + c_2 x^2 + c_3 x^3$. We need to find $c_0$, $c_1$, $c_2$, and $c_3$ so that $p^{(i)}(0) = f^{(i)}(0)$ for $i = 0$, $1$, $2$, and $3$.

In our case $f^{(i)}(x) = e^x$ for all $i \geq 0$ and $e^0 = 1$. So, $f^{(i)}(0) = 1$ for all $i$.

We compute $p'(x) = c_1 + 2 c_2 x + 3 c_3 x^2$, $p''(x) = 2c_2 + 6 c_3 x$, and $p'''(x) = 6 c_3$. Thus,

$1 = f^{(0)}(0) = p^{(0)}(0) = c_0$.

$1 = f^{(1)}(0) = p^{(1)}(0) = c_1$.

$1 = f^{(2)}(0) = p^{(2)}(0) = 2 c_2$ so that $c_2 = \frac{1}{2}$.

Finally, $1 = f^{(3)}(0) = p^{(3)}(0) = 6 c_3$ so that $c_3 = \frac{1}{6}$.

Thus, the third Taylor polynomial of $f(x) = e^x$ at $a = 0$ is $p(x) = \frac{1}{6} x^3 + \frac{1}{2} x^2 + x + 1$.


Another Example

Find the third Taylor polynomial of $f(x) = \ln(x)$ at $a = 1$.


A solution

As before, we write $p(x) = c_0 + c_1 x + c_2 x^2 + c_3 x^3$ and we find $p'(x) = c_1 + 2 c_2 x + 3 c_3 x^2$, $p''(x) = 2c_2 + 6 c_3 x$, and $p'''(x) = 6 c_3$.

Differentiating, $f'(x) = \frac{1}{x} = x^{-1}$, $f''(x) = - x^{-2}$, and $f'''(x) = 2 x^{-3}$. Thus,

$0 = f^{(0)}(1) = p^{(0)}(1) = c_0 + c_1 + c_2 + c_3$

$1 = f^{(1)}(1) = p^{(1)}(1) = c_1 + 2c_2 + 3c_3$

$-1 = f^{(2)}(1) = p^{(2)}(1) = 2c_2 + 6c_3$

$2 = f^{(3)}(1) = p^{(3)}(1) = 6 c_3$

Solving these equations, we find $c_3 = \frac{1}{3}$, $c_2 = \frac{-3}{2}$, $c_1 = 3$, and $c_0 = \frac{-11}{6}$.

That is, the third Taylor polynomial of $\ln(x)$ at $a = 1$ is $\frac{1}{3} x^3 - \frac{3}{2} x^2 + 3x - \frac{11}{6}$.


Another solution

We may write any polynomial of degree three as $p(x) = d_0 + d_1 (x - 1) + d_2 (x - 1)^2 + d_3 (x - 1)^3$.

Differentiating, we have $p'(x) = d_1 + 2 d_2 (x-1) + 3 d_3 (x-1)^2$, $p''(x) = 2 d_2 + 6 d_3 (x-1)$, and $p'''(x) = 6 d_3$.

So, $p(1) = d_0$, $p'(1) = d_1$, $p''(1) = 2 d_2$, and $p'''(1) = 6 d_3$.

Hence, if $p$ is the third Taylor polynomial of $\ln(x)$ at $a = 1$, we have $d_0 = 0$, $d_1 = 1$, $d_2 = \frac{-1}{2}$, and $d_3 = \frac{1}{3}$.

That is, the third Taylor polynomial of $\ln(x)$ at $a = 0$ is $\frac{1}{3} (x - 1)^3 - \frac{1}{2} (x - 1)^2 + (x - 1)$.


General formula for Taylor polynomials

If we write $p(x) = \sum_{i=0}^n d_i (x - a)^i$, then $p^{(j)}(x) = \sum_{i=j}^n \frac{i!}{(i-j)!} d_i (x - a)^{i-j}$ where $i! = i \cdot (i - 1) \cdot (i - 2) \cdots 2 \cdot 1$. (We define $0! = 1$ and $(i+1)! = (i+1) \cdot i!$.)

In particular, $p^{(j)}(a) = j! d_j$. So, if $p$ is the $n^\text{th}$ Taylor polynomial of $f$ at $a$, we have $j! d_j = p^{(j)}(a) = f^{(j)}(a)$.

Thus, $d_j = \frac{1}{j!} f^{(j)}(a)$ or to put it another way, the $n^\text{th}$ Taylor polynomial of $f$ at $a$ is $\sum_{j=0}^n \frac{1}{j!} f^{(j)}(a) (x - a)^j$.


Example
Compute the fifth Taylor polynomial of $f(x) = \sin(x)$ at $a = 0$.


Solution

We compute $f'(x) = \cos(x)$, $f''(x) = -\sin(x)$, $f'''(x) = -\cos(x)$, $f^{(4)}(x) = \sin(x)$, and $f^{(5)}(x) = \cos(x)$. Thus, $f^{(0)}(0) = 0$, $f^{(1)}(0) = 1$, $f^{(2)}(0) = 0$, $f^{(3)}(0) = -1$, $f^{(4)}(0) = 0$, and $f^{(5)}(0) = 1$.

We compute the first few factorials: $0! = 1$, $1! = 1 \cdot 0! = 1 \cdot 1 = 1$, $2! = 2 \cdot 1! = 2 \cdot 1 = 2$, $3! = 3 \cdot 2! = 3 \cdot 2 = 6$, $4! = 4 \cdot 3! = 4 \cdot 6 = 24$, and $5! = 5 \cdot 4! = 5 \cdot 24 = 120$.

Therefore, the fifth Taylor polynomial of $f(x) = \sin(x)$ at $a = 0$ is $\frac{1}{120} x^5 - \frac{1}{6} x^3 + x$.


Error estimates

If $f(x)$ is $(n+1)$ times differentiable between on the interval $[a,x]$ (or $[x,a]$ if $x < a$) and $p(x)$ is the $n^\text{th}$ Taylor polynomial of $f$ at $a$, then there is a number $a \leq c \leq x$ so that $f(x) - p(x) = \frac{1}{(n+1)!} f^{(n+1)}(c) (x - a)^{n+1}$.

So, if we can find $M$ so that $\vert f^{(n+1)}(y)\vert \leq M$ whenever $a \leq y \leq x$, we would know that $\vert f(x) - p(x)\vert \leq \frac{M}{(n+1)!} (x - a)^{n+1}$.


Example

Find a decimal approximation to $e$ valid to the hundredths place.


Solution

We will find $n$ so that if $p(x)$ is the $n^\text{th}$ Taylor polynomial for $f(x) = e^x$ at $a = 0$, then $\vert e - p(1)\vert = \vert f(1) - p(1)\vert < \frac{1}{200}$.

We know that $f^{(n+1)}(x) = e^x$ and that on the interval from zero to one this function is bounded by $3$.

Thus, $\vert e - p(1)\vert \leq \frac{3}{(n+1)!} (1 - 0)^{n+1} = \frac{3}{(n+1)!}$.

So, we want $n$ so that $\frac{3}{(n+1)!} < \frac{1}{120}$ or what is the same thing $(n+1)! > 360$. If $n = 5$, then $(n+1)! = 6! = 720 > 360$.

Now, $p(x) = \frac{1}{120} x^5 + \frac{1}{24} x^4 + \frac{1}{6} x^3 +
\frac{1}{2} x^2 + x + 1$. So, $e \approx \frac{1}{120} + \frac{1}{24} +
\frac{1}{6} + \frac{1}{2} + 1 + 1= \f...
...+ 120 + 120}{120} =
\frac{326}{120} = \frac{163}{60} \approx 2.7166666666.....$.


A better approximation to $e$

In point of fact, $e \approx 2.718281828459045235360287471$ $35266249775724709369995957$ $4966967627724076630353547$ $59457138217852516642742$ $7466391932003$ $059921817413$ $596629043572900334295$ $2605956307$ $38132328$ $6279434907632$ $338298807531952$ $5101901157$ $38341879307021540891$ $499348841675092447614$ $606680822648001$ $68477411853742$ $3454424371075$ $3907774499206955170$ $276183860626133$ $138458300075$ $204493382656$ $0297606737113$ $2007093287091$ $27443747047$ $2306969772093$ $101416928368$ $190255151$ $086574637721$ $1125238978442$ $505695369677$ $078544996996794686$ $445490598793$ $163688923009$ $879312773617821$ $54249992295763$ $514822082698951$ $93668033182528$ $869398496$ $465105820939239$ $829488793320362$ $5094431$.




next up previous
Next: About this document ...
Thomas Scanlon 2004-04-14