Chapter 10 	Infinite Series

10.1 Sequences

Students should read Section 10.1 of Rogawski’s Calculus [1] for a detailed discussion of the material presented in this section.

Recall that a sequence is a function whose domain is the set of non-negative integers.

In Mathematica, we denote a sequence (Subscript[a, n]) as a function. Thus, instead of (Subscript[a, n  ])we write a(n). The limit of a sequence is evaluated by using the Limit command. When Limit[a[n], n->∞] is evaluated, Mathematica automatically assumes that n is a continuous variable (instead of a discrete variable). It employs various techniques to evaluate limits.

To plot the graph of a sequence, we use the ListPlot command. ListPlot[list] plots the graph of list, where list is a list of points (x,y), denoted in Mathematica by {x,y}. In our case, list will be the table of values of the form {n,a[n]}.  The corresponding plot command in this case would be ListPlot[Table[{n,a[n]},{n,min,max}].

Example 10.1.  Consider the sequence defined by

(Subscript[a, n])=((4n+1)/(3n+2))

a) Find the first few terms of the sequence.

b) Plot the graph of the sequence.

c) Make a conjecture for the limit based on the graph.

d) Find the limit of the sequence.

Solution:

a) We define the sequence as a function of n and use the Table command to generate the first ten terms of the sequence.

Clear[a,n]
a[n_]:= ((4 n+1)/(3 n+2))

TableForm[Table[{n,a[n]},{n,1,10}],
TableHeadings->{{},{"n","(Subscript[a, n])"}}]

To obtain decimal expressions of these values, we evaluate

TableForm[N[Table[{n,a[n]},{n,1,10}]],
TableHeadings->{{},{"n","(Subscript[a, n])"}}]

b) To plot the graph of the sequence, we use the ListPlot command. Here is a plot of the first 100 terms of the sequence.

ListPlot[Table[{n, a[n]}, {n, 1, 100}]]

c) The graph suggests that the limit is 1.333....  We can use the Table command to see this more clearly.

TableForm[N[Table[{n,a[n]},{n,1000,10000,1000}]],
TableHeadings->{{},{"n","(Subscript[a, n])"}}]

Hence, the limit seems to be 1.3333... or 4/3. Here is a plot of y=4/3 and the graph of the sequence for large values of n:

Clear[plot1,plot2]
plot1=ListPlot[Table[{n, a[n]}, {n, 1, 1000,10}]];
plot2=Plot[4/3, {x, 1, 1000}];
Show[plot1, plot2,PlotRange->{1.25,4/3}]

d) Finally, we confirm this in Mathematica by evaluating the limit as n goes to ∞.

Limit[a[n],n->Infinity]

Example 10.2.  Consider the sequence defined by

(Subscript[a, n])=((((-1))^n)/n)

a) Plot the graph of the sequence.

b) Does the sequence converge?

Solution:

a) Again, we use ListPlot to plot the graph.

Clear[a,n] 
a[n_]:=((((-1))^n)/n)

ListPlot[Table[{n, a[n]}, {n, 1, 100}]]

b) From the graph, it is clear that the sequence approaches 0 in the limit. We confirm this using the Limit command.

Limit[a[n],n->Infinity]

NOTE: There are instances where the sequence (Subscript[a, n]) may not be well-defined if n  is treated as a real variable (as opposed to an integer variable). In such cases, Mathematica may return the limit unevaluated or else gives an output that indicates the limit may not exist, as the following example illustrates.

Example 10.3.  Determine whether or not the sequence defined below converges:

(Subscript[a, n])=(((-1))^n)(n/(n+1))

Solution: First, we will plot the graph of the sequence.

Clear[a,n]
a[n_]:=(((-1))^n)(n/( n+1))

ListPlot[Table[{n, a[n]}, {n, 1, 100}]]

The graph clearly indicates the sequence does NOT converge (to a unique limiting value). We can see this by investigating the following tables of values. The first one lists the even terms while the second one lists the odd terms of the sequence.

TableForm[Table[{n,N[a[2n]]},{n,10,100,10}],
TableHeadings->{{},{"n","(Subscript[a, 2n])"}}]

TableForm[Table[{n,N[a[2n-1]]},{n,10,100,10}],
TableHeadings->{{},{"n","\!\(\*Cell[TextData[Cell[BoxData[
FormBox[
SubscriptBox["a", 
RowBox[{
RowBox[{"2", "n"}], "-", "1"}]], TraditionalForm]]]]]\)"}}]

Finally, let us evaluate the limit.

Limit[a[n],n->Infinity]

This output, specifically the notation Interval[{0, π}], means that the limit does not exist uniquely, but has subsequences whose limits take on the set of complex values (e^(2i x)) for all x∈[0,π].  This is because the variable n that appears in the Limit command is automatically assumed by Mathematica to be a complex variable.  In our case, for n an integer variable, we have two subsequences, (Subscript[a, 2n]) and (Subscript[a, 2n+1]) (even and odd, respectively), converging to different limits (1 and -1, respectively).  Thus, (Subscript[a, n]) diverges.

Example 10.4.  Consider the sequence {(Subscript[a, n])} defined recursively by (Subscript[a, 1])=1 and (Subscript[a, n+1])=(Sqrt[(Subscript[a, n])+1]).  Generate the first ten terms of this sequence and compute its limit.

Solution: Here is one method of defining a recursive sequence.

Clear[a,n]
a[1]=1
a[n_]:=a[n]=Sqrt[a[n-1]+2]

NOTE: The second occurrence of a[n] in the preceding command tells Mathematica to store all intermediate values of the recurrence in evaluating a[n].

Here are the first ten terms of the sequence:

TableForm[Table[{n,a[n]},{n,1,10}],
TableHeadings->{{},{"n","(Subscript[a, n])"}}]

The following table gives decimal expressions of the same first ten terms and reveals the limit to be equal to 2.

TableForm[Table[{n,N[a[n]]},{n,1,10}],
TableHeadings->{{},{"n","(Subscript[a, n])"}}]

NOTE: In general, Mathematica is not able to directly compute limits of sequences defined recursively.  Assuming (Subscript[a, n]) converges (prove this!), we then compute its limit, called L, say, by letting n->∞ in the recurrence formula for (Subscript[a, n]):

L=(lim_(n->∞))(Subscript[a, n])=(lim_(n->∞))(Sqrt[(Subscript[a, n-1])+2])=(Sqrt[(lim_(n->∞))(Subscript[a, n-1])+2])=(Sqrt[L+2])

Solving the equation L=(Sqrt[L+2]) then yields L=2 as the limit.

Solve[L==Sqrt[L+2],L]

Example 10.5.  Let (Subscript[a, 1])=1 and (Subscript[b, 1])=(Sqrt[2]).  Define two sequences recursively by

(Subscript[a, n+1])=(Sqrt[(Subscript[a, n])(Subscript[b, n])])  and (Subscript[b, n+1])=(((Subscript[a, n])+(Subscript[b, n]))/2)

a) Choose various values of (Subscript[a, 1]) and (Subscript[b, 1]) and calculate the first ten terms of the sequences {(Subscript[a, n])} and {(Subscript[b, n])}.

b)  Show that (Subscript[a, n])≤(Subscript[b, n]) for every positive integer n.

c) Show that both sequences converge to the same limit.  (NOTE: This common limit is called the arithmetic-geometric mean of (Subscript[a, 1])and (Subscript[b, 1]).)

Solution:

a) Here is a program that generates the first ten values of (Subscript[a, n]) and (Subscript[b, n]).

Clear[a,b,n]
a[1]=1
b[1]=10
a[i_]:= a[i]= (Sqrt[a[i-1]*b[i-1]]) ;
b[i_]:= b[i]= ((a[i-1]+b[i-1])/2) ;

TableForm[Table[{k,N[a[ k],10],N[b[ k],10]},{k, 1, 10} ],
TableHeadings->{{},{"n","a[n]","b[n]"} }]

b) The following table suggests that (Subscript[a, n])≤(Subscript[b, n]) for at least the first ten terms:

TableForm[Table[{k,N[a[ k],10],N[b[ k],10],N[b[k],10]-N[a[k],10]},{k, 1, 10} ],
TableHeadings->{{},{"n","a[n]","b[n]","b[n]-a[n]"} }]

For a better feel on this, let us plot the graphs on the same axes. To this end, we define two lists using the Table command and use the ListPlot command to plot the graphs.

