13) Series and Sequences

We can find the sum of convergent series.

Consider the geometric series with a=1 and r =1/2. Since |r|<1, it converges, and the sum is

> restart;

> sum(1/(2^k),k = 1 .. infinity)

Consider the p-series with p=2. Since p>1, it converges, and the sum is given by

> sum(1/(k^2),k = 1 .. infinity)

Taylor Series

Mclaurin polynomial of sin(x) near x =0.

> restart;

> with(plots):

> f:=cos(x);

> taylor( f, x=0,10);

they can be ploted sequentially

> for n from 1 by 2 to 10 do

> p[n]:=mtaylor(f,[x=0],n);

> plot({f,p[n]},x=-3..3);

> od;

they can be ploted together

> plot({f,seq(p[n],n=1..5)},x=-3..3,y=-1..1);

Taylor polynomial of e^x near x =1.

> f:=exp(x);

they can be ploted sequentially

> for n from 1 by 1 to 5 do

> p[n]:=mtaylor(f,[x=1],n);

> plot({f,p[n]},x=-3..3);

> od;

they can be ploted together

> plot({f(x),seq(p[n],n=1..5)},x=-1..2);