The Maple notebook is chapter1.mw but you are warned that it may download as a text file.
Maple code for exercises in section 1.2
> | jf := (n, x) -> evalf(4/Pi*sum((-1)^(k-1)*cos((2*k-1)/2*Pi*x)/(2*k-1),k = 1 .. n)); |
> | for n from 1 to 4 do plot(jf(n,x),x = -1 .. 3) end do; |
> | seq([jf(100,v)],v=[0,0.5,0.9,0.99,1.1,2]); |
> | plots[listplot]([seq([n, jf(n,.99)],n = [seq(100+100*i,i = 0 .. 19)])]); |
> | plots[listplot]([seq([n, jf(n,.999)],n = [seq(100+100*i,i = 0 .. 19)])]); |
This command evaluates the sum of the first 10*2^n terms in the given series.
> | [seq(evalf(Sum(1/(2*k-1),k = 1 .. 10*2^n)),n = 0 .. 10)]; |
We denote the sum of the first n terms of this series as
> | z := (n, x, w) -> evalf(4/Pi*sum((-1)^(k-1)*exp(-(2*k-1)*Pi*w/2)*cos((2*k-1)*Pi*x/2)/(2*k-1),k = 1 .. n)); |
and then do a 3-dimensional plot using
> | for n from 1 to 4 do plot3d(z(n,x,w),x = -1 .. 1,w = 0 .. .6) end do; |
The following command will compute the first n terms of the series
> | s := n -> evalf(Sum((-1)^floor(1/2*k-1/2)/(6*floor(1/2*k)+(-1)^(k-1)),k = 1 .. n)); |
> | [seq(s(n),n = 1 .. 20)]; |
The following command will compute the first n terms of the series
> | g := (n, x) -> evalf(2*sum((-1)^i*sin(1/2*(-1+2*i)*Pi*x),i = 1 .. n)); |
> | for n from 10 by 10 to 50 do plot(g(n, x), x = -1 .. 3, y = -10 .. 10, adaptive = false, numpoints = 1000) end do; |
> | [seq(g(n,0),n = 1 .. 20)]; |
> | [seq(g(n,.2),n = 1 .. 20)]; |
> | [seq(g(n,.3),n = 1 .. 20)]; |
> | [seq(g(n,.5),n = 1 .. 20)]; |
> |