plot1=ListPlot[Table[{k,a[k]},{k,1,10}],PlotStyle->{Blue}];
plot2=ListPlot[Table[{k,b[k]},{k,1,10}],PlotStyle->{Red}];
Show[plot1,plot2,PlotRange->{0,10}]

The above graph suggests that the two sequences converge to the same limit.  Unfortunately, Mathematica's Limit command cannot help us compute the limit of (Subscript[a, n]) and (Subscript[b, n]) due to their recursive nature. (Try this!)

NOTE: We encourage the reader to experiment with different initial values for (Subscript[a, 1]) and (Subscript[b, 1]) to see if the sequences (Subscript[a, n]) and (Subscript[b, n]) always converge to the same limit.

Example 10.6.  Consider the sequence

(Subscript[a, n])=((((n!))^(1/n))/n)

a) Show that if  (Subscript[b, n])=ln (Subscript[a, n]), then (Subscript[b, n])=((ln (n!)-n ln n)/n).

b)  Does (Subscript[b, n]) converge? If so, find the limit.

c)  Does (Subscript[a, n]) converge? If so, find the limit.

Solution:

a)  We define a sequence (Subscript[c, n])=((ln (n!)-n ln n)/n) and then show that (Subscript[b, n])=(Subscript[c, n]).

Clear[a,b,c]
a[n_]:=((((n!))^(1/n))/n)
b[n_]:=Log[a[n]]

c[n_]:=((Log[ n!]-n Log[n])/n)

TableForm[Table[{N[c[n]],N[b[n]],N[c[n],10]-N[b[n],10]}, {n, 2, 10}],
TableHeadings->{Automatic,{" (Subscript[c, n])"," (Subscript[b, n])"," (Subscript[c, n])-(Subscript[b, n])"}}]

The preceding table indicates that the two sequences are the same.  Here is a plot of both:

ListPlot[{Table[{n,b[n]}, {n, 1, 100}],Table[{n,c[n]}, {n, 1, 100}]},PlotRange->{-1,0.1},AxesOrigin->{0,0}]

This plot clearly shows that (Subscript[b, n])=(Subscript[c, n]), that is, ln((Subscript[a, n]))=ln(((((n!))^(1/n))/n))=((ln (n!)-n ln n)/n).  We leave it to the student to establish this equality using properties of the natural logarithmic function.

b) The previous plot indicates that the limit of (Subscript[b, n]) is -1.  To confirm this, we use the Limit command.

Limit[b[n], n->Infinity]

c) Since (Subscript[b, n])=ln ((Subscript[a, n])), it follows that (Subscript[a, n])=(e^(Subscript[b, n])) and hence (lim_(n-> ∞))(Subscript[a, n])=(e^(-1)).  Again, we verify this using the Limit command:

Limit[a[n], n->Infinity]

Exercises

In Exercises 1 though 3, determine the convergence of the given sequence. 
1.  (Subscript[a, n])=((3(n^2)+n+2)/(2(n^2)+1))			2. (Subscript[a, n])=ln(((2n+3)/(n+1)))	 			3. (Subscript[a, n])= (n^(1/n))

4.  Let   (Subscript[c, n])=(1/(n+1))+(1/(n+2))+(1/(n+3))+ ... + (1/(2n)).

a.  Find the first ten terms of the sequence.
b.  Plot the graph of the sequence.
c.  Is the sequence increasing? Bounded? Convergent? Prove each of your assertions.
d.   Find (lim_(n-> ∞))(Subscript[c, n]).

5. The nth harmonic number is defined to be the sum

(Subscript[H, n])=1+(1/2)+(1/3)+ ... + (1/n).

Let  (Subscript[a, n])=(Subscript[H, n])-ln n and (Subscript[b, n])=(∫_1^(n+1  )) (1/x)  dx.

a.  Show that (Subscript[H, n])≥(Subscript[b, n]) for n=1,2,3,...,10.  Prove that this holds for all positive integers n.

b.  Show that (Subscript[a, n])≥0 for n=1,2,3,...,10.  Prove that this holds for all positive integers n.

c.  Use the ListPlot command to plot the graph of (Subscript[a, n]).  Does the graph indicate that (Subscript[a, n]) is decreasing or increasing?

d.  Evaluate (lim_(n-> ∞))(Subscript[a, n]).

e.  The limit in part d) is called Euler's Constant and is denoted by γ. Compute γ accurate to 20 digits.

10.2  Infinite Series

Students should read Section 10.2-10.3 of Rogawski's Calculus [1] for a detailed discussion of the material presented in this section.

10.2.1 Finite Sums

Sum[a[n], n, n1, n2] evaluates the finite sum of (Subscript[a, n]) as n goes from (Subscript[n, 1]) to (Subscript[n, 2]).  
Sum[a[n], n, n1, Infinity] evaluates the infinite series of (Subscript[a, n]) as n goes from (Subscript[n, 1]) to ∞.

Using the BasicMathInput Palette, we can also enter finite sums or infinite series as (∑_(n=n1)^n2)a[n] or (∑_(n=n1)^∞)a[n], respectively.

Example 10.7.  Compute the following finite sums:

a) (∑_(n=1)^10)((((-1))^n)/n)		b)  (∑_(k=1)^5)(k-1)(k+1)

c) (∑_(k=1)^30) (({{20}, {k}}))(2^k)	d)  (∑_(i=1)^n)(3i-2)	e)  (∑_(k=0)^10)(((k^2)+1)/((k^3)+2(k^2)+1))

Solution:

a)

(∑_(n=1)^10)((((-1))^n)/n)

b)

Sum[(k+1)(k-1), {k, 1,5}]

c) The binomial coefficient (({{n}, {m}}))=((n!)/(m!(n-m)!)) is expressed in Mathematica by the command Binomial[n, m].

(∑_(k=0)^30)Binomial[30,k] (2^k)

NOTE: The above number is the same as (3^30)=205891132094649. Verify this!

d)

(∑_(j=1)^n) (3j-2)

Simplify[%]

e)

(∑_(k=0)^10)(((k^2)+1)/((k^3)+2(k^2)+1))

10.2.2  Partial Sums and Convergence

Example 10.8.  Consider the series (∑_(n=1)^∞)(1/(4(n^2)-1)).   Let (Subscript[s, n ])denote its nth partial sum.

a)  Find (Subscript[s, 100]). 		
b)  Compute every 10th partial sum up to n=100.
c)  Compute every 1000th partial sum up to n =10,000.
d)  From the tables of values in parts a) and b) what do you infer about the convergence of the series?  Prove your assertion.

Solution:

a) First, we define (Subscript[s, n]) in Mathematica and then evaluate (Subscript[s, 100]).

Clear[s,n]
s[n_]:= (∑_(j=1)^n)(1/(4(j^2)-1))
s[100]

N[%]

b) Here, we use the command Table[s[n],{n,1,J,K}], which gives the list of every K-th value of (Subscript[s, n]), as n goes from 1 to J.  The command TableForm[N[Table[s[n],{n, 1, J, K }]]] lists the values in column form.

Table[s[n],{n,1,100,10}]

N[%]

TableForm[Table[{n,N[s[n]]},{n,10,100,10}],
TableHeadings->{{}, {"n", "(Subscript[s, n])"}}]

c)

TableForm[Table[{n,N[s[n]]},{n,1000,10000,1000}],
TableHeadings->{{}, {"n", " (Subscript[s, n])"}}]

d) It seems that the partial sums converge to 0.5. We  confirm this by evaluating

Limit[s[n], n->∞]

Can you prove this?  Hint: Use the method of partial fractions to decompose this series into a telescoping series as discussed in your calculus text.

Example 10.9.  Let (Subscript[s, n ])be the nth partial sum of the harmonic series

(∑_(k=1)^∞)(1/k).

a)  Find   (Subscript[s, 100]). 		
b)  Compute every 1000th partial sum up to n =10,000
c)  Plot the graphs of the partial sums.
d)  From the table of values in part (b) what do you infer? Prove your assertion.

Solution:  We will follow the method of the preceding example.  First, we define the nth partial sum.

Clear[s,n]
s[n_]:=Sum[1/k,{k, 1, n}]

a) Then (Subscript[s, 100]) is given by

s[100]

N[%]

b) Here is a table of values of every 1000th term in the sequence (Subscript[s, n]) for n less than or equal to 10, 000.

TableForm[Table[{n,N[s[n]]},{n,1000,10000,1000}],
TableHeadings->{{}, {"n", " (Subscript[s, n])"}}]

c) Here is a plot of (Subscript[s, n]).

