Lab 11

MAT 229, Spring 2021

Today’s lab is designed to summarize a slew of tests for the convergence and approximation of series (with error estimation).  We hope that it will serve as good practice as you prepare for your exam.

Each section describing a test or method features a problem or two appropriate to that method.

Thanks to Roger Zarnowski for the inspiration for this lab.

A. The Divergence Test

If (lim_(k->∞))(Subscript[a, k])≠0 then (Underoverscript[Σ, (k=1), ∞])(Subscript[a, k]) is divergent; alternatively, if (Underoverscript[Σ, (k=1), ∞])(Subscript[a, k]) is convergent, then  (lim_(k->∞))(Subscript[a, k])=0. 

Note: if (lim_(k->∞))(Subscript[a, k])=0, then  (Underoverscript[Σ, (k=1), ∞])(Subscript[a, k]) may be either convergent or divergent -- we don’t know.

Exercises to submit

Suppose that you’re asked to consider the series   (((Underoverscript[Σ, (k=0), ∞])(-1))^(k+1))(1/(sin(k)+2)).

Define the sequence of terms in the series as b(k),then graph the first 21 terms of the sequence using DiscretePlot[b[k],{k,0,20}].

Clear[b]
b[k_]:=(((-1)^(k+1))/(2+Sin[k]))
DiscretePlot[b[k],{k,0,20}]

Use the divergence test to show that the series is divergent.

Since the denominator is bounded between 1 and 3, the terms will never approach zero: |(Subscript[b, k])|≥(1/3). Hence this series diverges by the Divergence Test.

B. Friendly Series (for which (Subscript[S, n]) can be computed in closed form)

Geometric Series:

Series of the form  (Underoverscript[Σ, (k=0), ∞])a (r^k), where r is called the “common ratio”. 
	 (Underoverscript[Σ, (k=0), ∞])a (r^k)=a+a r+a (r^2)+ ....
