P15-Series.mws

High School Modules > Precalculus by Gregory A. Moore

     Series - Finite & Infinite Sums


An exploration of finite and infinite series. Recommended : review sequence module .

[Directions : Execute the Code Resource section first. Although there will be no output immediately, these definitions are used later in this worksheet.]

  0. Code

>    restart; with(plots):

Warning, the name changecoords has been redefined

>    fade := proc( a1,a2,a3,k,n)
local c;
c := COLOR(RGB, a1*k/n, a2*k/n, a2*k/n);
return c;
end:

>    FadePlot := proc( f)
   display( [seq( plot( k*f(x), x = 1..20, filled = true,
             color = fade(.9,.6,.7,k,10)), k = 0..10 )] );
end proc:

  1. Series & Sigma Notation


Sequences are lists of numbers.

>    3*k -2  $  k = 1..20;

1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34, 37, 40, 43, 46, 49, 52, 55, 58

>    ((-2)^k)/ (k^2 + 1) $ k = 1..10;

-1, 4/5, -4/5, 16/17, -16/13, 64/37, -64/25, 256/65, -256/41, 1024/101


When we add up a sequence of numbers, the result is a sum or series. To express a sum in Maple, we can use the
Sum  command (with a capital S). This command writes the sum in sigma notation, but does not compute its value. There are two different ways of computing its value: using the sum  (with a lower case s), and the value  command immediately after the sum  command.

>    Sum( 3*k -2, k = 1..20): % = value(%);

Sum(3*k-2,k = 1 .. 20) = 590

>    Sum( 1/k^2, k = 1..20): % = value(%);

Sum(1/(k^2),k = 1 .. 20) = 17299975731542641/10838475198270720

>    Sum( (3*k)/2^k, k = 1..20): % = value(%);

Sum(3*k/(2^k),k = 1 .. 20) = 3145695/524288


 

  2. Special Series


There a number of "famous" series. It's good to be familiar with these. Some are more famous, some less.

>    `Arithmetic Series`; Sum( a*k + b, k = 1..N);

`Arithmetic Series`

Sum(a*k+b,k = 1 .. N)

>    `Geometric Series`; Sum( a*r^k, k = 1..N);

`Geometric Series`

Sum(a*r^k,k = 1 .. N)

>    `Power Series`;      Sum( 1/z^k, k = 1..N);

`Power Series`

Sum(1/(z^k),k = 1 .. N)

>    `Alternating Series`; Sum( (-1)^k, k = 1..N);

`Alternating Series`

Sum((-1)^k,k = 1 .. N)

>    `Harmonic Series`; Sum( 1/k, k = 1..N);

`Harmonic Series`

Sum(1/k,k = 1 .. N)

>    Sum( 1/k^2, k = 1..N);

Sum(1/(k^2),k = 1 .. N)

>    Sum( 1/k!, k = 1..N);

Sum(1/k!,k = 1 .. N)

>    Sum(((-1)^(k+1))/(2*k)!, k = 1..N);

Sum((-1)^(k+1)/(2*k)!,k = 1 .. N)

>    Sum( 1/n - 1/(n+1), k = 1..N);

Sum(1/n-1/(n+1),k = 1 .. N)


 

  3. Rules of Series


Here are two rules of series.

................ The Distributive Property  .................................................................................................
The distributive property for sums looks like this:  
Sum(c*a[k],k = 1 .. n)    =    c*Sum(a[k],k = 1 .. n) .

>    DistProp :=   Sum( c* a[k] , k = 1..N) = c*Sum(  a[k] , k = 1..N);

DistProp := Sum(c*a[k],k = 1 .. N) = c*Sum(a[k],k = 1 .. N)


We can verify that this rule is valid by computing the left and right sides of this equation, and then see that the results are the same. Let
a[[k]]   = 4k + 9.

>    subs( {a[k] = 4*k+9, c = 13, N = 56}, DistProp );
evalf(%);
testeq( Left = Right);

Sum(52*k+117,k = 1 .. 56) = 13*Sum(4*k+9,k = 1 .. 56)

89544. = 89544.

false

We can see for ourselves that the left and right sides are equal value, but we can ask Maple to verify that the left and right values are the same. Here are some further examples.