ListPlot[Table[{n,s[n]},{n,1, 300,20}]]

The graph above indicates a slow growth that makes it difficult to reach a definitive conclusion regarding the convergence of the harmonic series.

d) The table in b) and the plot in c) both suggest that the sequence of the partial sums is increasing. To convince ourselves of this, we compare (Subscript[s, (2^n)]) and (n/2).

TableForm[Table[{n/2.,N[s[(2^n)]]},{n,1,10}],
TableHeadings->{{}, {"(n/2)", " (Subscript[s, (2^n)])"}}]

This table suggests that (Subscript[s, (2^n)])≥(n/2) for n≥2.  Use this fact (a proof of it can be found in your calculus text) to establish the divergence of the harmonic series.

Example 10.10.  Determine whether the following series converges or diverges.

a)   (∑_(n=1)^∞)((((-1))^n)/(n^2))		b)  (∑_(j=1)^∞)((j-1)/j)		c)  (∑_(n=1)^∞)((1/(Sqrt[n]))-(1/(Sqrt[n+1])))		d)  (∑_(n=1)^∞)(ln(n+1)-ln n)

Solution: In all cases, we let Mathematica attempt to evaluate the infinite sum. For those cases where Mathematica returns a numeric output, this is understood to mean that the series converges and that the sum of the series is the given value.

a)

(∑_(n=1)^∞)((((-1))^n)/(n^2))

Thus, the series converges to -((π^2)/12). To see this graphically, we plot the graph of the partial sums of the series using the ListPlot command, along with the horizontal line representing its sum s=-((π^2)/12)≈-0.822467.

Clear[s,n]
s[n_]=(∑_(k=1)^n)((((-1))^k)/(k^2));

plot1=ListPlot[Table[{n,s[n]}, {n, 1, 100}]];
plot2=Plot[-((π^2)/12), {x, 1, 100}];
Show[plot1, plot2]

b) Observe that (lim_(j->∞))((j-1)/j)=1≠0.  Hence, the series does not converge according to the Test for Divergence. This explains the following output message from Mathematica if we attempt to evaluate the series.

(∑_(j=1)^∞)((j-1)/j)

c) Since this is a telescoping series, it can be shown that the nth partial sum is given by (Subscript[s, n])=1-(1/(Sqrt[n+1])).  This can be seen in the following output:

s[n_]:=(∑_(k=1)^n)((1/(Sqrt[k]))-(1/(Sqrt[k+1])))

TableForm[Table[{n,s[n]},{n,1,10}],
TableHeadings->{{}, {"n", " (Subscript[s, n])"}}]

Hence, the series converges to 1, which we confirm with Mathematica.

(∑_(n=1)^∞)((1/(Sqrt[n]))-(1/(Sqrt[n+1])))

d) This, too, is a telescoping series with the nth partial sum given by (Subscript[s, n])=ln (n+1) (verify this).  Hence, the series diverges, as shown by the following output.

(∑_(n=1)^∞)(Log[n+1]-Log[n])

Exercises

1. Consider the series (∑_(n=1)^∞)(1/((n^2)+3n+2)).

a.  Use the Apart command to decompose the terms of the series, (Subscript[a, n])=(1/((n^2)+3n+2)), into partial fractions.

b.  Use part (a) to find a formula for the nth partial sum of the series.

c) Is the series convergent? If so, then find its sum.

In Exercises 2 through 5, determine if the given series is convergent.  If it is, then find its sum.

2.  (∑_(n=1)^∞)(1/(n(n+1)))				3.  (∑_(n=0)^∞)((((-1))^n)/(n!))				4.  (∑_(n=1)^∞)(((-1))^(n+1))

5. The sereis (∑_(n=0)^∞)a (r^n) is called a geometric series.

a.   Find the nth partial sum of the geometric series.
b.   For what values of r does the series converge? Diverge?
c.   Find the sum of the geometric series for those values where the series converges.

6.  Consider the series (∑_(n=1)^∞)(1/(n^(1/3))).

a.  Use the ListPlot command to plot the first ten partial sums of this series.

b.  Show that the series converges.

10.3  Tests for Convergence

Students should read Sections 10.4-10.5 of Rogawski's Calculus [1] for a detailed discussion of the material presented in this section.

10.3.1  Comparison and Limit Comparison Tests

The Comparison Test: Suppose 0≤(Subscript[a, n])≤(Subscript[b, n]) for all n>M, where M is some positive integer.

a) If (∑_(n==1)^∞)(Subscript[b, n]) is convergent, then (∑_(n=1)^∞)(Subscript[a, n]) is also convergent.

b) If (∑_(n==1)^∞)(Subscript[a, n]) is divergent, then (∑_(n=1)^∞)(Subscript[b, n]) is also divergent.

The Limit Comparison Test: Suppose (Subscript[a, n]) and (Subscript[b, n]) are both positive and  (lim_(n->∞))((Subscript[a, n])/(Subscript[b, n]))=l. If  0<l<∞ (i.e.,, if l is a finite positive number), then (∑_(n=1)^∞)(Subscript[a, n]) and (∑_(n=1)^∞)(Subscript[b, n]) both converge or both diverge.

To test convergence of a given series(∑_(n=1)^∞)(Subscript[a, n]) using the Limit Comparison Test,  it is important that the series (∑_(n=1)^∞)(Subscript[b, n]) easily be checked for convergence.

Example 10.11.  Discuss the convergence of the series

(∑_(n=1)^∞) (1/( (Sqrt[(n^2)+2])))

Solution:  Since (1/( (Sqrt[(n^2)+2])))<(1/(Sqrt[(n^2)]))=(1/n) and the harmonic series (∑_(n=1)^∞) (1/( n)) was shown to divergence in Example 10.8 of this text, it follows by the Comparison Test that our series diverges also.  This is verified by Mathematica:

(∑_(n=1)^∞)(1/(Sqrt[(n^2)+2]))

Example 10.12.  Discuss the convergence of the series

(∑_(n=1)^∞) ((3(n^3)+40(n^2)+4)/((n^5)+200(n^4)+1))

Solution: To find another series to compare ours with, we consider one with terms (Subscript[b, n])=(3/(n^2)).  This comes from considering lower powers of n in both the numerator and denominator of (Subscript[a, n]).

Clear[a,b,n]
a[n_]:=((3(n^3)+40(n^2)+4)/((n^5)+200 (n^4)+1))
b[n_]:=(3/(n^2))

Limit[((a[n])/(b[n])), n->Infinity]

Since the series (∑_(n=1)^∞)(3/(n^2)) is convergent (p-series) and (lim_(n->∞))((Subscript[a, n])/(Subscript[b, n]))=1, we conclude from the Limit Comparison Test that our series (∑_(n=1)^∞) ((3(n^3)+40(n^2)+4)/((n^5)+200(n^4)+1)) is also convergent.

Example 10.13.  Discuss the convergence of the series (∑_(n=1)^∞)[1-cos((1/n))].

Solution: We note that  (lim_(n->∞))[1-cos((1/n))]=0.  This is confirmed by Mathematica.

Limit[1-Cos[1/n],n->∞]

Thus, the necessary condition for convergence is satisfied. But this does not guarantee convergence.  We will use the ListPlot command to plot the graph of the partial sums to see if the series converges.

Clear[s]
s[n_]:=Sum[1-Cos[1/k], {k,1, n}]

ListPlot[Table[{n,s[n]},{n, 1, 100}],PlotRange->{0,1}]

The graph above clearly indicates convergence. To see that this is indeed true, we compare it with a series that is known to converge: (∑_(n=1)^∞)(1/(n^2)). To this end, let us define (Subscript[a, n]) and (Subscript[b, n]) as follows.

Clear[a,b,n]
a[n_]:=1-Cos[(1/n)]
b[n_]:=(1/(n^2))

Observe that both (Subscript[a, n]) and (Subscript[b, n]) are positive terms for all n. Hence, we can apply Limit Comparison Test:

Limit[((a[n])/(b[n])), n->Infinity]

Therefore, the given series, (∑_(n=1)^∞)[1-cos((1/n))], converges.

10.3.2  The Integral Test

The Integral Test.  Given an infinite series

(∑_(n=1)^∞)(Subscript[a, n])

we define f(x) so that f(n)=(Subscript[a, n]) . If f(x) is positive on the interval [1, ∞), decreasing on this interval, and if (lim_(x->∞))f(x)=0, then

(∫_1^∞)f(x)dx     and      (∑_(n=1)^∞)(Subscript[a, n])