where a≠0. Then
	 (Subscript[S, n])=(Underoverscript[Σ, (k=0), N])a (r^k)=a+a r+a (r^2)+ ...+a (r^N)=({{{, ({{Na, r=1}, {a ((1-(r^(N+1)))/(1-r)), r≠1}})}})

If |r|≥1 the series diverges, since (lim_(N->∞))(Subscript[S, N]) doesn’t exist. 
If |r|<1 then series converges, since (lim_(N->∞))(Subscript[S, N])=a ((1-0)/(1-r))= (a/(1-r)) .

Note: Geometric series may appear in forms other than the general one shown above, but they can always be converted to that form. In any case, if |r| < 1 the series converges to  ((first term)/(1-r)).

Exercises to submit

1. Compute
	a.  S = (Underoverscript[Σ, (k=0), ∞])3(π^(-k)).

partial=3.0/(1-1/Pi)
Sum[3(π^(-k)),{k,0,Infinity}]
N[%]

b. S = (Underoverscript[Σ, (k=2), ∞])3(π^(-k)) (use the formula in the last line of the summary above)

partial=(3.0/Pi^2)/(1-1/Pi)
Sum[3(π^(-k)),{k,2,Infinity}]
N[%]

c. The error term for a geometric series approximated by a partial sum is also a geometric series! E.g. if we used (Subscript[S, 30]) = (Underoverscript[Σ, (k=0), 30])3(π^(-k)) to approximate the series, what would the error be? (Evaluate it using the strategy of part b.).

partial=(3.0/Pi^31)/(1-1/Pi)
Sum[3(π^(-k)),{k,31,Infinity}]
N[%]

Telescoping series

Telescoping series have terms that look like differences:
	(Underoverscript[Σ, (k=0), ∞])((Subscript[c, k])-(Subscript[c, k+1])) = ((Subscript[c, 1])-(Subscript[c, 2])) + ((Subscript[c, 2])-(Subscript[c, 3])) + .... 
In this case, 
	(Subscript[S, n])=(Underoverscript[Σ, (k=0), N])((Subscript[c, k])-(Subscript[c, k+1]))= (Subscript[c, 1])-(Subscript[c, N+1])
because of the lovely cancellation.

Exercises to submit

This problem was on your weekly homework #7: it’s an example of a telegraphing series. Let’s try it again!

a. Write the first four partial sums of (Underoverscript[Σ, (k=1), ∞])((k/(2^k))-((k+1)/(2^(k+1)))).

Clear[n]
s[n_]:=Sum[((k/(2^k))-((k+1)/(2^(k+1)))),{k,1,n}]
Table[s[k],{k,1,4}]

b. What is the form of (Subscript[S, n])?

s[n]

c. Does the series converge? If so, to what value?

It converges to 1/2.

C. The Integral Test

The Integral Test and p-series:

If f(x) is continuous, positive-valued, and decreasing on [1,∞), and if (Subscript[a, k])=f(k)  for k =1,2,3,...., then the infinite series (Underoverscript[Σ, (k=1), ∞])(Subscript[a, k]) and the improper integral (∫_1^∞)f(x)dx either both converge or both diverge.

p-series: By applying the Integral Test to the function f(x) = (1/(x^p)) , we find that the p-series (Underoverscript[Σ, (k=1), ∞]) (1/(k^p)) is convergent if p > 1 and is divergent if p ≤ 1.

Exercises to submit

Determine whether the following series are convergent or divergent using an integral test:
	1. (Underoverscript[Σ, (k=1), ∞])(1/((k^2)+9))

Integrate[1/(x^2+9),{x,1,Infinity}]

2. (Underoverscript[Σ, (k=1), ∞])((2k)/((((k^2)+16))^2))

Integrate[2x/(x^2+16)^2,{x,1,Infinity}]

3. (Underoverscript[Σ, (k=1), ∞])(1/(k+1))

Integrate[1/(x+1),{x,1,Infinity}] (* Diverges *)

The error term for the Integral Test:

If the Integral Test applies, then when using the nth partial sum (Subscript[S, n]) to approximate the series S = (Underoverscript[Σ, (k=1), ∞])(Subscript[a, k]), the absolute error is bounded by 
	|(Subscript[S, n])-S| ⩽  (∫_n^∞)f(x)dx

Exercises to submit

For those series that are convergent (see above), determine a bound on the absolute error if using the 10th partial sum. 
	1. (Underoverscript[Σ, (k=1), ∞])(1/((k^2)+9))

partial=N[Sum[1/(x^2+9),{x,1,10}]];
true=N[Sum[1/(x^2+9),{x,1,Infinity}]];
error=N[Sum[1/(x^2+9),{x,10+1,Infinity}]];
bound=NIntegrate[1/(x^2+9),{x,10,Infinity}];
{partial,true,error,Abs[partial-true],bound}

2. (Underoverscript[Σ, (k=1), ∞])((2k)/((((k^2)+16))^2))

partial=N[Sum[2x/(x^2+16)^2,{x,1,10}]];
true=N[Sum[2x/(x^2+16)^2,{x,1,Infinity}]];
error=N[Sum[2x/(x^2+16)^2,{x,10+1,Infinity}]];
bound=NIntegrate[2x/(x^2+16)^2,{x,10,Infinity}];
Re[{partial,true,error,Abs[partial-true],bound}]

3. (Underoverscript[Σ, (k=1), ∞])(1/(k+1))

Diverges

D. Comparison tests

Direct comparison test

If 0<(Subscript[a, k])≤(Subscript[b, k]) for all k and (Underoverscript[Σ, (k=1), ∞])(Subscript[b, k]) is convergent, then so is (Underoverscript[Σ, (k=1), ∞])(Subscript[a, k]). (If the “larger” series is convergent, then so is the “smaller” one.)

If you think a series converges, this test would be applied by finding a known convergent series with terms (Subscript[b, k]) in order to prove convergence of the series that has terms (Subscript[a, k]).

If you have an error estimate to apply in approximating (Underoverscript[Σ, (k=1), ∞])(Subscript[b, k]) with partial sum (Underoverscript[Σ, (k=1), N])(Subscript[b, k]), the error in approximating (Underoverscript[Σ, (k=1), ∞])(Subscript[a, k]) with partial sum (Underoverscript[Σ, (k=1), N])(Subscript[a, k]) will be less than or equal to that same error estimate.

Limit comparison test

If (Underoverscript[Σ, (k=1), ∞])(Subscript[a, k]) and (Underoverscript[Σ, (k=1), ∞])(Subscript[b, k]) are series of positive terms and if (lim_(k->∞))((Subscript[a, k])/(Subscript[b, k])) is a positive real number (not 0 and not ∞) then either both series converge or both series diverge.

We may sometimes be able to draw a conclusion even if the limit is 0 or ∞.

If (lim_(k->∞))((Subscript[a, k])/(Subscript[b, k]))=0 and (Underoverscript[Σ, (k=1), ∞])(Subscript[b, k]) is convergent, then so is (Underoverscript[Σ, (k=1), ∞])(Subscript[a, k]).

If (lim_(k->∞))((Subscript[a, k])/(Subscript[b, k]))=∞ and (Underoverscript[Σ, (k=1), ∞])(Subscript[b, k]) is divergent, then so is (Underoverscript[Σ, (k=1), ∞])(Subscript[a, k]).

Exercises to submit

For each of the following series, find a series to make a direct comparison to. If it converges, approximate it with a partial sum so that the error is less than 0.0001.

(Underoverscript[Σ, (k=1), ∞])((2k-1)/((k^4)+3k))

(Underoverscript[Σ, (k=1), ∞])((6(Sqrt[k])-5)/(3k-2))

For each of the following series, find a known series to compare it to using the limit comparison test. Based on the comparison determine if the given series converges or not.

(Underoverscript[Σ, (k=1), ∞])(((2^k)+k)/(4(k^2)+(3^k)))

(Underoverscript[Σ, (k=1), ∞])((3k+5)/(4(k^2)-3))

E. Alternating series

Alternating series test

Consider (((Underoverscript[Σ, (k=1), ∞])(-1))^(k+1))(Subscript[b, k])=(Subscript[b, 1])-(Subscript[b, 2])+(Subscript[b, 3])-(Subscript[b, 4])+…, where (Subscript[b, k])>0 for all k. If both

(lim_(k->∞))(Subscript[b, k])=0, and

the individual terms (Subscript[b, k]) are eventually decreasing, (Subscript[b, k])≥(Subscript[b, k+1]) for all k≥M for some M (remember it is all about the tails)

then the alternating series (((Underoverscript[Σ, (k=1), ∞])(-1))^(k+1))(Subscript[b, k]) converges. (The same holds for (((Underoverscript[Σ, (k=1), ∞])(-1))^k)(Subscript[b, k]).)

Note:

Verification of the inequality in (2) is usually accomplished in one of two ways.

By algebraic simplification (cross multiplying, etc.).

Or by identifying a function f for which (Subscript[b, k])=f(k) and showing f'(x)<0.

Alternating series error bounds

Consider the alternating series (((Underoverscript[Σ, (k=1), ∞])(-1))^(k+1))(Subscript[b, k]). Suppose the alternating series test is applicable so that the series converges. Approximate the infinite series (((Underoverscript[Σ, (k=1), ∞])(-1))^(k+1))(Subscript[b, k]) with the partial sum (((Underoverscript[Σ, (k=1), N])(-1))^(k+1))(Subscript[b, k]). Then the absolute error is
	|(((Underoverscript[Σ, (k=1), ∞])(-1))^(k+1))(Subscript[b, k])-(((Underoverscript[Σ, (k=1), N])(-1))^(k+1))(Subscript[b, k])|=(Subscript[b, N+1])-(Subscript[b, N+2])+(Subscript[b, N+3])-(Subscript[b, N+4])+…
						≤(Subscript[b, N+1])
The error is bounded by the size of the first neglected term.

Exercises to submit

For each of the following series, determine if the alternating series applies or not. If it does apply so that the series converges, approximate it with error less than 0.0001. If it does not apply, say so and determine convergence or divergence by some other means.

(((Underoverscript[Σ, (k=1), ∞])(-1))^(k+1))(k/((k^4)+1))

(((Underoverscript[Σ, (k=1), ∞])(-1))^(k+1))(k/(3k-1))

Next week we will see that cos(x)=(((Underoverscript[Σ, (k=0), ∞])(-1))^k)((x^(2k))/((2k)!)) which is an alternating series.

Use the alternating series error bound to determine N in the partial sum (((Underoverscript[Σ, (k=0), N])(-1))^k)((x^(2k))/((2k)!)) to approximate cos(1) with error less than 0.0001.

Compute that partial sum and compare it to Mathematica’s decimal value for cos(1). What is the actual error?