Taylor polynomials.

Definition 10.6.1   Let $ f$ be a function differentiable at least $ n$ times in a neighborhood of $ x_0$ . The polynomial

$\displaystyle P(x)= f(x_0)+(x-x_0)f'(x_0)$ $\displaystyle +\frac {1}{2!}(x-x_0)^2f''(x_0)$    
$\displaystyle \quad$ $\displaystyle +\frac {1}{3!}(x-x_0)^3f'''(x_0)+\dots + \frac {1}{2!}(x-x_0)^nf^{(n)}(x_0)$    

is called the Taylor polynomial of degree $ n$ of the function $ f$ at $ x_0$ .

If $ x_0=0$ , this polynomial is called the Mac-Laurin polynomial of degree $ n$ of $ f$ .

Example 10.6.2   Let $ f(x)= e^x$ .

For any natural number $ n$ , we have $ \frac {d}{dx}(e^x)=e^x$ , thus $ \left[ \frac {d}{dx}(e^x) \right]_{x=0}=1$ .

Thus the MacLaurin series of $ e^x$ is:

$\displaystyle e^x= \underset{n=0}{\overset{+\infty} {\sum}} \frac {x^n}{n!} = 1 + x + \frac {x^2}{2!} + \dots + \frac {x^n}{n!}+ \dots \; .$    

The Taylor polynomial of order $ n$ at 0 of $ e^x$ is therefore:

$\displaystyle P_n(x)=\underset{k=0}{\overset{n} {\sum}} \frac {x^k}{k!} = 1 + x + \frac {x^2}{2!} + \dots + \frac {x^n}{n!}.$    

Theorem 10.6.3 (Lagrange's Remainder)   Suppose that $ f$ has continuous derivatives up to order $ n$ on the interval $ [a,b]$ , and that $ f^{(n)}$ is differentiable on $ (a,b)$ . Then there exists a number $ c \in (a,b)$ such that

$\displaystyle f(b) =$ $\displaystyle f(a) + f'(a)(b-a)+ \frac {f''(a)}{2!}(b-a)^2 + \frac {f^{(3)}(a)}{3!}(b-a)^3$    
$\displaystyle \quad$ $\displaystyle +\frac {f^{(4)}(a)}{4!}(b-a)^4 + \dots + \frac {f^{(n)}(a)}{n!}(b-a)^n + \frac {f^{(n+1)}(c)}{(n+1)!}(b-a)^{n+1}$    

The number $ R_n(b)=\frac {f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1}$ is called Lagrange's remainder.

This theorem gives an estimation of the error when approximating a function by its Taylor polynomial of order $ n$ .

Theorem 10.6.4 (The Remainder Estimation Theorem)       
  1. With the settings of Thm 6.3, suppose that there exist two positive numbers $ M$ and $ R$ such that for any $ t$ between $ a$ and $ x$ , the following inequality is verified:

    $\displaystyle \vert f^{n+1}(t)\vert \leq M \frac {R^{n+1} \vert x-a\vert^{n+1}}{(n+1)!}$    

    Then, Lagrange's remainder verifies the inequality:

    $\displaystyle \vert R_n(x) \leq M \frac {R^{n+1} \vert x-a\vert^{n+1}}{(n+1)!}$    

  2. If all these conditions hold for every natural number $ n$ , then Taylor series converges and its sum is equal to $ f(x)$ .

Example 10.6.5   Let $ f(x)= \cos x$ . We have:

$\displaystyle \forall n \in \mathbb{N}, \; f^{(n)}= \cos \left(x + \frac {n \pi }{2} \right).$    

Therefore $ f^(2k)(0)=(-1)^k$ and $ f^(2k+1)(0)=0$ .

We have:

$\displaystyle \cos x = 1 - \frac {x^2}{2!} + \frac {x^4}{4!} - \dots + \frac {(-1)^n x^{2n+1}}{((2n+1)!} + R_{2n+1}(x).$    

As all values of the cosine function are between $ -1$ and 1, the remainder $ R_{2n+1}(x)$ verifies the inequality:

$\displaystyle \vert R_{2n+1}(x)\vert \leq \frac {\vert x\vert^{2n+1}}{(2n+1)!}.$    

As $ \underset{n\rightarrow + \infty }{\lim} \frac {\vert x\vert^{2n+1}}{(2n+1)!} =0$ , for all real $ x$ , the MacLaurin series of the cosine function is convergent for every real number $ x$ .

In Fig. 2 is a Maple display for MacLaurin polynomials of the cosine function (blue), of order 2 (yellow curve),4 (green curve) and 6 (red curve). Pay attention to the fact it seems that the larger the degree of the approximation, the better the approximation.

Figure 2: The graphs of the first MacLaurin polynomials for the cosine function.
\begin{figure}\mbox{\epsfig{file=Taylor-cos.eps,height=6cm}}\end{figure}

As $ \underset{n\rightarrow + \infty }{\lim} \frac {\vert x\vert^{2n+1}}{(2n+1)!} =0$ , for all real $ x$ , the MacLaurin series of the cosine function is convergent for every real number $ x$ .

By the same way we can prove that all the MacLaurin series in 5.2 converge towards the given functions.

In Fig. 3 is a Maple display for MacLaurin polynomials of the sine function (in blue), of order 1 (in green),3 (in red) and 5 (in yellow).

Figure 3: The graphs of the first MacLaurin polynomials for the sine function.
\begin{figure}\mbox{\epsfig{file=Taylor-sin.eps,height=6cm}}\end{figure}

Finally, we give in Fig. 4 a mathplot display for MacLaurin polynomials of the function $ f$ such that $ f(x)=\sqrt {1+x}$ of order 1 (curve $ C1$ ),2 (curve $ C2$ ) and 3 (curve $ C3$ ).

Figure 4: The graphs of the first MacLaurin polynomials for $ f(x)=\sqrt {1+x}$ .
\begin{figure}\mbox{\epsfig{file=SqrtMacLaurin.eps,height=5cm}}\end{figure}

Studying the convergence domain of a Taylor series is a non trivial issue. Let us see a couple of examples. Take $ f_1(x)=1/(1+x)$ . The function $ f_1$ is defined over $ \mathbb{R}-\{ 1 \}$ . Its first MacLaurin polynomials are given as follows:

$\displaystyle P_1(x)$ $\displaystyle = 1 -x$    
$\displaystyle P_2(x)$ $\displaystyle = 1 -x+x^2$    
$\displaystyle P_3(x)$ $\displaystyle = 1 -x+x^2-x^3$    
$\displaystyle P_4(x)$ $\displaystyle = 1 -x+x^2-x^3+x^4.$    

The MacLaurin series of the function $ f_1$ is a geometric series whose ratio is equal to $ x$ , thus it is convergent iff $ x \in (-1,1)$ . It has no meaning (at least for us now) out of this interval. This situation is illustrated in Figure 5.
Figure 5: The MacLaurin series converges on a subdomain of the function's domain.
\begin{figure}\mbox{\epsfig{file=MacLaurin-cv-pb-01.eps,height=6cm}}\end{figure}

We can find a first partial explanation for this situation: at -1, the function $ f_1$ is not defined. As the domain of convergence of the MacLaurin series is an interval centered at 0, it cannot be larger than $ (-1,1)$ .

Take now $ f_2(x)=1/(1+x^2)$ . This function is defined over the whole of $ \mathbb{R}$ .The first partial sums of its MacLaurin series are as follows:

$\displaystyle P_1(x)$ $\displaystyle = 1 -x^2$    
$\displaystyle P_2(x)$ $\displaystyle = 1 -x^2+x^4$    
$\displaystyle P_3(x)$ $\displaystyle = 1 -x^2+x^4-x^6$    
$\displaystyle P_4(x)$ $\displaystyle = 1 -x^2+x^4-x^6+x^8.$    

The series is geometric and its ratio is equal to $ x^2$ . Thus as previously the series is convergent iff $ x \in (-1,1)$ . The graphs of the function and of these partial sums are displayed in Figure 6.
Figure 6: The MacLaurin series converges on a subdomain of the function's domain.
\begin{figure}\mbox{\epsfig{file=MacLaurin-cv-pb-02.eps,height=6cm}}\end{figure}
The function $ f_2$ is defined over the whole of $ \mathbb{R}$ . There is no opportunity to use an argument as the one used above for $ f_1$ . We will wait until we learn the course in Complex Variables to have a more convincing argument (http://ndp.jct.ac.il/tutorials/complex/node51.html).

Noah Dana-Picard 2007-12-28