>    subs( {a[k] = 1/(k^2 + 2), c = 300, N = 12}, DistProp );
evalf(%);
testeq( Left = Right);

Sum(300/(k^2+2),k = 1 .. 12) = 300*Sum(1/(k^2+2),k = 1 .. 12)

234.4225026 = 234.4225026

false

>    subs( {a[k] = (2*k +1)/k^3, c = -7, N = 30}, DistProp );
evalf(%);
testeq( Left = Right);

Sum(-7*(2*k+1)/k^3,k = 1 .. 30) = -7*Sum((2*k+1)/k^3,k = 1 .. 30)

-30.98073855 = -30.98073855

false




................ The Associative Property  .................................................................................................


Here is the associate property of addition, and some examples of its use.

>    AssocProp :=  Sum( a[k] + b[k]  , k = 1..N)
              = Sum( a[k]  , k = 1..N) + Sum( b[k]  , k = 1..N);

AssocProp := Sum(a[k]+b[k],k = 1 .. N) = Sum(a[k],k = 1 .. N)+Sum(b[k],k = 1 .. N)

>    subs( {a[k]=5*k-7, b[k]=3-11*k, N = 125}, AssocProp);
evalf(%);
testeq( Left = Right);

Sum(-6*k-4,k = 1 .. 125) = Sum(5*k-7,k = 1 .. 125)+Sum(3-11*k,k = 1 .. 125)

-47750. = -47750.

false

>    subs( {a[k] = 8*k + 21, b[k]=13*k - 9, N = 56}, AssocProp );
evalf(%);
testeq( Left = Right);

Sum(21*k+12,k = 1 .. 56) = Sum(8*k+21,k = 1 .. 56)+Sum(13*k-9,k = 1 .. 56)

34188. = 34188.

false

  4. Series Formulas


When adding a constant, there is a simple formula :

>    Sum( 1, k = 1..n): % = value(%);   

Sum(1,k = 1 .. n) = n

>    Sum( C, k = 1..n): % = value(%);

Sum(C,k = 1 .. n) = n*C

>    Sum( 17, k = 1..2000): % = value(%);

Sum(17,k = 1 .. 2000) = 34000



There are formulas to compute the sum of consecutive integers, squares, cubes, etc. You can find many of these formulae in your textbook or a reference book, or let Maple find the formula for you. To get an attractive formula, we will compute the sum, simplify the result, and factor that result.

You might know this formula already. This is the sum of integers : 1 + 2 + 3 + ... + n

>    `Sum of Integers`;
Sum( k, k = 1..n): % = value(%);  
Formula := factor(simplify(%));

`Sum of Integers`

Sum(k,k = 1 .. n) = 1/2*(n+1)^2-1/2*n-1/2

Formula := Sum(k,k = 1 .. n) = 1/2*n*(n+1)

>    subs( { n = 100}, Formula );

Sum(k,k = 1 .. 100) = 5050

>    subs( { n = 2^10}, Formula );

Sum(k,k = 1 .. 1024) = 524800



Here is a formula for the squares of the natural numbers.

>    `Sum of Squares`;  
Sum( k^2, k = 1..n): % = value(%);   
Formula := factor(simplify(%));

`Sum of Squares`

Sum(k^2,k = 1 .. n) = 1/3*(n+1)^3-1/2*(n+1)^2+1/6*n+1/6

Formula := Sum(k^2,k = 1 .. n) = 1/6*n*(n+1)*(2*n+1)

>    subs( { n = 100}, Formula );

Sum(k^2,k = 1 .. 100) = 338350

>    subs( { n = 2^10}, Formula );

Sum(k^2,k = 1 .. 1024) = 358438400


Here are sums of higher powers. Each can be simplified into a simpler form.

>    `Sum of Cubes`;  
Sum( k^2, k = 1..n): % = value(%);   
factor(simplify(%));

`Sum of Cubes`

Sum(k^2,k = 1 .. n) = 1/3*(n+1)^3-1/2*(n+1)^2+1/6*n+1/6

Sum(k^2,k = 1 .. n) = 1/6*n*(n+1)*(2*n+1)

