Infinite Series of Constants with Maple

Copyright 2001, 2002 by James F. Hurley, University of Connecticut Department of Mathematics, Unit 3009, Storrs CT 06269-3009. All rights reserved.

The interactive version of this Maple worksheet is in MSB 203, in the Math 116 course folder. It illustrates the use of Maple to investigate the convergence of series of constants.

Finite Series . Maple's sum command adds finitely many terms. The syntax is

sum(f(n), n = i..j);

where f(n) is the formula for the n th term of the series and the i th through j th terms are added. As an illustration, the following two-command Maple routine evaluates sum(1/(2^n),n = 1 .. 100) .

> sum(1/2^n, n = 1..100):
evalf(%);

1.000000000


The eval(f) command is necessary to obtain output in decimal form. Without it, Maple returns the exact rational sum, for which in this example the numerator and denominator differ only in the final units digit. (Change the colon in the first line to a semicolon to see this.) The presence of all the zeroes indicates rounding.

Infinite Series . Maple accepts infinity as the upper limit of summation, and thus will approximate the sum of a convergent infinite series. Execute the following command to see Maple calculate of the sum of the convergent series sum(1/(4*n^2+1),n = 1 .. infinity) from Exercise 20 of Section 12.3 of Stewart's Calculus , 4th Edition , ITP Brooks/Cole, 1999.

> sum(1/(4*n^2 + 1), n = 1..infinity):
evalf(%);

.3563442876+0.*I


Note that Maple outputs the answer as a complex number with imaginary part 0! Its summation algorithm, which its documentation doesn't specify, apparently uses complex variables in summing infinite series of real constants. How good is its programming? As with Mathematica, you can test that by asking it to sum the divergent harmonic series and see what it outputs:

> sum(1/n, n = 1..infinity ):
evalf(%);

Float(infinity)


Unlike Mathematica, Maple's programming is able to recognize that the series diverges to infinity! The
eval(f) command attempted to convert infinity to a floating-point real number, but of course could not proceed further so printed the amusing value displayed. How can you discern that? Just remove the request to display the answer in decimal form: Maple tries to sum the series symbolically, and actually finds the correct symbol (which, however, means that the series is not convergent):

> sum(1/n, n = 1..infinity );

infinity


By contrast, Maple finds the exact correct sum of the geometric series above, and displays that fact clearly. Execute the following command to confirm that.

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

1