>a1[n]:=n->3-n^(-1); >a2[n]:=n->n; >seq(a1[n](i),i=1..10); >seq(a2[n](i),i=1..10);Note that the i in the seq command is there to list the range of integers.
>plot([[k,a1[n](k)]$k=1..10],style=point); >plot([[k,a2[n](k)]$k=1..10],style=point);Remember to use the point style as it is a sequence and only the integers are used in the domain, i.e. don't connect the dots.
A series is a sum of the terms of a sequence.
>S1:=m->sum(a1[n](j),j=1..m); >S2:=m->sum(a2[n](j),j=1..m); >S1[m](1);This is the sum of the first term.
>S1[m](2);This is the sum of the first and second term.
>S2[m](1); >S2[m](2); >S2[m](3); >S2[m](4);The sequence of sums therefore would be:
>seq(S1[m](i),i=1..10);Does this sequence of sums converge?
>plot([[k,S1[m](k)]$k=1..10],x=0..10,y=0..30,style=point);Looks like it is divergent.
>seq(S2[m](i),i=1..10);This is a sequence of sums, you can check the sequence terms from the begining of the lab to understand the sum.
>plot([[[k,S2[m](k)]$k=1..10],x=0..10,y=0..60,style=point);It looks divergent. To check, first find the
>b2[n]:=n->n*(n+1)/2;Check b2 is correctly written by comparing to the sum of sequences above.
>seq(b2[n](i),i=1..10);This is the same output. Now that the correct function is obtained, find its limit. (Note: this function is often given to you so you don't have to examine the pattern and figure it out yourself)
>limit(b2[n](n),n=infinity);The infinite series diverges because the limit of the sequence of partial sums diverges.
There are many tests for convergence of series. Given
>f:=x->1/(x^4+4)^(1/3); >Sn:=n->sum(f(i),i=1..n); >Sn(1);Sn(2);Sn(5); >evalf(Sn(5)); >plot([seq[k,Sn(k)],k=1..50)],style=point);It is, however the infinite series we are concerned with. To test its convergence the integral test will be used. To use this test the function must be continuous, positive, and nonincreasing. A plot will show this.
>plot(f(x),x=1..100);As the function satisfies the conditions, the integral test is as follows
>evalf(int(f(x),x=1..infinity);Therefore the series is convergent.