both converge or both diverge.

Example 10.14.  Use the integral test to determine the convergence of the following series.

a)   (∑_(n=1)^∞)(1/(Sqrt[n])) 		c)    (∑_(j=1)^∞) j (e^(-(j^2)))		c)  (∑_(n=1)^∞)(1/((Sqrt[n])ln n))

Solution:

a) Here, (Subscript[a, n])=(1/(Sqrt[n])) and so we define f(n) in Mathematica:

Clear[f,x]
f[x_]:=(1/(Sqrt[x]))

f'[x]

Since f'(x)<0 for all x∈[1,∞), it follows that f is decreasing.  Clearly f is positive in value and  (lim_(x->∞))f(x)=0. Thus we can apply the Integral Test by evaluating (∫_1^∞)f(x)dx:

Integrate[f[x], {x, 1, Infinity}]

To confirm this, we evaluate this improper integral according to its limit definition:

Clear[F,b]
F[b_]:=Integrate[f[x], {x, 1, b}]

Limit[F[b], b->∞]

b) Here, we define f as

Clear[f,x]
f[x_]= x (E^(-(x^2)))

Plot[f[x],{x, 0, 5},PlotRange->{0,1}]

The graph clearly shows that the function is decreasing. We can confirm this by solving

f'[x]
Solve[f'[x]==0]

f'[1]

N[1/Sqrt[2]]

Thus, f has critical points at ±(1/(Sqrt[2]))≈0.707.  Since f'(1)<0, we conclude that f  is decreasing on (1, ∞).

The graph also shows that (lim_(x->∞))f(x)=0. Again, we can confirm this by evaluating

Limit[f[x], x->Infinity]

Hence, the Integral Test can be used to determine if the series is convergent. That the series (∑_(j=1)^∞)j (e^(-(j^2))) is convergent follows from the fact that

(∫_1^∞)f[x]\[DifferentialD]x

Since the corresponding integral is convergent, it follows that the series (∑_(j=1)^∞)j (e^(-(j^2))) is also convergent.

c) In this case, we define f as

Clear[f,x]
f[x_]=(( 1)/((Sqrt[x])Log[x]))

Plot[f[x], {x,2,100}]

We leave it for the reader to check that f satisfies all the conditions of the Integral Test, which we now apply.

(∫_2^∞)f[x]\[DifferentialD]x

Since the preceding output states that the integral is divergent, we conclude that the corresponding series is divergent also.

Example 10.15.  For what values of p does the series (∑_(n=2)^∞)(1/((n(ln n))^p)) converge?

Solution: We apply the Integral Test.  Toward this end, we define f(x) so that f(n)=(1/((n(ln n))^p)) and then verify that f(x) is positive and decreasing on the interval [a, ∞),  and that (lim_(x->∞))f(x)=0:

Clear[f,x,p]
f[x_]:=(1/(x (((Log[x]))^p)))

Limit[f[x], x->Infinity]

To confirm this limit, we will plot graphs of f(x) for some values of p

Plot[Evaluate[Table[f[x], {p, -4, 2, .5}]], {x, 2,100},PlotRange->{0,5}]

In the plot above, observe that some of the graphs are initially increasing, but then begin to decrease at a certain point.  Let us then find the interval over which the functionf(x) is decreasing for each  p. To this end, we compute the derivative f'(x) and solve f'(x)<0 for x.

f'[x]

Simplify[%]

Solve[f'[x]==0,x]

Since (((ln x))^(-1-p))>0 for all x>1, we see that f'(x)<0 if ln x>-p, or equivalently, x=(e^(-p)).  Thus, f(x) is decreasing on [2, ∞) where a is the maximum of 2 and (e^(-p)).

To apply the Integral Test, we integrate fover the interval [2,∞).  This is easier than integrating over the interval [a,∞), and permissible since the integrals (∫_2^∞)f(x)dx and (∫_a^∞)f(x)dx either converge or diverge together.

Integrate[f[x],{x,2,∞}]

The preceding output shows that (∫_2^∞)f(x)dx is convergent for p>1.  However, the case p≤1 remains unsolved.  To evaluate the integral in this situation, we define its anti-derivative F(b)=(∫_2^b)f(x)dx and find the limit of F(b) as b-> ∞.

Clear[F,b]
F[b_]=Integrate[f[x], {x, 2, b}]

Since b is a real number and b>2 , the solution to our integral is the first one, that is, F(b)= (((((ln 2))^(1-p))-ln (((b))^(1-p)))/(1-p)), provided p≠1. But then for p<1, we see that (lim_(b->∞))F(b)=∞ since (lim_(b->∞))((ln(b))^(1-p))=∞.  For p>1, we have (lim_(b->∞))F(b)=((((ln 2))^(1-p))/(1-p)) , which we already knew from the second previous Mathematica output.  The following tables might be helpful to convince you about this.

Table[Limit[F[b], b->Infinity], {p, -3, .9, .5}]

Table[Limit[F[b], b->Infinity], {p, 1.1, 9, .5}]

For p=1, we make this substitution inside the integral and evaluate it directly:

p=1;
Integrate[f[x], {x, 2, ∞}]

Therefore, the infinite series (∑_(n=2)^∞)(1/((n(ln n))^p)) is convergent for p>1 and divergent for p≤1.

NOTE: To see how slow the growth of this series is for the value of p=1, we consider the following table of partial sums. Recall that f(n) is the nth term of the series and hence the nth partial sum is given by

Clear[p,s,n]
s[n_]=Sum[f[k], {k, 2, n}]

The following output shows that the sum of the first ten thousand terms is only about 3.01501088.

p=1;
N[s[10000]]

Here is a plot of the graph of the first ten thousand partial sums in steps of 1,000.

ListPlot[Table[{n, s[n]}, {n, 1000, 10000, 1000}]]

10.3.3  Absolute and Conditional Convergence

Suppose (Subscript[a, n])>0 for all n. The infinite series

(∑_(n=1)^∞)(((-1))^n)(Subscript[a, n])

is called an alternating series.  If the series (∑_(n=1)^∞)(((-1))^n)(Subscript[a, n]) is convergent but the series (∑_(n=1)^∞)(Subscript[a, n]) is divergent, then the alternating series is called conditionally convergent.  If (∑_(n=1)^∞)(Subscript[a, n]) is convergent, then the alternating series  (∑_(n=1)^∞)(((-1))^n)(Subscript[a, n]) is called absolutely convergent.

Alternating Series Test: If (Subscript[a, n]) is decreasing and (lim_(n->∞))(Subscript[a, n])=0, then the series (∑_(n=1)^∞)(((-1))^n)(Subscript[a, n]) is convergent.

Example 10.16.  Determine if the given series is conditionally or absolutely convergent.

a)   (∑_(n=1)^∞)((((-1))^n)/((n^2)+1)) 		c)    (∑_(n=2)^∞) ((((-1))^n)/(n ln n))

Solution:

a) We define (Subscript[a, n])=(1/((n^2)+1)) in Mathematica and check that (Subscript[a, n]) satisfies the conditions of the Alternating Series Test.

Clear[a,n]
a[n_]:=  (1/((n^2)+1))

Limit[a[n],n->∞ ]

f[x_]=a[x];
f'[x]

Thus, (Subscript[a, n]) is decreasing since f'(x)>0, where f(n)=(Subscript[a, n]).  Moreover, (Subscript[a, n]) converges to 0. Hence, the series (∑_(n=1)^∞)((((-1))^n)/((n^2)+1))   is convergent by the Alternating Series Test.

To check absolute convergence, we use the Limit Comparison Test with (Subscript[b, n])=(1/(n^2)).

Limit[((a[n])/(1/(n^2))), n->Infinity]

Since the series (∑_(n=1)^∞)(1/(n^2)) is convergent and the previous output shows (lim_(n->∞))((Subscript[a, n])/(Subscript[b, n]))=1, we conclude that the series (∑_(n=1)^∞)(Subscript[a, n])=(∑_(n=1)^∞)(1/((n^2)+1)) is also convergent.  Therefore, the alternating series (∑_(n=1)^∞)((((-1))^n)/((n^2)+1))  is absolutely convergent.

b) We procced as in part a).

Clear[a,n]
a[n_]:=  (1/( n Log[n]))

Limit[a[n],n->∞ ]

f[x_]=a[x];
f'[x]

For the same reasons we conclude that (Subscript[a, n]) is decreasing and converges to 0.  Hence, the series (∑_(n=2)^∞)((((-1))^n)/( n ln n))   is convergent by the Alternating Series Test.

