> restart;

> with(plots):

Plotting various degree taylor polynomials for the cosine function:

> p0 := x -> 1:

> p1 := x -> 1 - x^2/2:

> p2 := x -> p1(x) + x^4/4!:

> p3 := x -> p2(x) - x^6/6!:

> p4 := x -> p3(x) + x^8/8!:

> p5 := x -> p4(x) - x^10/10!:

> p6 := x -> p5(x) + x^12/12!:

> cosplot:=plot(cos(x),x=-2*Pi..2*Pi,axes=boxed,xtickmarks=[100],ytickmarks=[100],color=black):

> for i from 0 to 6 do

> TaylorPoly[i] := plot(p.i(x),x=-2*Pi..2*Pi,y=-5..5, color=red,axes=boxed,xtickmarks=[100],ytickmarks=[100]):

> od:

> counter := 0:

> for i from 0 to 6 do

> for j from 1 to 30 do

> pic[counter] := display({TaylorPoly[i],cosplot}):

> counter := counter + 1:

> od:

> od:

> N:=counter-1;

[Maple Math]

> display([seq(pic[k],k=0..N)],insequence=true,title=`Successive Taylor polynomials for the cosine function`,scaling=constrained);

[Maple Plot]

>