Infinite Sequences

MAT 229, Fall 2021

Week 9

Supporting materials

If you wish to get a different perspective on the notes below, try either of the following textbook sections.

Stewart’s Calculus
	11.1: Sequences

Boelkins/Austin/Schlicker’s Active Calculus
	8.1: Sequences

Review

Questions

Evaluate (∫_1^∞)(1/(x^π))d x and (∫_1^∞)(1/(x^0.1))d x.

For which exponents p does (∫_1^∞)(1/(x^p))d x converge?

Plot[{x^(-Pi),x^(-1),x^(-.1)},{x,1,3},Filling->Axis,PlotLegends->{"(1/(x^π))","(1/x)","(1/(x^0.1))"}]

Does (∫_1^∞)(1/(x+(x^2)))d x converge?

Plot[{1/x^2,1/(x+x^2)},{x,1,3},Filling->Axis,PlotLabels->Automatic]

Questions

Evaluate (∫_0^1)(1/(x^π))d x and (∫_0^1)(1/(x^0.1))d x.

For which exponents p does (∫_0^1)(1/(x^p))d x converge?

Plot[{x^{-Pi},x^{-1},x^{-.1}},{x,.001,1},Filling->Axis,PlotLegends->{"(1/(x^π))","(1/x)","(1/(x^0.1))"},PlotRange->{0,15}]

Does (∫_0^1)(1/((x^2)-x sin(x)))d x converge?

Plot[{1/x^2,1/(x^2-x Sin[x])},{x,0,1},Filling->Axis,PlotLabels->Automatic]

Approximations

Questions

Use the trapezoid rule to approximate (∫_0^(π^2))cos((Sqrt[x]))d x

f[x_]:=Cos[Sqrt[x]]
a=0.0;
b=Pi^2;
Plot[f[x],{x,a,b}]
true=NIntegrate[f[x],{x,a,b}]

using n=1

LRR=f[a];
RRR=f[b];
trap=(LRR+RRR)/2
error=trap-true

using n=2

npts=2;
deltaX=(b-a)/npts;
LRR=deltaX*Sum[f[a+(i-1)*deltaX],{i,1,npts}];
RRR=deltaX*Sum[f[a+(i-0)*deltaX],{i,1,npts}];
trap=(LRR+RRR)/2
error=trap-true

using n=3

npts=3;
Trap[npts_]:=Module[{deltaX=(b-a)/npts},
LRR=deltaX*Sum[f[a+(i-1)*deltaX],{i,1,npts}];
RRR=deltaX*Sum[f[a+i*deltaX],{i,1,npts}];
trap=(LRR+RRR)/2
]
trap=Trap[npts]
error=trap-true

using n=4

trap=Trap[4]
error=trap-true

What do we expect to happen as we use larger and larger values of n in the trapezoid rule?

npts=10;
traps=Table[{n,Trap[n]},{n,1,npts}];
allplots=ListPlot[{traps},PlotMarkers->{{▲,10}},PlotLegends->{"traps"}];
eplot=ListLinePlot[{{0,true},{npts,true}},PlotLegends->{"exact"}];
Show[allplots,eplot,PlotRange->All]

Questions

A standard way to approximate the square root of a value is as follows. This method was known to the Babylonians, a few thousand years ago.... To approximate (Sqrt[a]):

Make a rough estimate for the value of (Sqrt[a]). Call it the first approximation (Subscript[x, 1]).

The second approximation is (Subscript[x, 2])=0.5((Subscript[x, 1])+(a/(Subscript[x, 1]))).

The third approximation is (Subscript[x, 3])=0.5((Subscript[x, 2])+(a/(Subscript[x, 2]))).

In general, the (n^th) approximation is (Subscript[x, n])=0.5((Subscript[x, n-1])+(a/(Subscript[x, n-1]))).

Use this scheme to find the fourth approximation to (Sqrt[2]) using (Subscript[x, 1])=2.

sqrootImprove[a_,x_]:=0.5(x+a/x)
sqrootIterate[a_,x_,n_]:=If [n>1,sqrootIterate[a,sqrootIterate[a,x,n-1],n-1],sqrootImprove[a,x]]
sqrootImprove[2,2]
sqrootIterate[2,2,1]
sqrootIterate[2,2,2]
sqrootIterate[2,2,3]
sqrootIterate[2,2,4]
exact=Sqrt[2.0]

Do the approximations improve as n gets larger?

npts=10;
sqr=Table[{n,sqrootIterate[2,2,n]},{n,1,npts}];
allplots=ListPlot[{sqr},PlotMarkers->{{▲,10}},PlotLegends->{"approximations"},PlotRange->{1.41,1.42}];
eplot=ListLinePlot[{{0,exact},{npts,exact}},PlotLegends->{"exact"}];
Show[allplots,eplot]

This method is an example of “Newton’s method” (section3.8), which is a very general method for finding roots (zeros) of functions.

Sequences

Definition

A sequence is an infinite list of terms (frequently numbers, but we’ll generalize that!) written in a definite order. We usually start counting from 1:
	(Subscript[a, 1]),(Subscript[a, 2]),(Subscript[a, 3]),…,(Subscript[a, k]),…

Examples

1,2,3,4,5,…

