11.9 Representing Functions as Power Series

The geometric:

g[x_]=1/(1-x);
f[j_,x_]:=Sum[x^n,{n,0,j}];

Plot[{g[x],f[1,x],f[2,x],f[3,x]},{x,-1,1},PlotStyle->{Black,Blue,Red,Green}]

Plot[{g[x],f[5,x],f[10,x],f[15,x]},{x,-1,1},PlotStyle->{Black,Blue,Red,Green}]

Now look at the difference:

Plot[Abs[g[x]-f[15,x]],{x,-.9,.9}]

Approximating an Integral:

N[Table[(((-1))^n)(((1/2))^(4n+1))/(4n+1),{n,0,5}],10]

approx=Sum[(((-1))^n)(((1/2))^(4n+1))/(4n+1),{n,0,3}]

N[approx,10]