Up to Main Lab Page | Next Lesson - Integration | Previous Lesson - Approximating Functions |
We can generalise the idea of constant, linear and quadratic approximations, the result is a Talylor series.
In general, given a function f, we want a polynomial, p,
whose derivatives are the same as the derivatives of f for every order,
at some point a.
Since p is a polynomial (possibly of infinite degree) it must look like:
A word of warning is in order here. p(x) is no longer strictly speaking a polynomial, this is because a polynomial must have finite degree. Rather we should now refer to p(x) as a formal power series, or power series for short. The general theory of formal power series is beyond the scope of this course (see Stewart Chapter 10), however a few comments are in order.
The problem with Formal Power Series is that we can't guarentee convergence of the series for a given value of x.
For example, taking a = 0, and cn = 1 for each n, we get the series
If a power series converges for every value of x within
R of a, i.e. | x - a | < R =>
p(x) converges, then R is called the Radius of
Convergence of the series. Thus q above has a radius of
convergence of R = 1.
If a power series converges for every real number we say that the
radius of convergence is infinite, and write R = infinity.
To get our approximation we require the derivatives of all orders of the power
series p(x) to be equal to those of our given function
f.
Thus setting p(a) = f (a),
p '(a) = f '(a),
p ''(a) = f ''(a), . . . ,
p (n)(a) =
f (n)(a), . . . we get:
p(a) = c0 = f (a)
p'(a) = c1 = f '(a)
p ''(a) = 2 × c2 = f ''(a)
p '''(a) = 3 × 2 × c3 = f '''(a)
.
.
.
p(n)(a) = n! cn =
f (n)(a)
Where f (n)(x) represents the nth derivative, and n! is n factorial, n! = n (n - 1) (n - 2) (n - 3) . . . 3 × 2 × 1.
Putting this together we get Taylor's Theorem.
Taylor's Theorem Given a function f (x) and some point a where f is defined, then
Note that in this case we have equality between the function and the power series. The power series on the right hand side is called the Taylor Series for f at a.
f '(x) = ex, so f (n)(x) = ex for every n. Thus f (n)(0) = e0 = 1. So the Taylor Series for ex is
Thus the Taylor polynomial of degree n of f about a is given by
Note that taking only the first term gives the constant approximation, the first two terms the linear approximation and the first three terms the quadratic approximation.
Consider the following procedure for calculating the n term Taylor series
of a function g(x),
Tn(x), about some point a.
> Taylor := proc(g, x::algebraic, n::integer, a::algebraic)
> local s, i;
> s := 0;
> for i from 0 to n do
> s := s + (D@@i)(g)(a)*(x - a)^i/i!;
> od;
> RETURN(s);
> end;
We can now get Maple to find the first ten terms of the Taylor polynomial for
exp about zero:
> f := x->exp(x);
> Taylor(f, x, 10, 0);
We can also check the accuracy as n increases.
> for i from 1 to 15 do
> [evalf(f(2)), evalf(Taylor(f,2,i,0))];
> od;
Taylor's Formula If f is n + 1 times differentiable on an interval I that conatins a, then for every x in I there is a number z between x and a such that
Note that though the remainder term looks superficialy like the n + 1th term in the Taylor series, the derivative f (n + 1)(z) is evaluated at some point z. The only thing we now about z is that it lies between x and a.
The usual trick is to bound
f (n + 1)(x) on
I.
i.e. f (n + 1)(x) <
M on I
=> Rn(x) <
M/(n + 1)! (x - a)n + 1.
A much more practical rule of thumb is to stop iterating once the difference
between successive approximations becomes small enough.
i.e.
| Tn + 1(x) -
Tn(x) | < stop value.
The difference between successive approximations is exactly equal to the next term in the Taylor series.
Up to Main Lab Page | Next Lesson - Integration | Previous Lesson - Approximating Functions | Top of this Lesson |