1,(1/2),(1/3),(1/4),(1/5),…

-1,2,-3,4,-5,6,-7,8,…

As an example of a generalization of number sequences, consider Taylor polynomials:
	(Subscript[T, n])(x)=(Underoverscript[Σ, (k=0), n])(((g^((k)))(a))/(k!))(((x-a))^k)
We can talk about the sequence of Taylor polynomials for g(x)=sin(x) about center a=0: {(Subscript[T, 1])(x),(Subscript[T, 2])(x),(Subscript[T, 3])(x),....}. So we can have sequences of functions, too! And we’ll be generalizing other notions of numbers sequences down the road.

Forms

Besides writing a sequence as a list we will also write some sequences

as formulas: for example (Subscript[{(n/(2^n))}, n=1]^∞)={(1/(2^1)),(2/(2^2)),(3/(2^3)),....}

recursively: for example (Subscript[f, 1])=1, (Subscript[f, 2])=1, (Subscript[f, n])=(Subscript[f, n-1])+(Subscript[f, n-2]): {1,1,2,3,5,8,13,21,34,....}

Limits

Frequently, but not always, sequences {(Subscript[a, n])} are lists of approximations that converge to some desired exact values. If the limit of (Subscript[a, n]) as n tends to infinity exists, 
	(lim_(n->∞))(Subscript[a, n]) exists
then we say that the sequence converges; otherwise it diverges.

Questions

Do any of the above sequences converge? If so, to what values?

(Subscript[x, 1])=2, (Subscript[x, n])=0.5((Subscript[x, n-1])+(a/(Subscript[x, n-1])))

1,(1/2),(1/3),(1/4),(1/5),…,(1/n),...

-1,2,-3,4,-5,6,-7,8,…

1,-(1/4),(1/9),-(1/16),(1/25),-(1/36),…

(Subscript[{(n/(2^n))}, n=1]^∞)

(Subscript[f, 1])=1, (Subscript[f, 2])=1, (Subscript[f, n])=(Subscript[f, n-1])+(Subscript[f, n-2])

Techniques (for deciding convergence)

Technique 1

If (Subscript[a, n])=f(n) where f is a real-valued function, then (lim_(n->∞))(Subscript[a, n])=(lim_(x->∞))f(x).

Questions

Find (lim_(n->∞))(n/((n^2)+1)) by evaluation the limit (lim_(x->∞))(x/((x^2)+1)).

For which of the above sequences can you use this technique?

Technique 2

If (lim_(n->∞))|(Subscript[a, n])|=0, then (lim_(n->∞))(Subscript[a, n])= 0.

Question

Does this technique apply to any of the above limits?

For which values of r does the sequence {(r^n)} converge?

Manipulate[
ListPlot[Table[{n,r^n},{n,1,20}],PlotLabel->r]
,{r,-2,2}]

Monotonic sequences

Definition

An increasing sequence is one whose terms (Subscript[a, n]) satisfy (Subscript[a, n+1])⩾(Subscript[a, n]) for all n. It is strictly increasing if we can write (Subscript[a, n+1])>(Subscript[a, n]) for all n.

Similarly, a decreasing sequence is one whose terms (Subscript[a, n]) satisfy (Subscript[a, n+1])≤(Subscript[a, n]) for all n. It is strictly decreasing if we can write (Subscript[a, n+1])<(Subscript[a, n]) for all n.

What is an example of an increasing sequence?

What is an example of an decreasing sequence?

What is an example of a sequence that is neither increasing nor decreasing?

Definition

A sequence that is either increasing or decreasing is said to be monotonic.

Bounded sequences

We’re familiar with bounds from our discussion of errors in numerical integration. There we established a bound on an error -- a value which was certainly larger than the error made in approximating the integral (I think of it as a “tolerance” -- how much slop you’re allowed in an answer!).

What should we mean by a sequence that is bounded above?

(Hopefully you said that there’s a value greater than every entry in the sequence.)

What is an example of a sequence that is bounded above?

What should we mean by a sequence that is bounded below?

What is an example of a sequence that is bounded below?

Definition

A bounded sequence that is bounded above and below.

Technique 3

A bounded, monotonic sequence converges.

You might think this way:  the sequence has to go somewhere -- it’s constantly increasing (say), and yet it can’t go past a certain point -- so it has to go somewhere between where it is at any moment and that upper bound. Furthermore, this is true even as long as the sequence is eventually monotonic. 

You might think this way: no finite chunk of a sequence at the beginning has any impact on convergence. Convergence is a property of the long tail, as the index sails off to infinity.

The same is true for improper integrals, whose domain includes -∞ or ∞: it’s all about the tail. You can rewrite one of these integrals, e.g. (∫_1^∞)(1/(x^p))d x, as (∫_1^b)(1/(x^p))d x + (∫_b^∞)(1/(x^p))d x; the first integral is proper -- no question about its convergence -- while the second is still improper. It’s the “improper part”, no matter what value of b>1.

Questions

Consider the sequence  (Subscript[{(n/(2^n))}, n=1]^∞).

ListPlot[Table[{n,n/2^n},{n,1,10}]]

Is this sequence monotonic?

Is this sequence bounded?

Homework

Weekly assignment 7

IMath problems on sequences