MATH 134 -- Intensive Calculus for Science 2

March 21, 2001

Taylor Polynomial Demo

Taylor polynomials for [Maple Math] at [Maple Math]

> p2:=convert(taylor(cos(x),x=0,3),polynom);

[Maple Math]

> p4:=convert(taylor(cos(x),x=0,5),polynom);

[Maple Math]

> p6:=convert(taylor(cos(x),x=0,7),polynom);

[Maple Math]

> plot({cos(x),p2,p4,p6},x=-Pi..Pi);

Here the green graph is [Maple Math] , the yellow graph is [Maple Math] , the blue graph

is [Maple Math] , and the red graph is [Maple Math] . Intuitively, it is clear that the approximation

of [Maple Math] by [Maple Math] is getting better as [Maple Math] increases. We can make this more precise in

the following way. The function [Maple Math] gives the absolute value of the

error in the approximation of [Maple Math] by [Maple Math] . For all [Maple Math] <= x <= [Maple Math] the error for

[Maple Math] is less than .001 = [Maple Math]

> plot(abs(cos(x)-p2),x=-Pi/8..Pi/8);

The error for [Maple Math] on the same interval is much smaller -- at most [Maple Math]

> plot(abs(cos(x)-p4),x=-Pi/8..Pi/8);

Moreover, the interval where the error with [Maple Math] is at most [Maple Math] is larger:

> plot(abs(cos(x)-p4),x=-0.95..0.95);

Similarly with [Maple Math] , the error on this interval is smaller:

> plot(abs(cos(x)-p6),x=-0.95..0.95);

and the interval on which the error with [Maple Math] is at most [Maple Math] gets larger:

> plot(abs(cos(x)-p6),x=-1.6..1.6);

>