>    `Sum of 4th Powers`;  
Sum( k^2, k = 1..n): % = value(%);   
factor(simplify(%));

`Sum of 4th Powers`

Sum(k^2,k = 1 .. n) = 1/3*(n+1)^3-1/2*(n+1)^2+1/6*n+1/6

Sum(k^2,k = 1 .. n) = 1/6*n*(n+1)*(2*n+1)

Maple is really wonderful at computing the formulas. Here is one for adding eighth powers of integers.

>    `Sum of 4th Powers`;  
Sum( k^8, k = 1..n): % = value(%);   
factor(simplify(%));

`Sum of 4th Powers`

Sum(k^8,k = 1 .. n) = 1/9*(n+1)^9-1/2*(n+1)^8+2/3*(n+1)^7-7/15*(n+1)^5+2/9*(n+1)^3-1/30*n-1/30

Sum(k^8,k = 1 .. n) = 1/90*n*(n+1)*(2*n+1)*(5*n^6+15*n^5+5*n^4-15*n^3-n^2+9*n-3)




Here are some other interesting sums... the squares of odds, cubes of negative odds, 5th powers of negative even numbers, etc. There are formulas for each of these cases!

>    `Sum of Squares of Odd Numbers`;  
Sum( (2*k-1)^2, k = 1..n): % = value(%);   
factor(simplify(%));

`Sum of Squares of Odd Numbers`

Sum((2*k-1)^2,k = 1 .. n) = 11/3*n+8/3-4*(n+1)^2+4/3*(n+1)^3

Sum((2*k-1)^2,k = 1 .. n) = 1/3*n*(2*n-1)*(2*n+1)

>    `Sum of Cubes of Negative Odd Numbers`;  
Sum( (-(2*k-1))^3, k = 1..n): % = value(%);   
factor(simplify(%));

`Sum of Cubes of Negative Odd Numbers`

Sum((-2*k+1)^3,k = 1 .. n) = 6*n+5-11*(n+1)^2+8*(n+1)^3-2*(n+1)^4

-Sum((2*k-1)^3,k = 1 .. n) = -n^2*(-1+2*n^2)

>    `Sum of 5th Powers of Negative Even Numbers`;  
Sum( (-2*k)^5, k = 1..n): % = value(%);   
factor(simplify(%));

`Sum of 5th Powers of Negative Even Numbers`

Sum(-32*k^5,k = 1 .. n) = -16/3*(n+1)^6+16*(n+1)^5-40/3*(n+1)^4+8/3*(n+1)^2

-32*Sum(k^5,k = 1 .. n) = -8/3*n^2*(2*n^2+2*n-1)*(n+1)^2

>    `Sum of Squares of Odd Numbers and Cubes of Evens`;  
Sum( (2*k-1)^2 + (2*k)^3, k = 1..n): % = value(%);   
factor(simplify(%));

`Sum of Squares of Odd Numbers and Cubes of Evens`

Sum((2*k-1)^2+8*k^3,k = 1 .. n) = 11/3*n+8/3-2*(n+1)^2-8/3*(n+1)^3+2*(n+1)^4

Sum(1-4*k+4*k^2+8*k^3,k = 1 .. n) = 1/3*n*(-1+6*n+16*n^2+6*n^3)

>    `Sum of Cubes of an Arithmetic Sequence`;  
Sum( (7*k + 2)^3, k = 1..n): % = value(%);   
factor(simplify(%));

`Sum of Cubes of an Arithmetic Sequence`

Sum((7*k+2)^3,k = 1 .. n) = 15*n+7-77/4*(n+1)^2-147/2*(n+1)^3+343/4*(n+1)^4

Sum((7*k+2)^3,k = 1 .. n) = 1/4*n*(7*n+11)*(49*n^2+77*n+36)

>    `Sum of Cubes of a General Arithmetic Sequence`;  
Sum( (a*k + b)^3, k = 1..n): % = value(%);   
factor(simplify(%));

`Sum of Cubes of a General Arithmetic Sequence`