To check absolute convergence, we apply the Intgeral Test to f(x):

Clear[m]
Limit[(∫_2^m)f[x]\[DifferentialD]x,m->Infinity]

From this, we conclude that the series is conditionally convergent.

Example 10.17.  Show that the series

(∑_(n=1)^∞)((((-1))^n)/(Sqrt[(n^2)+1]))

is conditionally convergent.  Find a value of n for which the partial sum (Subscript[s, n]) approximates the series by an error less than (10^(-5)).  Also, find the corresponding value for (Subscript[s, n]).

Solution: We leave it for the reader to check that the series converges conditionally as in the preceding example.  For the second part of the problem, we proceed by first defining the partial sums of the series.

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

If S denotes the sum of the alternating series, it can be shown that |S-(Subscript[s, n])|<(Subscript[a, n+1]) (refer to your calculus text for a proof of this fact).  The following table of values gives some numerical evidence of this fact:

Table[{N[Abs[(∑_(n=1)^∞)((((-1))^n)/(Sqrt[(n^2)+1]))-s[m]]],N[a[m]]},{m,1,10 }]

Clear[S,n]
S=(∑_(n=1)^∞)((((-1))^n)/(Sqrt[(n^2)+1]))

The table below gives the values of (Subscript[a, n]) for large values of n.

Table[N[a[(10^n)] ], {n, 1,10  }]

Thus, n=(10^6) is a possible value. But solving (Subscript[a, n])=(10^(-5)) can give us a more accurate value.

NSolve[a[x]==(10^(-5)),x]

Thus, if n=100001, we have |S-(Subscript[s, n])|<(10^(-5)).  We confirm this with Mathematica:

N[S-s[100001]]

Can you find a smaller value of n for which |S-(Subscript[s, n])|<(10^(-5))?

10.3.4  Ratio Test

The Ratio Test:  Suppose (Subscript[a, n])>0 and let

r=(lim_(n->∞))((Subscript[a, n+1])/(Subscript[a, n])).

a) If r<1, the series (∑_(n=1)^∞)(Subscript[a, n]) converges. 
b) If r>1, the series (∑_(n=1)^∞)(Subscript[a, n]) diverges.
c) If r=1, no conclusion can be drawn about the convergence of the series (∑_(n=1)^∞)(Subscript[a, n]).  In other words, if r=1, then we must use another test to determine the convergence.

Example 10.18.  Use the Ratio Test to determine the convergence of the following series.

a)   (∑_(n=1)^∞)((n^n)/(n!)) 		c)    (∑_(j=2)^∞) (1/(j (((ln j))^3)))		c)  (∑_(n=1)^∞) ((3(n^3)+40(n^2)+4)/((n^5)+200(n^4)+1))

Solution: For each series, we define (Subscript[a, n]) to be its nth term and evaluate (lim_(n->∞))((Subscript[a, n+1])/(Subscript[a, n])).

a)

Clear[a,n]
a[n_]:= ((n^n)/(n!))

Limit[a[n+1]/a[n],n->∞ ]

Since e>1, the series (∑_(n=1)^∞)((n^n)/(n!)) converges by the Ratio Test.

b)

Clear[a,j]
a[j_]:= (1/(j(((Log[j]))^3)))
 Limit[a[j+1]/a[j],j->∞ ]

This output means that we must use a different test. However, this is an instance of Example 11.12 in this text with p=3.  Hence, the series converges by the Integral Test.

c)

Clear[a,n]
a[n_]:= ((3(n^3)+40(n^2)+1)/((n^5)+200(n^4)+1))

Limit[a[n+1]/a[n],n->∞ ]

Again, this output means we are forced to use a different test.  Therefore, we shall use the Limit Comparison Test instead. To this end, we define (Subscript[b, n])=(3/(n^2)):

Clear[b,n]
b[n_]:=(3/(n^2))

Limit[((a[n])/(b[n])), n->Infinity]

Since the series (∑_(n=1)^∞)(1/(n^2)) is convergent, we conclude that the series (∑_(n=1)^∞) ((3(n^3)+40(n^2)+4)/((n^5)+200(n^4)+1)) is also convergent.

10.3.5  Root Test

The Root Test:  Suppose (Subscript[a, n])>0 and let

r=(lim_(n->∞))((((Subscript[a, n])))^(1/n)).

a) If r<1, the series (∑_(n=1)^∞)(Subscript[a, n])converges. 
b) If r>1, the series (∑_(n=1)^∞)(Subscript[a, n]) diverges.
c) If r=1, no conclusion can be drawn about the convergence of the series (∑_(n=1)^∞)(Subscript[a, n]). In other words, if r=1, then we must use another test to determine the convergence.

Example 10.19.  Use the Root Test  to determine the convergence of the following series:

a)   (∑_(n=1)^∞)((((n/(2n+1))))^n) 		b)    (∑_(n=1)^∞) (1/(n  (3^n)+(n^2)))		c)  (∑_(n=1)^∞)((3n+1)/((n^2)+n+1))

Solution: For each series we define (Subscript[a, n]) to be its nth term and evaluate (lim_(n->∞))((((Subscript[a, n])))^(1/n)).

a)

Clear[a,n]
a[n_]:= ((((n/(2n+1))))^n)

Limit[(((a[n]))^(1/n)),n->∞ ]

Thus, the series (∑_(n=1)^∞)((((n/(2n+1))))^n) converges by Root Test.

b)

Clear[a,n]
a[n_]:=  (1/(n (3^n)+(n^2)))

Limit[(((a[n]))^(1/n)),n->∞ ]

Even though the preceding Limit command is returned as unevaluated, the N command reveals that it is approximately 1/3.

N[%]

To verify this, we use the Squeeze Theorem (discussed in your calculus text) with (Subscript[b, n])=(1/(2 n (3^n))) and (Subscript[c, n])=(1/(n (3^n))).  First, note that (Subscript[b, n])≤(Subscript[a, n])≤(Subscript[c, n]).  We can verify this using the following plot:

Plot[{((3^(-x))/(2x)), a[x],((3^(-x))/x)}, {x, 1, 10}, PlotStyle->{Green, Red, Blue}]

We now define (Subscript[b, n ])and (Subscript[c, n]) as and evaluate (lim_(n->∞))((((Subscript[c, n])))^(1/n))  and (lim_(n->∞))((((Subscript[b, n])))^(1/n)).

Clear[b, c, n]
b[n_]:=(1/(2 n (3^n)))
c[n_]:=(1/(n (3^n)))

Limit[(((b[n]))^(1/n)), n->Infinity]
Limit[(((c[n]))^(1/n)), n->Infinity]

Thus, we also have (lim_(n->∞))((((Subscript[a, n])))^(1/n))=(1/3) and hence the series converges by the Root Test.

c)

Clear[a,n]
a[n_]:= ((3n+2)/((n^2)-n+1))

Limit[ (((a[n]))^(1/n)),n->∞ ]

The Root Test fails. Let us try the Ratio Test:

Limit[((a[n+1])/(a[n])), n-> Infinity]

The Ratio Test fails as well. We can easily verify that the Integral Test is applicable. We will evaluate the integral

(∫_1^∞)a[x]\[DifferentialD]x

To confirm the divergence of the improper integral, we leave it to the reader to evalaute the function F(x) defined below for large values of x.

Clear[F,b]
F[b_]:=(∫_1^b)a[x]\[DifferentialD]x

Exercises

In Exercises 1 through 6, use the Comparison Test or the Limit Comparison Test to determine if the given series is convergent. If it is convergent, then find its sum.

1.  (∑_(n=1)^∞)(n/(Sqrt[(n^3)+1]))			2.  (∑_(n=2)^∞) ((ln n)/((n^2)+3 ln n))			3.  (∑_(n=1)^∞) (((n^4)+200(n^2)+1000n+2222)/((n^6)+5(n^4)+n+1))

4.  (∑_(n=1)^∞)((ln n)/( (n^2)))		   		5.  (∑_(n=2)^∞) (( 1 )/((n^(ln n)) ))				6.  (∑_(n=1)^∞) (1-(2^(-1/n)))

In Exercises 7 through 9, use the Integral Test to determine if the given series is convergent. If it converges, then find its sum.

7.  (∑_(n=1)^∞)(n/((n^2)+1))				8.  (∑_(n=2)^∞) (n/(2^n))				9.  (∑_(n=1)^∞)  ((((ln n))^3)/(n^2))

