** Next:** About this document ...
**Up:** Labs and Projects for
** Previous:** Labs and Projects for

So far, you have considered series whose terms were constants; for example the geometric series

We can also consider series whose terms are functions. The most important such type of series is the power series or, more generally, The domain of
The Taylor series for *F*(*x*) at *c* is not necessarily equal to *F*(*x*) on
the series's interval of convergence. (See the text, p. 555, for a
counterexample.)
However, if *F*(*x*) can be represented by a power series at *c*, the Taylor
series must be the power series that does so. In practice the Taylor series
does converge to the function for most functions of interest, so that the
Taylor series for a function is an excellent way to work that function.

You have seen that a good strategy for working with infinite sums is to
use a partial sum as an approximation, and to try to get a bound on the size
of the remainder. This leads to the question of whether one can approximate
a given function *F*(*x*) by using a partial sum of its Taylor series, a question
which is answered by Taylor's theorem.

**Theorem** If *f*(*x*) and all its derivatives exist in an open interval
containing *c*, then for each *x* in that interval, we may write

*f*(*x*) = *T*_{n}(*x*)+*R*_{n}(*x*)

Observe that *z*_{n} depends on *x*; hence *R*_{n}(*x*) is not a term of a Taylor
polynomial.

Maple contains a built in function, taylor, for generating Taylor series.
For example, the following maple command generates the first four terms
of the Taylor series for the exponential function about *x*=0.5.

`>taylor(exp(x),x=0.5,4);`

Note the *O*((*x*-0.5)^{4}) term at the end. This term represents the
remainder
function. The third argument of the taylor command corresponds to the order
of the remainder term, not the degree of the Taylor polynomial printed out.
Also, note that the presence of the remainder term prevents the output of
the taylor command from being plotted or manipulated algebraically.

To overcome this obstacle, the CalcP package contains a slightly different command, Taylor (with a capital T). The output of the Taylor command is a polynomial that can be used in other expressions just like any other polynomial:

`>with(CalcP):`

`>Taylor(exp(x),x=0.5,4);`

`>plot(",x=0..1);`

Note that the third argument gives the degree of the Taylor polynomial output (unlike the first command, which gives the degree of the first term omitted).

For this lab, you will probably find the command Taylor to be more useful than the command taylor. We mention the first command because it is a standard Maple command.

A second useful command in the CalcP package is `TayPlot`. This command
generates graphs of a function and several of its Taylor polynomials on the
same plot.

`>TayPlot(cos(x),x=0,{2,4,6},x=-Pi..Pi);`

> plot(abs(sin(x)-Taylor(sin(x),x=0,3)),x=-1..1);

For this example, the tolerance, *Tol*, is about 0.008, which you can
find out by looking at the graph.

Now suppose you were asked to determine the order required so that the Taylor polynomial approximation to had a tolerance of 0.005 on the interval [-1,1]. One simple method for doing this graphically is shown below.

> plot(abs(sin(x)-Taylor(sin(x),x=0,3)),x=-1..1,y=0..0.005);

If you look at the plot, you see that the curve goes out of the plot on the top of the window. This means that the tolerance is not satisfied. If the order is increased to 5, as in the following example, then the curve goes out of the plot on the sides, meaning that the tolerance is satisfied.

> plot(abs(sin(x)-Taylor(sin(x),x=0,5)),x=-1..1,y=0..0.005);

So, by looking at this plot, you can conclude that a Taylor polynomial of degree five would approximate the function for any point in the interval to two decimal point accuracy.

Suppose that you were asked to check that this is true for any point in that interval, say *x* = 1 using the error bound. You would need to show that lies between two values that agree to "at least" two decimal places. This can be done by solving the inequality for . (In this example, *n*=5, *c*=0, *x*=1, and *T _{5}*(1) is the fifth degree Taylor polynomial approximation to evaluated at

So for this example, to maximize the product , we can maximize *g*(*z*) = |*f*^{(n+1)}(*z*)| with respect to *z* over the interval by applying the absolute max/min test to *g*(*z*) and we would have to substitute our only *x* value, *x*=1, into .

The following maple commands show the procedure in verifying the error bound.

> f := x -> sin(x); > g := z -> (D@@6)(f)(z); > a := diff(g(z),z); > b := fsolve(a = 0,z);

Notice that the critical value lies outside the interval in question, so we only need to evaluate *f ^{(6)}*(

> g(0); > evalf(g(1));

So, the maximum in absolute value would be 0.8414709848
and this is the *z* that we can substitute into .

Solution:

Note that this means that is accurate to three decimal places. Remember, that you were guaranteed accuracy to at least two decimal places.

- 1.
- For each of the following functions, give the fifth-order Taylor Polynomial at the point indicated. Then plot the Taylor Polynomial and the function on the same graph, using an interval of length 6 centered at the given point. Label the graph to show which graph is the function and which is the Taylor Polynomial.
- (a)
- about
*x*= 0 - (b)
- about
*x*=1 - (c)
*x*- 4^{6}*x*+2 about^{3}*x*=2- (d)
- about
*x*=-1

- 2.
- Find the 6th degree Taylor polynomial of the function about
*x*=1. Find the Taylor polynomial for about*x*= 1 and explain how this is related to the Taylor polynomial of about*x*=1. - 3.
- Find the degree of the Taylor polynomial of about
*x*=0 that will give an error no greater than 0.05 over the interval . To do this you can plot the absolute value of the difference between the function and the Taylor Polynomial. Verify that this error bound holds for the point in the given interval. HINT : Use the nth degree Taylor polynomial, for the n that you find, to approximate accurate to one decimal place. Then use the error term for this Taylor polynomial to show that . That is, find the value*z*between 0 and such that the error term is maximized (You will need to recall the absolute max/min test). - 4.
- Consider the power series . What
rational function does this power series represent? Plot the function along with the Taylor polynomial of 5th,6th, and 7th degree about
*x*=0 over the following intervals: [0,1], [0,2], [0,3], [0,4]. Describe what happens to the Taylor approximation over larger intervals for higher degree polynomials.

1/30/1998