Sum((a*k+b)^3,k = 1 .. n) = b^3*(n+1)+3/2*b^2*a*(n+1)^2-3/2*b^2*a*(n+1)+b*a^2*(n+1)^3-3/2*b*a^2*(n+1)^2+1/2*b*a^2*(n+1)+1/4*a^3*(n+1)^4-1/2*a^3*(n+1)^3+1/4*a^3*(n+1)^2-b^3
Sum((a*k+b)^3,k = 1 .. n) = b^3*(n+1)+3/2*b^2*a*(n+1)^2-3/2*b^2*a*(n+1)+b*a^2*(n+1)^3-3/2*b*a^2*(n+1)^2+1/2*b*a^2*(n+1)+1/4*a^3*(n+1)^4-1/2*a^3*(n+1)^3+1/4*a^3*(n+1)^2-b^3

Sum((a*k+b)^3,k = 1 .. n) = 1/4*n*(2*b+a+a*n)*(a^2*n^2+a^2*n+2*b*a*n+2*b*a+2*b^2)


 

  5. Infinite Series - Convergence & Divergence


When you add up an infinite number of numbers, you are very like to get infinity as the result.

>    Sum( 3*k - 4, k = 1..infinity);   % = value(%);

Sum(3*k-4,k = 1 .. infinity)

Sum(3*k-4,k = 1 .. infinity) = infinity

However, the result is not necessarily infinite. If the numbers get small quickly enough, the sum may be a finite number.

>    Sum( (4/5)^k, k = 1..infinity);   % = value(%);

Sum((4/5)^k,k = 1 .. infinity)

Sum((4/5)^k,k = 1 .. infinity) = 4


Another strange thing that can occur is a sum that oscillates infinitely.

>    Sum( (-1)^k, k = 1..4):   % = value(%);
Sum( (-1)^k, k = 1..5):   % = value(%);
Sum( (-1)^k, k = 1..400):   % = value(%);
Sum( (-1)^k, k = 1..401):   % = value(%);

Sum((-1)^k,k = 1 .. 4) = 0

Sum((-1)^k,k = 1 .. 5) = -1

Sum((-1)^k,k = 1 .. 400) = 0

Sum((-1)^k,k = 1 .. 401) = -1


When a sum adds up to infinity, negative infinity or oscillates, we say it
diverges . If it gets closer and closer to a particular number we say it converges . Surprisingly, there are many convergent infinite series.

>    Sum( 1/k^2, k = 1..infinity):   % = evalf(value(%));

Sum(1/(k^2),k = 1 .. infinity) = 1.644934068

>    Sum( 1/k!, k = 0..infinity):   % = evalf(value(%));

Sum(1/k!,k = 0 .. infinity) = 2.718281828

>    Sum( 1/exp(k), k = 1..infinity):   % = evalf(value(%));

Sum(1/exp(k),k = 1 .. infinity) = .5819767070

>    Sum( ((-2)^j)/j!, j = 0..infinity):   % = evalf(value(%));

Sum((-2)^j/j!,j = 0 .. infinity) = .1353352832

>    Sum( sin(j)/j!, j = 0..infinity):   % = evalf(value(%));

Sum(sin(j)/j!,j = 0 .. infinity) = 1.279883001


Sometimes it's hard to tell at first. Even if we add 10,000 member of this series, we still have a number less than 10!

>    Sum( 1/k, k = 1..100);   % = evalf(value(%));

Sum(1/k,k = 1 .. 100)

Sum(1/k,k = 1 .. 100) = 5.187377518

>    Sum( 1/k, k = 1..1000);   % = evalf(value(%));

Sum(1/k,k = 1 .. 1000)

Sum(1/k,k = 1 .. 1000) = 7.485470861

>    Sum( 1/k, k = 1..10000);   % = evalf(value(%));

Sum(1/k,k = 1 .. 10000)

Sum(1/k,k = 1 .. 10000) = 9.787606036



However, looks can be decieving. This series actually diverges to infinity.

>    Sum( 1/k, k = 1..infinity);   % = evalf(value(%));

Sum(1/k,k = 1 .. infinity)

Sum(1/k,k = 1 .. infinity) = Float(infinity)


 

  6. Graphs of Series


We can also visualize a series. The orange line shows the sum, while the blue line shows the value of sequence. In this case, being an arithmetic sequence, the sum is getting larger and larger... to infinity.

