CoCalc is a real-time collaborative commercial alternative to JupyterHub and Overleaf that provides Jupyter Notebooks, LaTeX documents, and SageMath.
CoCalc is a real-time collaborative commercial alternative to JupyterHub and Overleaf that provides Jupyter Notebooks, LaTeX documents, and SageMath.
Aaron Tresham Calculus Materials - Feb 2018 snapshot
licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
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).
Here is the 20th partial sum.
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.
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.
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.
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 )
Here's the answer from Sage.
Example 9
(geometric series with and )
Here's the answer from Sage.
Example 10
Find the sum of the geometric series .
In this case, (first term) and (common ratio , etc.).
So the sum is .
Here's the answer from Sage.
Example 11
Let's explore the series using Sage.
Try things like , etc.