10. For what values of p does the series (∑_(n=1)^∞)(1/((n^p) ln n)) converge?

11. Consider the series (∑_(n=2)^∞)((((ln n))^k)/(n^p)).

a.   Fix a value of p (say, p=2 or p=1/2) and find all values of k for which the series converges.

b.   Fix a value of k (say, k=2 or k=-2) and find all values of p for which the series converges.

c.   Generalize the results of a) and b) to all values of p and k.

12.  Let f be  a positive valued function that decreases on [1, ∞) and let (Subscript[a, n])=f(n). It can be shown that

(∫_1^∞)f(x)dx≤(∑_(n=1)^∞)(Subscript[a, n])≤(Subscript[a, 1])+(∫_1^∞)f(x)dx .

a.  Use f(x)=(1/(x^1.1)) to verify this.

b.  Approximate (∑_(n=1)^∞)(1/(n^1.1)) using its nth partial sums with n=10, 100, 1000, 10000.

In Exercises 13 through 16, determine if each of the infinite series is absolutely convergent, conditionally convergent, or divergent. Justify your conclusions! 
13.  (∑_(n=1)^∞)(((((-1))^n)((n^2)-1))/((n^2)+1))		14. (∑_(n=1)^∞)((20(n^2)-n-1)/((n^3)+(n^2)+33))		15. (∑_(n=1)^∞)((((-2))^n)/(n!))		16.  (∑_(n=1)^∞)(((-1))^(n+1))[(Sqrt[n+1])-(Sqrt[n]) ]

17.  Discovery Exercise: 
a.  Determine the convergence or divergence of (∑_(n=2)^∞)(1/(n ln (((ln ln n))^0.5))), (∑_(n=2)^∞)(1/(n ln (((ln ln n))^( )))), and (∑_(n=2)^∞)(1/(n ln (((ln ln n))^2))).
b.  Generalize your work in part a) by determining for which real numbers p the series(∑_(n=2)^∞)(1/(n ln (((ln ln n))^p))) converges.

In Exercises 18 through 25, determine the convergence or divergence of the given infinite series using any of the convergence tests discussed in this section.

18. (∑_(n=1)^∞)((3n+1)/(4n+5)) 			19. (∑_(n=1)^∞)(n/(2(n^2)+1))	 	20. (∑_(n=1)^∞)((n+3)/(4(n^3)+5))  		21. (∑_(n=1)^∞)((n((2/3)))^n) 

22. (∑_(n=1)^∞)((n((3/2)))^n) 		23. (∑_(n=1)^∞)((n^n)/(n!))			24. (∑_(n=1)^∞)((((n!))^2)/((3n)!)) 			25. (∑_(n=0)^∞)(((-1))^n)(((1+(1/n)))^n)

26.  The Ratio Test proved to be inconclusive for some of the series in the previous exercise. Can you conjecture for what type of series the Ratio Test will fail in general? Use other tests to rework the problems in the first exercise where the Ratio Test failed.

27. Of the following four conditions, one guarantees that a series will diverge, two conditions guarantee that a series will converge, and one has no guarantee (the series can either converge or diverge).  Identify each one and explain your reasoning.

(lim_(n-> ∞))|((Subscript[a, n+1])/(Subscript[a, n]))|= 0
(lim_(n-> ∞))|((Subscript[a, n+1])/(Subscript[a, n]))|= (1/2)
(lim_(n-> ∞))|((Subscript[a, n+1])/(Subscript[a, n]))|= 1
(lim_(n-> ∞))|((Subscript[a, n+1])/(Subscript[a, n]))|= 2

28.  Identify the two series that are the same:

a. (∑_(n=1)^∞)((n((3/4)))^n)			b. (∑_(n=0)^∞)(n+1)  ((((3/4)))^n)			c. (∑_(n=1)^∞)((n((3/4)))^(n-1))

In Exercises 29 through 32, determine the convergence or divergence of the series: 

29.  (∑_(n=1)^∞)(2(n^(1/n))+1)n	 		30, (∑_(n=0)^∞)(e^(-n)) 			31. (∑_(n=1)^∞)(((((-2n)/(3n+1))))^(3n)) 			32. (∑_(n=1)^∞)((n/(2n+1)))n

33. Construct two examples of infinite series, the first convergent and the second divergent, for which the Root Test generates inconclusive information.

34. Use the Root Test to test for convergence or divergence of the series:

a. (1/(((ln 3))^3))+(1/(((ln 4))^4))+(1/(((ln 5))^5))+(1/(((ln 6))^6))+...

b. 1+ (2/3)+(3/(3^2))+(4/(3^3))+(5/(3^4))+(6/(3^5))+...

Hint: Write a formula for the general nth term in each case.

10.4  Power Series

Students should read Sections 10.6-10.7 of Rogawski's Calculus [1] for a detailed discussion of the material presented in this section.

10.4.1  Taylor Polynomials

The Taylor polynomial of a given function f at a point x=a is given by

(Subscript[T, n])(x)=f(a)+f'(a)(x-a)+((f''(a))/(2!))(((x-a))^2)+((f'''(a))/(3!))(((x-a))^3)+.... + (((f^((n)))(a))/(n!))(((x-a))^n).

The Mathematica Series[f,{x, a, n}] generates the nth Taylor polynomial (Subscript[T, n])(x) plus a term of the form ((O[x])^(n+1)).  To obtain the Taylor polynomial without this term, we use the command Normal[Series[f,{x, a, n}]].

The nth remainder (Subscript[R, n])(x) of f(x) at x=a is defined by

(Subscript[R, n])(x)=f(x)-(Subscript[T, n])(x).

Taylor's Theorem states that

(Subscript[R, n])(x)=(1/(n!))(∫_a^x)(f^((n+1)))(u)(((x-u))^n)du.

Here is a way to define the Taylor polynomial of fat x=a by defining (Subscript[T, n])(x) and the nth remainder (Subscript[R, n])(x) (using Taylor's Theorem for (Subscript[R, n])) without referring to Mathematica's built-in command Series.

Clear[a, x, f,T,R]
T[x_,a_, n_]:=(∑_(k=0)^n)((D[f[x],{x,k}]/.x->a)/(k!))(((x-a))^k)
 R[x_,a_, n_]:=(1/(n!))(∫_a^x)D[f[u],{u,n+1}]*(((x-u))^n) \[DifferentialD]u

Example 10.20.  Let f(x)=(e^x).  Find its 5th Taylor polynomial at x=0.

Solution: We use the Series command to obtain the answer:

Normal[Series[(E^x),{x,0,5}]]

Using the polynomial T[x,a,n], we defined above we get

Clear[f]
f[x_]:=(E^x)
T[x, 0, 5]

R[x,0,5]

Example 10.21.	 Find the nth Taylor polynomial of f(x) at x=a for various values of a and n.

a) f(x)=(Sqrt[x])	 	b)  f(x)=cos x

Solution:  a) We shall use the same function T[x,a,n] defined in the previous example (make sure you evaluate this function before you evaluate the table below).

Clear[a, x, f]
T[x_,a_, n_]:=(∑_(k=0)^n)((D[f[x],{x,k}]/.x->a)/(k!))(((x-a))^k)
R[x_,a_, n_]:=(1/(n!))(∫_a^x)D[f[u],{u,n+1}]*(((x-u))^n) \[DifferentialD]u

Clear[f]
f[x_]=(Sqrt[x])
TableForm[Table[ T[x, a, n] ,  {a,1, 5},{n, 1, 3}]  , 
TableHeadings->{{"at a=1", "at a=2","at a=3","at a=4","at a=5"},{"n=1","n=2","n=3"}}]

b) We proceed as in part a):

Clear[f]
f[x_]=Cos[x]
TableForm[Table[ T[x, a, n] ,  {a,0, 2Pi, Pi/2},{n, 1, 4}]  , 
TableHeadings->{{"at a=0", "at a=π/2","at a=π","at a=3π/2","at a=2π"},{"n=1","n=2","n=3","n=4"}}]

Example 10.22.  Let f(x)=(1/(2 +3(x^2))).

a) Find the Taylor polynomials (Subscript[T, n])(x) of f at  x=0 for n=1,2,..., 6.
b) Draw the graphs of the function f and its Taylor polynomials found in part a).
c) Over which interval does the nth Taylor polynomial gives a close approximation to f(x) if n=4, n=10, and n=20?

Solution:

a) Here are the Taylor polynomials up to order n=6.

