Convergence of Classical
Power Series

by
K. D.  Stroyan
University of Iowa

copyright 1997 by Academic Press, Inc. - All rights reserved.

Special Mathematica Functions used in this NoteBook

Off[General::spell1];
Needs["Graphics`Colors`"]
seriesGraphs[f_, series_, radius_, numterms_Integer, opns___Rule] :=
	Module[ {functions, graylevels, i, j,n,x,terms},
	Do[
	functions = Table[series[x,n], {n, 0, i}] ;
	AppendTo[functions, f[x]] ;
	graylevels = Table[{GrayLevel[j]}, {j, 6/10, 0, -6/(10 i)}] ; 
	graylevels=AppendTo[graylevels,{AbsoluteThickness[2],Red}];
	Plot[Release[functions], {x, -radius, radius},
		PlotStyle -> graylevels,PlotLabel ->i"terms",
		opns,AspectRatio->Automatic];
	,{i, 1, numterms}];
	Do[
	Plot[Release[{f[x], series[x,n]}],{x, -radius, radius},
		PlotLabel ->n"terms ", opns,
		PlotStyle -> {{AbsoluteThickness[2],Red},{GrayLevel[0]}},
		AspectRatio->Automatic];
	,{n, 1, numterms}];
	];

Needs["Graphics`Colors`"]
powerGraphs[f_,  radius_, numterms_, opns___Rule] :=
	Module[ {functions, graylevels, i, j,n,x,terms},
	Do[
	functions = Table[Normal[Series[f[x],{x,0,n}]], {n, 0, i}] ;
	AppendTo[functions, f[x]] ;
	graylevels = Table[{GrayLevel[j]}, {j, 6/10, 0, -6/(10 i)}] ; 
	graylevels=AppendTo[graylevels,{AbsoluteThickness[2],Red}];
	Plot[Release[functions], {x, -radius, radius},
		PlotStyle -> graylevels, PlotLabel ->i"terms",
		opns,AspectRatio->Automatic];
	,{i, 1, numterms}];
	Do[
	Plot[Release[{Normal[Series[f[x],{x,0,n}]],f[x]}],{x, -radius, radius},
		PlotLabel ->n"terms ", opns, 
		PlotStyle -> {{GrayLevel[0]},{AbsoluteThickness[2],Red}},AspectRatio->Automatic];
	,{n, 1, numterms}];
	];
On[General::spell1];

Notebook Overview

This NoteBook illustrates the convergence of the power series expansions of the classical series.  You should memorize these with their radius of convergence:

(e^x)  =  
        Exp[x] = 
          1 + x + ((x^2)/2) + ((x^3)/6) + ((x^4)/24) + ((x^5)/120) + 
            ⋯ + ((x^n)/(n!)) + ⋯

Cos[x] = 
        1 - ((x^2)/2) + ((x^4)/24) - ((x^6)/720) + ⋯ + 
          (((((-1))^n) (x^(2 n)))/((2 n)!)) + 
          ⋯

Sin[x] = 
        x - ((x^3)/6) + ((x^5)/120) - ((x^7)/5040) + ⋯ + 
          (((((-1))^(n + 1)) (x^(2 n + 1)))/((2 n + 1)!)) + 
          ⋯

(1/(1 - x))  =  
        1 + x + (x^2) + (x^3) + ⋯ + (x^n)  +  
          ⋯,  |x| < 1

Log[1 + x] = 
        x - ((x^2)/2) + ((x^3)/3) + ⋯ + 
          (((((-1))^(n + 1)) (x^n))/n) + ⋯,  |x| < 1

References to the Text

This NoteBook goes with Chapter 26 of the text.

Exp[x], Cos[x], Sin[x]

The Cosine Series

This example gives a general formula for the power series of the Cosine function, displays the first 10 powers and compares it with the built-in computation of the power series expansion of Cosine.

Clear[f, x, n, series]; f[x_] := Cos[x]; series[x_, n_] := 
      (∑_(k = 0)^n)(((((-1))^k) (x^(2 k)))/((2 k)!)); 
    series[x, n]series[x, 5]Series[f[x], {x, 0, 10}]

Graphical Convergence

The seriesGraphs[.] function defined tin the Initialization cell above compares a function and a series you define.  The powerGraphs[.] function uses the built-in Series[.] function to generate the series approximation and plot the comparison.

radius = 3 π; numterms = 9; Print[series[x, numterms]]; seriesGraphs[f, series, radius, numterms, AspectRatio -> (1/2), 
      PlotRange -> {-2, 2}];

Now try the graphical comparison with the built-in Series[.]

Series[f[x], {x, 0, numterms}]powerGraphs[f, radius, numterms, AspectRatio -> (1/2), 
      PlotRange -> {-2, 2}];

Radius of Convergence < Infinity

The Geometric Series

The Taylor Series for Cos[x], Sin[x] and Exp[x] converge for all x, so the radius of convergence above can be take as large as you want.  This is not true for all Taylor series:  The next cell contains the geometric series.  (Also see the GeomSeries NoteBook, which discusses the convergence of this example in detail.)

Clear[f, x, n]; f[x_] := (1/(1 - x)); series[x_, n_] := (∑_(k = 0)^n) (x^k); series[x, n]series[x, 9]Series[f[x], {x, 0, 9}]

Graphical Convergence

radius = 1.2; numterms = 10; seriesGraphs[f, series, radius, numterms, 
      PlotRange -> {-1, 4}];

Look at the graphs and answer the question:

For which values of x does the series approximate the limiting function?  In particular why is there a vertical line at  x = 1?  Why are ther all those wiggles just below  x = -1?

Differentiation

Power series converge so strongly inside their radius of convergence that we dan differentiate them term-by-term and obtain a valid series for the derivative of the original function.  Here is an example.  (Note that it does NOT converge outside -1<x<1.)