>    a := k -> 3*k - 2;   

a := proc (k) options operator, arrow; 3*k-2 end proc

>    plot( [a(floor(x)), sum( a(j), j = 1..floor(x))] ,
      x = 1..10, thickness=2, linestyle = [3,1], color = [blue,coral] );

[Maple Plot]

>    plot( [a(floor(x)), sum( a(j), j = 1..floor(x))] ,
      x = 1..30, thickness=2, linestyle = [3,1], color = [blue,coral] );

[Maple Plot]


Now let's look at a geometric series ... which converges. We can see that the series gets larger and larger, but it seems to be leveling out - because the sequence is getting very small, very fast.

>    a := k -> (2/3)^k;

a := proc (k) options operator, arrow; (2/3)^k end proc

>    plot( [a(floor(x)), sum( a(j), j = 1..floor(x))] ,
      x = 1..10, thickness=2, linestyle = [3,1], color = [blue,coral] );

[Maple Plot]

>    plot( [a(floor(x)), sum( a(j), j = 1..floor(x))] ,
      x = 1..30, thickness=2, linestyle = [3,1], color = [blue,coral] );

[Maple Plot]


Here are some other convergent sequences.

>    a := k -> 1/k^2;

a := proc (k) options operator, arrow; 1/(k^2) end proc

>    a := k -> 10*(7/8)^k;

a := proc (k) options operator, arrow; 10*(7/8)^k end proc

>    a := k -> ((-1)^(k+1))/k^(9/8);


Here are some divergent sequences.

>    a := k -> (5 + (-k)*(-1) );            SumPlot(a);

a := proc (k) options operator, arrow; 5+k end proc

[Maple Plot]

>    a := k -> (8/7)^k ;                    SumPlot(a);

a := proc (k) options operator, arrow; (8/7)^k end proc

[Maple Plot]

>    a := k -> (-1)^k ;            SumPlot(a);

a := proc (k) options operator, arrow; (-1)^k end proc

[Maple Plot]


 

  7. Double Sums


A more complicated situation is the double sum - where there is a sum within a sum.

>    S  := Sum( Sum(i^2, i = 1..N), j = 1..M);   
SF := factor( simplify( value(%)));

S := Sum(Sum(i^2,i = 1 .. N),j = 1 .. M)

SF := 1/6*M*N*(N+1)*(2*N+1)

>    subs( {N = 2, M = 3 }, S = SF);

Sum(Sum(i^2,i = 1 .. 2),j = 1 .. 3) = 15

>    subs( {N = 5, M = 10}, S = SF);

Sum(Sum(i^2,i = 1 .. 5),j = 1 .. 10) = 550

>    subs( {N = 50, M = 100}, S = SF);

Sum(Sum(i^2,i = 1 .. 50),j = 1 .. 100) = 4292500


Notice that if we interchanged the two sums, we get different results.

>    S  := Sum( Sum(j^2, j = 1..M), i = 1..N);   
SF := factor( simplify( value(%)));

S := Sum(Sum(j^2,j = 1 .. M),i = 1 .. N)

SF := 1/6*N*M*(M+1)*(2*M+1)

>    subs( {N = 2, M = 3 }, S = SF);

Sum(Sum(j^2,j = 1 .. 3),i = 1 .. 2) = 28

>    subs( {N = 5, M = 10}, S = SF);

Sum(Sum(j^2,j = 1 .. 10),i = 1 .. 5) = 1925

It can also get more complicated if the limit of the inner sum depends on the index of the outer sum. You should try these by hand.

>    S  := Sum( Sum(k^2, k = 1..m), m = 1..M);   
SF := factor( simplify( value(%)));

S := Sum(Sum(k^2,k = 1 .. m),m = 1 .. M)

SF := 1/12*M*(M+2)*(M+1)^2

>    subs( {N = 2, M = 3}, S = SF);

Sum(Sum(k^2,k = 1 .. m),m = 1 .. 3) = 20

>    subs( {N = 5, M = 10}, S = SF);

Sum(Sum(k^2,k = 1 .. m),m = 1 .. 10) = 1210


         © 2002 Waterloo Maple Inc