Clear[f]
f[x_]=(1/(2+3(x^2)))
TableForm[Table[ {n,T[x, 0, n]} ,{n, 1, 6}]  , 
TableHeadings->{{},{"n", "(Subscript[T, n]) at a=0"}}]

b)  We first use the Plot command to plot the graphs of f and its Taylor polynomial at x=0 for the desired values of n.  We then use the Show command to plot both graphs on the same axes.

Clear[plot1,plot2]
plot1=Plot[f[x],{x,-3,3}, PlotStyle->  Red];
plot2=Plot[Evaluate[Table[T[x,0,n],{n, 1, 6}]], {x,-3,3}]  ;
Show[plot1,plot2]

c) We use the same commands as in part b) except that we do not use the Table command. The first one is for the case n=4.

Clear[plot1,plot2] 
plot1=Plot[f[x],{x,-3,3}, PlotStyle->  Red];
plot2=Plot[Evaluate[T[x,0,4]], {x,-3,3}]  ;
Show[plot1,plot2]

It seems that the two graphs are close to each other  if x is in the interval (-0.5, 0.5). To see this close up, we recommend that you change the range of values for x in both plots (plot1 and plot2) to the interval [-1,1]. We can confirm this by plotting the 4th remainder of f(x) at x=0.

Plot[Evaluate[R[x,0,4]],{x, -1,1}, PlotRange->{-1,1}]

We repeat the above with n=10.

Clear[plot1,plot2]
plot1=Plot[f[x],{x,-3,3}, PlotStyle->  Red];
plot2=Plot[Evaluate[T[x,0,100]], {x,-3,3}]  ;
Show[plot1,plot2]

The graph above clearly indicates the 10th Taylor polynomial gives a close approximation for f in the interval [-.6,.6]. Again, plotting  (Subscript[R, n]) will confirm this.

Plot[Evaluate[R[x,0,10]],{x, -1,1}, PlotRange->{-1,1}]

If we continue in this manner, we see that the Taylor polynomial  (Subscript[P, n]) for large values of n gives a better approximation of f in the interval [-1,1].  In fact, for n=20, we see that (Subscript[R, n])(x) is almost zero in the interval [-0.7,0.7], which is an improvement over the previous interval [-0.6,0.6] obtained for n=10.

Plot[Evaluate[R[x,0,20]],{x, -1,1}, PlotRange->{-1,1}]

10.4.2  Convergence of Power Series

A series of the form

(∑_(n=0)^∞)(((Subscript[a, n])(x-(Subscript[x, 0])))^n)=(Subscript[a, 0])+(Subscript[a, 1])(x-(Subscript[x, 0]))+(((Subscript[a, 2])(x-(Subscript[x, 0])))^2)+(((Subscript[a, 3])(x-(Subscript[x, 0])))^3)+ ....

is called a power series.

The set of all x for which the series converges is called the interval of convergence.

If the series converges for x=(Subscript[x, 0]) only, we say is radius of interval is R=0. In this case, its interval of convergence is {(Subscript[x, 0])}.

If the series converges for all real numbers x, we say its radius of convergence is R=∞. In this case, its interval of convergence is (-∞,∞).

If the series converges for some x≠(Subscript[x, 0]) and diverges for some y, then it can be shown that there exists R>0 such that the power series converges for all x for which |x-(Subscript[x, 0])|<R and diverges for all x for which |x-(Subscript[x, 0])|>R. The convergence at x=(Subscript[x, 0])-R and x=(Subscript[x, 0])+R needs to be checked.

When the radius of convergence R is a positive real number, there are four possiblities for the interval of convergence:

((Subscript[x, 0])-R, (Subscript[x, 0])+R) or [(Subscript[x, 0])-R, (Subscript[x, 0])+R) or ((Subscript[x, 0])-R, (Subscript[x, 0])+R] or [(Subscript[x, 0])-R, (Subscript[x, 0])+R]

depending on the convergence at the end points of the intervals.

The radius of convergence R of the power series (∑_(n=0)^∞)(((Subscript[a, n])(x-(Subscript[x, 0])))^n) can be found by using the Ratio or Root Test.  Let

r=(lim_(n->∞))|((Subscript[a, n+1])/(Subscript[a, n]))|    or    r=(lim_(n-> ∞))((|(Subscript[a, n])|)^(1/n))

a) If r=0, then R=∞. 
b) If r=∞, then  R=0 .
c) If 0<r<∞, then R=(1/r).

Example 10.23.  Find the radius and interval of convergence for the given power series.

a)   (∑_(n=0)^∞)(n/(2n+1)) (x^n) 		b)    (∑_(n=1)^∞) ((((x-3))^n)/(n (3^n)))		c)  (∑_(n=0)^∞)((((x+2))^n)/((n^2)+n+1))

d)   (∑_(n=0)^∞)(n^n) (x^n) 		e)    (∑_(n=0)^∞) (1/(n!))(((x-1))^n)

Solution:

a) Let us define (Subscript[s, m])(x) to be the mth partial sum of the series and plot the graph of some of these partial sums. We will plot every 100th partial sum up to 10,000 terms.

Clear[s,n,m]
s[x_,m_]:=(∑_(n=0)^m)(n/(2n+1))(x^n)

Plot[Evaluate[Table[s[x, m],{m,1, 1000, 100}]], {x, -2,2}]

This clearly indicates that the partial sums diverge outside (-1,1). Here is the plot over the interval (-1,1).

Plot[Evaluate[Table[s[x, m],{m,1, 1000, 100}]], {x, -1,1}]

We now use calculus. Here, note that (Subscript[a, n])=(n/(2n +1)) and (Subscript[x, 0])=0. We first define (Subscript[a, n]) in Mathematica and find the radius of convergence. We recall |a| (absolute value of a) is entered as Abs[a].

Clear[a,n,r]
a[n_]:=(n/(2n+1))

r= Limit[Abs[((a[n+1])/(a[n]))], n->Infinity]

Thus, the radius of convergence is R=(1/r)=(1/1)=1. The power series convrges on (-1, 1). To check convergence at the endpoints x=-1 and x=1, we note that the power series becomes (∑_(n=0)^∞)(n/(2n+1))(((-1))^n)and (∑_(n=0)^∞)(n/(2n+1))(((1))^n), both of which are divergent, since their nth terms do not converge to 0. Here, Mathematica confirms the divergence at the endpoints.

(∑_(n=0)^∞)(n/(2n+1))(((-1))^n)

(∑_(n=0)^∞)(n/(2n+1))(((1))^n)

Therefore, the interval of convergence is (-1,1).

b)   (∑_(n=1)^∞) ((((x-3))^n)/(n (3^n)))

Clear[a,r,n]
a[n_]:=(1/(n (3^n)))

r=Limit[((a[n+1])/(a[n])), n->Infinity]

Thus the radius of convergence is R=(1/r)=(1/(1/3))=3.

Since (Subscript[x, 0])=3, the power series converges on ((Subscript[x, 0])-R, (Subscript[x, 0])+R)=(3-3,3+3)=(0,6). We need to check the endpoints x=0 and x=6. We substitute these in the power series and evaluate

(∑_(n=1)^∞)((((x-3))^n)/(n (3^n)))/.x->{0,6}

Thus, the interval of convergence is [0,6).

c)  (∑_(n=1)^∞)((((x+2))^n)/((n^2)+n+1))

Clear[a,r,n]
a[n_]:=(1/((n^2)+n+1))

r=Limit[Abs[((a[n+1])/(a[n]))], n-> ∞]

Hence, the radius of convergence is R=(1/1)=1. Since (Subscript[x, 0])=-2, we see that the power series converges at least on the open interval (-2-1,-2+1)=(-3,-1). To determine the actual interval of convergence we need to check the endpoints. As in part c), we evaluate

(∑_(n=0)^∞)((((x+2))^n)/((n^2)+n+1))/.x->{-3,-1}

N[%]

Since this is not clear, we examine the series by plugging in by hand x=-3 and x=-1. When x=-3 the series becomes (∑_(n=1)^∞)((((-3+2))^n)/((n^2)+n+1))= (∑_(n=1)^∞)((((-1))^n)/((n^2)+n+1)), which is an alternating series. We leave it to the reader to verify that the Alternating Series Test applies in this case.  Thus, we have a convergent series.

Next, we substitute x=-1 to obtain the series (∑_(n=1)^∞)((((-1+2))^n)/((n^2)+n+1))= (∑_(n=1)^∞)(1/((n^2)+n+1)) to which we apply the Integral Test (verify that the conditions of the Integral Test are satisfied):

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

