Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
146 views

#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:

1+12+13+14++1n+1+\frac{1}{2}+\frac{1}{3}+\frac{1}{4}+\cdots+\frac{1}{n}+\cdots

This may be written with summation notation as n=11n\sum_{n=1}^{\infty}\frac{1}{n}

###Partial Sums

How do we carefully define what we mean by an "infinite sum"? We rewrite our sum as a sequence. If this sequence convergest to a number LL, then that is the value of our series. If the sequence diverges, so does our infinte sum. This sequence is called The Sequence of Partial Sums. Given a series n=1an\displaystyle\sum_{n=1}^{\infty}a_n, we define the sequence {Sn}\{S_n\} as follows:

Given a series n=1an\displaystyle\sum_{n=1}^{\infty}a_n, we define a sequence {Sn}\{S_n\} as follows:

Sn=i=1nai=a1+a2+a3++an1+anS_n=\sum_{i=1}^{n}a_i=a_{1}+a_{2}+a_{3}+\cdots+a_{n-1}+a_{n}

SnS_n is called the nth partial sum of the series.

So, the start of the sequence would be:

S1=a1S_{1}=a_{1}S2=a1+a2S_{2}=a_{1}+a_{2}S3=a1+a2+a3S_{3}=a_{1}+a_{2}+a_{3}S4=a1+a2+a3+a4S_{4}=a_{1}+a_{2}+a_{3}+a_{4}


If limnSn\displaystyle\lim_{n\to\infty}S_n exists, then we say the series converges (or is convergent), and we define the sum of the series to be this limit; that is, n=1an=limnSn\sum_{n=1}^{\infty}a_n=\lim_{n\to\infty}S_n


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

###Example 2

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

19=0.11111=110+1102+1103++110n+=n=1110n\frac{1}{9}=0.11111\ldots=\frac{1}{10}+\frac{1}{10^2}+\frac{1}{10^3}+\cdots+\frac{1}{10^n}+\cdots=\sum_{n=1}^{\infty}\frac{1}{10^n}

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.

One of the easiest ways to get a divergent series is if the terms don't approach zero. That is, n=1an\displaystyle\sum_{n=1}^{\infty}a_n diverges if limnan0\displaystyle\lim_{n\to\infty}a_n\ne0.

On the other hand, if limnan=0\displaystyle\lim_{n\to\infty}a_n=0, this is no guarantee that n=1an\displaystyle\sum_{n=1}^{\infty}a_n converges.

###Example 3

Even though limn1n=0\displaystyle\lim_{n\to\infty}\frac{1}{n}=0, 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 1+12+13+14++1n+1+\frac{1}{2}+\frac{1}{3}+\frac{1}{4}+\cdots+\frac{1}{n}+\cdots

Replace 11 with 12\frac{1}{2}, replace 13\frac{1}{3} with 14\frac{1}{4}, replace each of 15\frac{1}{5}, 16\frac{1}{6}, and 17\frac{1}{7} with 18\frac{1}{8}, and so on. What you get is the smaller series

12+12+14+14+18+18+18+18+\frac{1}{2}+\frac{1}{2}+\frac{1}{4}+\frac{1}{4}+\frac{1}{8}+\frac{1}{8}+\frac{1}{8}+\frac{1}{8}+\cdots=12+12+(14+14)+(18+18+18+18)+=\frac{1}{2}+\frac{1}{2}+\left(\frac{1}{4}+\frac{1}{4}\right)+\left(\frac{1}{8}+\frac{1}{8}+\frac{1}{8}+\frac{1}{8}\right)+\cdots=12+12+12+12+=\frac{1}{2}+\frac{1}{2}+\frac{1}{2}+\frac{1}{2}+\cdots

This series diverges, because we can always find a term in the sequence of partial sums greater than any integer multiple of 1/21/2.


Compare this result with this convergent series:

n=11n2=π261.64493406684823\sum_{n=1}^{\infty}\frac{1}{n^2}=\frac{\pi^2}{6}\approx1.64493406684823


[Side note: compare this to the improper integrals 11x\displaystyle\int_1^{\infty}\frac{1}{x} (divergent) and 11x2\displaystyle\int_1^{\infty}\frac{1}{x^2} (convergent). Actually, each series is a left Riemann sum for the corresponding integral.]

