Shared14 - Series Assignment / Series Notes.sagewsOpen in CoCalc
This material was developed by Aaron Tresham at the University of Hawaii at Hilo and is

### Prerequisites:

• Intro to Sage
• Sequences

# Infinite Series

An infinite series is simply an infinite sum of numbers.

## Example 1

The harmonic series is the sum of the reciprocals of the positive integers:

This may be written with summation notation as

The decimal expansion of a real number can be thought of as a series.

## Example 2

In this example, we can see that an infinite sum of numbers may give you a finite answer. Such a series is called convergent.

Of course, many infinite series do not give you a finite sum. Such series are called divergent.

(We'll define these more precisely below.)

One of the easiest ways to get a divergent series is if the terms don't approach zero. That is, diverges if .

On the other hand, if , this is no guarantee that converges.

## Example 3

Even though , the harmonic series diverges. This fact was proved as far back as the 14th century by Oresme. His approach was to compare the harmonic series to a series with smaller terms. If the smaller series diverges, then the harmonic series must as well.

Given

Replace with , replace with , replace each of , , and with , and so on. What you get is the smaller series

This series diverges, since .

Compare this result with this convergent series:

[Side note: compare this to the improper integrals (divergent) and (convergent). Actually, each series is a Riemann sum for the corresponding integral.]

## Partial Sums

Given a series , we define a sequence as follows:

is called the nth partial sum of the series.

## Example 4

Find the 10th and 20th partial sums of the series .

We can use the sum command in Sage, which requires four arguments: sum(expression, index variable, starting value, ending value). Don't forget to declare the index variable first.

Here is the 10th partial sum (I'll convert the answer to a decimal).

%var n
sum((2*n+1)/(3*n^2+9),n,1,10)
N(_)

28771121/20454564 1.40658686247236

Here is the 20th partial sum.

sum((2*n+1)/(3*n^2+9),n,1,20)
N(_)

12139706620041946362/6522879694663705009 1.86109620111088

We define convergence of a series in terms of the sequence of partial sums, .

If exists, then we say the series converges (or is convergent), and we define the sum of the series to be this limit; that is,

If the limit does not exist, then we say the series diverges (or is divergent).

Here is a graph of the first 50 partial sums for .

Notice that the partial sums seem to get bigger and bigger without approaching a limit, which suggests this series diverges.

Sage can handle infinite series. In this case, Sage tells us the series is divergent.

sum((2*n+1)/(3*n^2+9),n,1,Infinity)

Error in lines 1-1 Traceback (most recent call last): File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 995, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/misc/functional.py", line 563, in symbolic_sum return expression.sum(*args, **kwds) File "sage/symbolic/expression.pyx", line 11601, in sage.symbolic.expression.Expression.sum (/projects/sage/sage-7.5/src/build/cythonized/sage/symbolic/expression.cpp:63737) return symbolic_sum(self, *args, **kwds) File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/calculus/calculus.py", line 621, in symbolic_sum return maxima.sr_sum(expression,v,a,b) File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 892, in sr_sum raise ValueError("Sum is divergent.") ValueError: Sum is divergent.

## Example 5

Consider the series .

Here is a graph of the first 50 partial sums of this series. It appears the partial sums are getting larger and larger without bound. This is what we expect, since we saw above that this series diverges.

Sage will also tell us that this series diverges.

sum(1/n,n,1,Infinity)

Error in lines 1-1 Traceback (most recent call last): File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 995, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/misc/functional.py", line 563, in symbolic_sum return expression.sum(*args, **kwds) File "sage/symbolic/expression.pyx", line 11601, in sage.symbolic.expression.Expression.sum (/projects/sage/sage-7.5/src/build/cythonized/sage/symbolic/expression.cpp:63737) return symbolic_sum(self, *args, **kwds) File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/calculus/calculus.py", line 621, in symbolic_sum return maxima.sr_sum(expression,v,a,b) File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 892, in sr_sum raise ValueError("Sum is divergent.") ValueError: Sum is divergent.

## Example 6

Consider the series .

Here is a graph of the first 50 partial sums for this series. Now the partial sums approach a limit around 1.6 (the exact answer is ).

Here is the answer from Sage.

%var n
sum(1/n^2,n,1,Infinity)

1/6*pi^2

## Geometric Series

One common type of series is called a geometric series, because the terms form a geometric sequence (a sequence is geometric if the ratio of successive terms is a constant, called the common ratio).

In other words, is a geometric series, if there exists a constant such that for all .

In general, a geometric series has the form

where is the first term and is the common ratio (note: it is customary to begin geometric series at , although this is not necessary).

## Example 7

Consider the geometric series . Let's look at the partial sums.

I'll use the sum command in Sage: sum(formula, index variable, start, end)

I'm going to separate out the initial 1 (the 0th term) to make the pattern easier to see.

As , the partial sums approach .

Here is a graph of the sequence of partial sums of the series. It appears the limit of the sequence is 2.

## Sum of a Geometric Series

In general, if , then .

If or , then this series diverges.

[Note: the index must start at 0 for this formula. You can also think of it as , and then the index does not matter.]

## Example 8

(geometric series with and )

%var n
sum(3/5^n,n,0,+Infinity)

15/4

## Example 9

(geometric series with and )

%var n
sum(3^n/5^n,n,0,+Infinity)

5/2

## Example 10

Find the sum of the geometric series .

In this case, (first term) and (common ratio , etc.).

So the sum is .

sum(1/3*(2/5)^n,n,0,+Infinity)

5/9
1/3/(1-2/5)

5/9

## Example 11

Let's explore the series using Sage.

Try things like , etc.