Thus, the series converges in this case as well. Therefore, the interval of convergence for the power series is [-3,-1].

d)   (∑_(n=0)^∞)(n^n)(x^n)

Clear[a,r,n]
a[n_]:=(n^n)

r=Limit[Abs[((a[n+1])/(a[n]))],n-> ∞]

Thus, the radius of convergence is R=0 and the series converges for x=0 only.

e)    (∑_(n=0)^∞) (1/(n!))(((x-1))^n)

Clear[a,r,n]
a[n_]:=(1/(n!))

r=Limit[Abs[((a[n+1])/(a[n]))],n-> ∞]

Thus, the radius of convergence is R=∞ and the series converges for all real x.  Hence, the interval of convergence is (-∞,∞).

10.4.3  Taylor Series

The Taylor series for f(x) at x=a is given by the power series

(∑_(n=0)^∞)(((f^((n)))(a))/(n!))(((x-a))^n)=f(a)+f'(a)(x-a)+((f''(a))/2)(((x-a))^2)+((f'''(a))/6)(((x-a))^3)+.....

The Mathematica command Series[f,{x, a, n}] generates the power series of f at x=a to the order (((x-a))^n).  It is not possible to write all the terms explicitly since there are infinitely many.

Example 10.24.  Let f(x) =((1+x)/(1+(x^2))).

a) Find the first ten terms of the Taylor series of f at x =0.
b) Estimate the radius and interval of convergence of the Taylor series of f at x =0.

Solution:

a) We use the Series command to obtain the Taylor series as follows:

Clear[f,x]
f[x_]:=((1-x)/(2+x))

Series[f[x],{x, 0, 10}]

This output gives the Taylor series to order n=10.

b) To first gain intuition for the radius of convergence of the Taylor series, we define the nth Taylor polynomial of f(x) as a function of n (note our use of the Normal command to truncate the remainder term from the Taylor series).

Clear[T,x,n]
T[x_,n_]:=Normal[Series[f[x],{x, 0, n}]]

Here is a list of the first 20 of these polynomials.

Table[T[x,n],{n, 0, 10}]

Observe that each polynomial appears twice, that is, (Subscript[T, 2n])=(Subscript[T, 2n+1]), since f is an even function.  Next, we plot the graphs of some of these polynomials:

Clear[plot1]
plot1=Plot[Evaluate[Table[T[x,n],{n, 1, 20}]],{x,-5,3},PlotRange->{-10,10}]

To compare the graph of these polynomials, we plot the graph of f and use the Show command.

Clear[plot2]
plot2=Plot[f[x], {x,-5,3}, PlotRange->{-10,10}, PlotStyle->Red]

Show[{plot1, plot2}, PlotRange->{-10,10}]

Observe that the graphs of the Taylor polynomials in the preceding plot seem to give a good approximation to f only inside the interval (-2,2).  This suggests that the radius of convergence is 2.  This becomes more evident as we plot the graph of (Subscript[T, n]) for large values of n as shown in the following plot, where n=30,35,40,45,50.

Clear[plot3]
plot3=Plot[Evaluate[Table[T[x,n],{n, 30, 50,5}]],{x,-3,3}];
plot4=Plot[f[x], {x,-5,3}, PlotStyle->{Red, Thickness[0.002]}];
Show[{plot3, plot4}, PlotRange->{-10,10}]

To prove that the radius of convergence is indeed R=2, we first find a formula for the Taylor coefficients.  Based on the following table, it is clear that (Subscript[a, 0])=1/2 and (Subscript[a, n])=(((-1))^n)3/(2^(n+1)) (prove this for all n).

a[n_]:=D[f[x],{x,n}]/n!/.x->0
Table[a[n],{n,0,10}]

We now apply the Ratio Test on (∑_(n=0)^∞)(Subscript[a, n])(x^n).

Clear[a]
a[n_]=(-1)^n*3/2^(n+1)
r=Limit[Abs[((a[n+1])/(a[n]))],n-> ∞]

Hence, the radius of convergence is R=1/r=2.

Next, we determine whether the endpoints should be included in the interval of convergence.  For this, we evaluate our Taylor series at x=-2 and x=2.

(∑_(n=1)^∞)a[n](-2)^n
(∑_(n=1)^∞)a[n](2)^n

This shows that the Taylor series diverges at both endpoints.  Thus, the interval of convergence is (-2,2).

Example 10.25.  Let f(x)  =  sin x.

a) Find the Taylor series of f at x =0.
b) Find the radius and interval of convergence of the Taylor series.

Solution:

a) We repeat the steps in the previous example.

Clear[f]
f[x_]:=Sin[x]

Clear[T]
T[x_,n_]:=Normal[Series[f[x],{x, 0, n}]]

Table[T[x,n],{n, 0, 10}]

Observe that all terms of the Taylor polynomials are odd powers of x.  Can you explain why?

Here is a plot of the graphs of the first ten of these polynomials and the function f.

Clear[plot1,pl0t2]
plot1=Plot[Evaluate[Table[T[x,n],{n, 0, 10}]],{x,-3Pi,3Pi}];
plot2=Plot[f[x], {x,-3Pi,3Pi}, PlotStyle->Red];
Show[{plot1, plot2}, PlotRange->{-10,10}]

b) Observe that the higher the order of the Taylor polynomial the better it approximates f over a wider interval.  To see this more clearly, we plot (Subscript[T, n]) for n=20,40,60.

Clear[plot1,plot2]
plot1=Plot[f[x], {x,-40,40}, PlotStyle->Red,PlotRange->{-5,5}];
plot2=Plot[ Evaluate[T[x,20]]  ,{x,-40,40 }, PlotStyle->Blue,PlotRange->{-5,5}];
plot3=Plot[ Evaluate[T[x,40]]  ,{x,-40,40 }, PlotStyle->Blue,PlotRange->{-5,5}];
plot4=Plot[ Evaluate[T[x,60]]  ,{x,-40,40 }, PlotStyle->Blue,PlotRange->{-5,5}];
Show[{plot1, plot2}]

Show[{plot1, plot3}]

Show[{plot1, plot4}]

The preceding plots suggest that the radius of convergence for the Taylor series of sin x is R=∞.  To prove this, we first find a formula for the Taylor coefficients {(Subscript[a, n])}.  Again, based on the following table, it is clear that (Subscript[a, n])=sin(π n/2)/n! (prove this for all n).

a[n_]:=D[f[x],{x,n}]/n!/.x->0
Table[a[n],{n,0,10}]

We now apply the Root Test on (∑_(n=0)^∞)(Subscript[a, n])(x^n).

Clear[a,n,r]
a[n_]=Sin[Pi*n/2]/n!
Table[a[n],{n,0,10}]
r=Limit[Abs[a[n]]^(1/n),n-> ∞]

Hence, the radius of convergence is R=∞.

Exercises

In Exercises 1 through 6,  determine the radius and interval of convergence for the given power series.

1. (∑_(n=1)^∞)(((((-1))^(n+1))(x^n))/(4^n)) 			2. (∑_(n=0)^∞)(2n)!((x/2))n			3. (∑_(n=1)^∞)((n!(x^n))/((2n)!))
4. (∑_(n=0)^∞)(((-1))^n)((x^n)/(n+1))			5. (∑_(n=0)^∞)(((4x))^n)  				6. (∑_(n=0)^∞)((((2x))^n)/(n!))

7. Give examples of power series that have an infinite radius of convergence, a radius of convergence containing only the center, and a radius of convergence of one.

8. Find the Taylor series for f(x)=(e^(2x)) centered about c=0.

9. Find the Taylor series for f(x) = ln x centered about the point c = 1.

In Exercises 10 through 12, find the MacLaurin series for each of the given function.

10. f(x) =sin 2x			11. g(x)=sinh x			12. h(x)=(arc sin x)/x

13. Consider the function f(x)={({{(e^(-1/(x^2))) if x≠0}, {0             if x=0}}).  
a.  Plot the graph of this function using Mathematica.
b.  Use the limit definition of the derivative and L'Hopital's Rule to show that every higher-order derivative of f at x=0 vanishes.
c.  Find the MacLaurin series for f.  Does the series converge to f?

14. Use Taylor series to evalaute the following definite integral, which cannot be integrated via elementary means:

(∫_0^1)((sin x )/x)dx.

15. Find the following limit using the theory of Taylor series.

(Subscript[lim , x-> 0]) ((1-cos x)/x)