###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, n=1an\displaystyle\sum_{n=1}^{\infty}a_n is a geometric series, if there exists a constant rr such that r=an+1an\displaystyle r=\frac{a_{n+1}}{a_n} for all n1n\ge1.

In general, a geometric series has the form n=0arn=a+ar+ar2+ar3+\sum_{n=0}^{\infty}a\cdot r^n=a+a\cdot r+a\cdot r^2+a\cdot r^3+\cdots

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

###Example 4

Consider the geometric series n=012n\displaystyle\sum_{n=0}^{\infty}\frac{1}{2^n}. 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.

i=var('i') @interact def _(n=input_box(default=1,label='n',width=10)): S=sum(1/2^i,i,1,n) print 'The nth partial sum is 1 +',S,'=',1+S.n()
Interact: please open in CoCalc

As nn\to\infty, the partial sums approach 22.

###Sum of a Geometric Series

In general, if r<1|r|<1, then n=0arn=a1r\sum_{n=0}^{\infty}a\cdot r^n=\frac{a}{1-r}

If r1|r|\geq 1, then the series diverges.

[Note: the index must start at 0 for this formula.]

###Example 5

n=035n=3115=154\displaystyle\sum_{n=0}^{\infty}\frac{3}{5^n}=\frac{3}{1-\frac{1}{5}}=\frac{15}{4} (geometric series with a=3a=3 and r=15r=\frac{1}{5})

###Example 6

n=03n5n=1135=52\displaystyle\sum_{n=0}^{\infty}\frac{3^n}{5^n}=\frac{1}{1-\frac{3}{5}}=\frac{5}{2} (geometric series with a=1a=1 and r=35r=\frac{3}{5})

n=035n\sum_{n=0}^{\infty}\frac{3}{5^{n}}
n=var('n') sum(3/5^n,n,0,+Infinity) #Sage can handle infinite sums
15/4
n=33n5n+1\sum_{n=3}^{\infty}\frac{3^n}{5^{n+1}}
sum(3^n/5^(n+1),n,3,+Infinity)
27/250

###Example 7

Find the sum of the geometric series 13+215+475+\displaystyle \frac{1}{3}+\frac{2}{15}+\frac{4}{75}+\cdots.

In this case, a=13a=\frac{1}{3} and r=25r=\frac{2}{5} (how do you know?), so the sum is 1/312/5=59\frac{1/3}{1-2/5}=\frac{5}{9}

Let's find the sum with Sage:

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

###Alternating Series

Suppose that ana_{n} is a decreasing sequence of positive numbers. Then the series n=0(1)nan=a0a1+a2a3+a4a5+\sum_{n=0}^{\infty}(-1)^{n} a_{n}=a_{0}-a_{1}+a_{2}-a_{3}+a_{4}-a_{5}+\cdots is called an an Alternating series. It is known that an alternating series converges if limnan=0\lim_{n\rightarrow \infty}a_{n}=0. The question for us though is what is the value of a convergent alternating series? Unlike geometric series, there is no general formula to use to find the limit value of a series. However, there is a way to estimate how far away our partial sum is from the actual sum. Suppose that our alternating series converges to a sum of SS. The difference between the partial sum SnS_{n} and actual sum is bouned above by the next term in the series,

SSn<an+1.|S-S_{n}|<a_{n+1}.

####Example

Consider the alternating series n=0(1)nn2n+n2\displaystyle \sum_{n=0}^{\infty}(-1)^{n}\frac{n}{2^{n}+n^2}. How many terms in a partial sum are needed to guarantee that our partial sum is within 0.0010.001 of the actual sum?

The non-alternating terms (n2n+n2)\displaystyle \left(\frac{n}{2^{n}+n^2}\right)are positive and have limit of zero. Thus, we know that the partial sum with nn terms is within an+1=n+12n+1+(n+1)2a_{n+1}=\frac{n+1}{2^{n+1}+(n+1)^2} of the actual sum. We need an nn so that an+1=n+12n+1+(n+1)2<0.001a_{n+1}=\frac{n+1}{2^{n+1}+(n+1)^2}<0.001 Then we will compute the partial sum with this many terms, SnS_{n}.

a(n)=(n+1)/(2^(n+1)+(n+1)^2) a(4).n() a(10).n() a(13).n()
0.0877192982456140 0.00507146150299677 0.000844390832328106