Clear[f, x, n, g]; f[x_] := (1/(1 - x)); series[x_, n_] := (∑_(k = 0)^n) (x^k); \(g[x_] := \(f'\)[x]; 
g[x]\)dseries[x_, n_] := (∑_(k = 1)^n) k (x^(k - 1)); dseries[x, 9]Series[g[x], {x, 0, 8}]powerGraphs[g, 1.2, 9, PlotRange -> {-1, 4}];

Substitution

We substitute  -x  in the formula and series for the geometric series to obtain a new identity:

Clear[f, x, n]; f[x_] := (1/(1 - x)); series[x_, n_] := (∑_(k = 0)^n) (x^k); f[-x]series[-x, n]series[-x, 9]Series[f[-x], {x, 0, 9}]

Clear[g, x]g[x_] := (1/(1 + x)); Series[g[x], {x, 0, 9}]powerGraphs[g, 1.2, 9, PlotRange -> {-1, 4}];

Integration

In the previous example we saw that substitutions in the geometric series leads to the new identity

(1/(1 + x)) = 
        1 - x + (x^2) - (x^3) + ⋯ + (((-1))^n) (x^n) + 
          ⋯

We integrate both sides as follows, where a step-by-step integration of the terms on the right hand side is:

x-((x^2)/2)+((x^3)/3)-((x^4)/4)+⋯+(((-1))^(m ))((x^(m + 1))/(m + 1))+⋯

= x - ((x^2)/2) + ((x^3)/3) - ((x^4)/4) + ⋯ + 
        (((-1))^((n + 1) )) ((x^n)/n) + ⋯

∫(1/(1 + x)) \[DifferentialD]xiseries[x_, n_] := 
      (∑_(k = 1)^n)(((((-1))^(k + 1)) (x^k))/k); iseries[x, n]iseries[x, 9]

Here is the same computation by machine:

Clear[f, x, n]; f[x_] := (1/(1 - x)); series[x_, n_] := (∑_(k = 0)^n) (x^k); ∫series[-x, n] \[DifferentialD]x∫series[-x, 9] \[DifferentialD]x

Let's compare results with the built-in Series[.]:

Series[Log[1 + x], {x, 0, 9}]

Graphical comparison between Log[1 + x] = 
        x - ((x^2)/2) + ((x^3)/3) + ⋯ + 
          (((((-1))^(n + 1)) (x^n))/n) + ⋯

g[x_] := Log[1 + x]; powerGraphs[g, 1.2, 15, PlotRange -> {-5, 1.5}];

Notice that the approximating series does NOT get close to the graph outside the interval -1< x <1.  In fact, the convergence near x = -1 and x = 1 is very slow.

Practice Exercise

Find the series for Exp[ -x^2 ] by substituting y = -x^2 into the series for Exp[ y ].

Exercises

Exercise 26.1.3 Sin[x] & Exp[x]

Sine

The sine function has the power series expansion

Sin[x] = 
        x - ((x^3)/6) + ((x^5)/120) - ((x^7)/5040) + ⋯ + 
          (((((-1))^(n + 1)) (x^(2 n + 1)))/((2 n + 1)!)) + 
          ⋯

Modify the cosine example to plot the first 10 terms of this series.

Compare your series defined by a sum with the built-in computation.

Where does your series converge?

Natural Exponential

The exponential function has the power series expansion

(e^x)  =  
        Exp[x] = 
          1 + x + ((x^2)/2) + ((x^3)/6) + ((x^4)/24) + ((x^5)/120) + 
            ⋯ + ((x^n)/(n!)) + ⋯

Modify the cosine example to plot the first 10 terms of this series. (You may want to modify the AspectRatio and PlotRange options.)

Compare your series defined by a sum with the built-in computation.

Where does your series converge?

Exercise 26.1.2 ArcTan[x] Series

a)  Begin by writing the series for  (1/(1 - x)) =

b)  Subsitiute -(x^2) in the function and series, obtaining a series for

(1/(1 + (x^2))) = 1 + ?(x^2) +  ??

c)  Recall the ArcTan integral, or compute it as follows:

∫(1/(1 + (x^2))) \[DifferentialD]x

d)  Integrate your series from part (2) to obtain a series for

ArcTan[x] = 
        ∫(1/(1 + (x^2))) dx = 
          (∑_(k = 0)^n)
              ∫??  (x^k) dx
					= x + ???

e)  Check your work with the built-in Series[.] function applied to ArcTan[x]:

f)  Check your work graphically by applying seriesGraphs[.] or powerGraphs[.] to ArcTan[x]

Exercise 26.4.5 Sin[x]/x

a)  Write the series for Sin[x] and divide by x, giving the identity

Sin[x]/x = 1  -  ??

b)  Even though the left hand side of the expression is not defined at  x = 0, argue that the function  Sin[x]/x actually has infintiely many derivarives at every point, including  x = 0.  Why are you justified differentiating the right had side at every point, including  x = 0?

In particular, what is the derivative of this function at x = 0?  What is the second derivative at  x = 0?

Plot[Sin[x]/x, {x, -3 π, 3 π}];

c)  The integral of  Sin[x]/x  is perfectly well defined theoretically (since it is actually smooth in light of part (2)), but it can not be computed by "elementary means."  This means that the antiderivative can not be expressed in terms of classical functions.  This integral does areis in Fourier analysis (and some applications), so it has a name "si[x]" (for sine-integral.)  Try to compute it anyway:

∫Sin[x]/x \[DifferentialD]x

d)  Find a series expansion for "si[x]" by integrating your series from part (1):

si[x] = ???

e)  Compare your series with Mathematica's

Series[SinIntegral[x], {x, 0, 9}]