Hence, if we take S13S_{13}, this partial sum is within 0.000850.00085 of the actual sum. Thus,

sum(n/(2^n+n^2),n,0,13).n()
1.13060159345371

Therefore, n=0(1)nn2n+n21.13060159\displaystyle \sum_{n=0}^{\infty}(-1)^{n}\frac{n}{2^{n}+n^2}\approx 1.13060159

###Error Estimates using Integration

The integral test can help us show if a series converges or diverges. Moreover, it can give us an estimate on how many terms in a partial sum are needed to approximate the actual sum with a partial sum. Suppose that f(x)f(x) is a positive decreasing function and our series is n=0f(n)\displaystyle \sum_{n=0}^{\infty}f(n). If the series converges, the error between the actual sum SS and the nnth partial sum is satisfies,

SSn<nf(x)dxS-S_{n}<\int_{n}^{\infty}f(x)dx

####Example

Consider the series n=0n2en\displaystyle \sum_{n=0}^{\infty}n^{2}e^{-n}. How many terms in a partial sum are needed to estimate the series sum to within 0.0010.001?

Here f(n)=n2enf(n)=n^{2}e^{-n} is positive and eventually decreasing. We need to find an nn so that,

nx2exdx<0.001\int_{n}^{\infty}x^{2}e^{-x}dx<0.001

Since we know Sage can compute improper integrals, we utilize this.

integral(x^2*e^(-x),x,n,+Infinity) #Gives special function Gamma
gamma(3, n)
N(gamma(3,10))
0.00553879143102315
N(gamma(3,13))
0.000445284893175268

Using S13S_{13} we have an estimate to within 0.00040.0004 of the actual sum.

sum(n^2*e^(-n),n,0,13).n()
1.99201384463502

Example 8 (And Interactive Sums)

Many series are difficult to estimate as they are not alternating series, or don't satisfy the conditions to use the Integral test. We can try to explore the partial sums to see if they give any information. Below is an interact that allow you to quickly look at partial sums and if Sage knows a way to evaluate the actual sum.

Try some series! For example, n=11n\displaystyle \sum_{n=1}^{\infty}\frac{1}{n}, or n=11n3\displaystyle \sum_{n=1}^{\infty}\frac{1}{n^3}, or n=1sin(n)n\displaystyle \sum_{n=1}^{\infty}\frac{sin(n)}{n}, or n=1sin(n)n\displaystyle \sum_{n=1}^{\infty}\frac{|sin(n)|}{n}

@interact def _(a=input_box(default='1/n',label='$a_n$',width=20),ps=input_box(default=1,label='partial sum',width=20),infsum=checkbox(False,label='Infinite sum?')): n=var('n') S=sum(a,n,1,ps) print 'The requested partial sum is',S.n() if infsum: try: S=sum(a,n,1,+Infinity) print 'The sum of the series is', S.n() except ValueError: print 'The series diverges'
Interact: please open in CoCalc

#Series Assignment

###Question 1

Find the sum of the following geometric series using the sum command in Sage and using the formula a1r\displaystyle\frac{a}{1-r} (you should get the same answer).

12+18+132+1128+\frac{1}{2}+\frac{1}{8}+\frac{1}{32}+\frac{1}{128}+\cdots

###Question 2

Consider the alternating series n=2(1)n4(lnn)5\displaystyle \sum_{n=2}^{\infty}(-1)^{n}\frac{4}{(\ln{n})^5}. Use a partial sum to estimate the series value to within 0.0010.001.

###Question 3

Use the sum command to evaluate the infinite sum directly in sage to compute,

n=1sin(n)n\sum_{n=1}^{\infty}\frac{\sin(n)}{n}

###Question 4 Find the 10th, 100th, and 1000th partial sums of the series n=1n!nn\displaystyle\sum_{n=1}^{\infty}\frac{n!}{n^n}. Do you think the series converges?

[Recall n!=n!= factorial(n)]

###Question 5

Consider the series n=1n2+12n4+1\displaystyle \sum_{n=1}^{\infty}\frac{n^{2}+1}{2n^{4}+1}. Use the integral test to estimate the value of this integral using a partial sum to within 0.010.01. Hint: You may want to assign the value of your integral to a function, then evaluate your function to see how big the error is. (The value of the intgral is a large expression.)