Some Specific Infinite Sums
that depend on 
Convergence

by
K. D.  Stroyan
University of Iowa

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

Special Mathematica Functions

Needs["Graphics`Colors`"];

Notebook Overview

This NoteBook shows why we need to be careful when we form infinite "sums" by giving some curious approximations to special numbers.  The moral of Chapter 27 is that non-power series or power series at the limit of their radius of convergence are tricky.

References to the Text

This NoteBook goes with Chapter 26 & 27 of the text, especially Example 26.4 & Exercise 26.3.5.

Formulas for π & (π^2)

π/4 = 1 - 1/3 + 1/5 - 1/7 + ...

According to Dirichlet's Convergence Theorem from the Math Background,

x = 2( Sin[ x] - Sin[ 2 x ]/2 + Sin[ 3 x ]/3 + ... )  for  | x | < π

Let's take a look:

Clear[series, x, n]; series[x_, n_] := 
      2 (∑_(k = 1)^n)(((((-1))^(k + 1)) Sin[k x])/k)
            series[x, 9]Plot[{x, series[x, 20]}, {x, -4, 4}, 
      AspectRatio -> Automatic, 
      PlotStyle -> {{Thickness[0.02], Red}, Blue}];

Seems OK.

In particular then, if  x = π/2,

π/4 = Sin[π/2] - Sin[ π]/2 + Sin[3π/2]/3 + ...

Let's evaluate the numbers

Table[(((((-1))^(k + 1)) Sin[k x])/k), {k, 1, 9}]Table[(((((-1))^(k + 1)) Sin[((k π)/2)])/k), {k, 1, 9}]

So it appears that

π/4 = 1 - 1/3 + 1/5 - 1/7 + ...

We can confirm this result with the ArcTan series,

\(Clear[f, x]; 
f[x_] := ArcTan[x]; 
Series[f[x], {x, 0, 10}]\)

f[1]

But wait! Is this series,

ArcTan[x] = x - x^3/3 + x^5/5 - x^7/7 +...

valid when  x = 1?  The answer is OK, but there is cause for care. (A careful look at

Limit[ ArcTan[ x ] , x-> 1]

WILL justify this computation with the ArcTan series.)

Oh, phooy, math professors are always fussing about convergence.  Let's get a formula for π.  Substitute  x = π in both sides of

x = 2( Sin[ x] - Sin[ 2 x ]/2 + Sin[ 3 x ]/3 + ... )

Print["According to the series π is approximately = ", 
      series[π, 20]];

Not too accurate, eh?

A Formula for (π^2)?

Let's take the formula

x = 2( Sin[ x] - Sin[ 2 x ]/2 + Sin[ 3 x ]/3 + ... )

and integrate both sides, obtaining

x^2 = 4( (Cos[ x ] - 1) - (Cos[2 x] - 1)/4 + (Cos[ 3 x ] - 1)/9 - ...)

(∫_0^x) t \[DifferentialD]t(∫_0^x)(((((-1))^(k + 1)) Sin[k t])/k) 
        \[DifferentialD]t

iSeries[x_, n_] := 
      4 (∑_(k = 1)^(1 n))(((((-1))^k) 
              (Cos[k x] - 1))/(k^2)); iSeries[x, 9]

Let's use this to get some approximations:

((((π/2)))^2) = iSeries[(π/2),Infinity]

or

((π^2)/16) = 1 - 1/2 + 1/9 + 1/25 - 1/18 + 1/49 + 1/81 - 1/50 +...

Here are some coefficients:

Table[(((((-1))^k) (Cos[k x] - 1))/(k^2)), {k, 1, 18}]Table[
      (((((-1))^k) (Cos[((k π)/2)] - 1))/(k^2)), {k, 1, 18}]

Let's test the approximation:

N[((((π/2)))^2)]N[iSeries[(π/2), 60]]

Excellent match.

Let's go for the gold.  Set  x = π, we should have

(π^2) = (x^2) = 4( (Cos[ x ] - 1) - (Cos[2 x] - 1)/4 + (Cos[ 3 x ] - 1)/9 - ...) with  x =π,

((π^2)/8) = 1 + 1/9 + 1/25 + 1/49 + ...+ 1/(2n+1)^2 + ..

Here are the coefficients:

Table[(((((-1))^k) (Cos[k x] - 1))/(k^2)), {k, 1, 18}]Table[(((((-1))^k) (Cos[k π] - 1))/(k^2)), {k, 1, 18}]

Let's check the approximation:

N[(π^2)]N[iSeries[π, 1000]]

Sluggish, but getting there.  Is this computation justified?  Here's a graphical look:

Plot[{(x^2), iSeries[x, 20]}, {x, -4, 4}, 
      AspectRatio -> Automatic, 
      PlotStyle -> {{Thickness[0.02], Red}, Blue}];

Exercise

Obtain series formulas for

\(π\/6 = 
\(π\/4 = 
\(π\/3 = \)\)\)

x = 2( Sin[ x] - Sin[ 2 x ]/2 + Sin[ 3 x ]/3 + ... )

and check the accuracy of your series.

HINT:

Table[(((((-1))^(k + 1)) Sin[k x])/k), {k, 1, 9}]Table[(((((-1))^(k + 1)) Sin[((k π)/4)])/k), {k, 1, 19}]

Obtain series formulas for

(π^2) =

using the series

(x^2) = 4( (Cos[ x ] - 1) - (Cos[2 x] - 1)/4 + (Cos[ 3 x ] - 1)/9 - ...)

at various vales of  x 	and check the accuracy of your series.

HINT:

Table[(((((-1))^k) (Cos[k x] - 1))/(k^2)), {k, 1, 18}]Table[
      (((((-1))^k) (Cos[((k π)/3)] - 1))/(k^2)), {k, 1, 18}]

Problem 26.2, Example 26.4: Log[ 2 ], Log[ 3], ...

We know the Taylor power series

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

Let's compare:

Clear[logSeries, x, n]logSeries[x_, n_] := 
      (∑_(k = 1)^n)(((((-1))^(k + 1)) (x^k))/k); logSeries[x, n]logSeries[x, 15]logSeries[0.5, 15]Log[1.5]

Let's substitute  x = 1 in the general expression

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

to get

Log[ 2 ] = 1 - 1/2 + 1/3 - 1/4 + ....

Check for accuracy:

Log[2.0]logSeries[1.0, 1000]

Not too accurate, but OK.

This is a great idea.  Lets find

Log[ 3 ] =Log[1 + x] = 
        x - ((x^2)/2) + ((x^3)/3) + ⋯ + 
          (((((-1))^(n + 1)) (x^n))/n) + ⋯
with x = 2.

Log[3.0]logSeries[2.0, 1000]

Whoa! WRONG answer.  Let's look at lots of values:

Table[logSeries[2.0, k], {k, 1, 100}]

Converging?

Problem 26.2

Explain why the previous calculation of Log[ 3 ] is not justified,

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

set  x=2, compute.

Another Approach to Log[ 3 ]

We know

Log[ A/B ] 
	= Log[ A B^(-1) ]
	= Log[ A ] + Log[ B^(-1) ]
	= Log[ A ] - Log[ B ]

so

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

Arithmetic shows

(1 + 1/2)/(1 - 1/2) = (3/2)/(1/2) = 3

so

Log[ 3 ] = 2(x + ((x^3)/3) + ((x^5)/5) + ⋯ + 
        ((x^(2 n + 1))/(2 n + 1)) + ⋯), with x = 1/2
			= 2 
        ((1/2) + (1/(3 (2^3))) + (1/(5 (2^5))) + ⋯)

Let's check:

Log[3.0]logSeries[0.5, 15] - logSeries[-0.5, 15]

Exercises

Exercise 26.3.5

Dirichlet's convergence theorem form the Math Background gives

((x^2)/4) - ((π x)/2) + ((π^2)/6) = 
        Cos[x] + (1/4) Cos[2 x] + (1/9) Cos[3 x] + ⋯

for certain values of  x.  Take a look:

Clear[x, n, series, f]; f[x_] := ((x^2)/4) - ((π x)/2) + ((π^2)/6); f[x]series[x_, n_] := (∑_(k = 1)^n) Cos[k x]/(k^2); series[x, 9]Plot[{f[x], series[x, 10]}, {x, -1, 7}, 
      PlotStyle -> {{Thickness[0.02], Red}, Blue}];

Let's substitute  x = 0:

((π^2)/6) = 1 + (1/4) + (1/9)+⋯

Clear[x]; Table[Cos[k x]/(k^2), {k, 1, 9}]x = 0; f[x]Table[Cos[k x]/(k^2), {k, 1, 13}]N[f[x]]N[series[x, 100]]

Derive another series expression for  (π^2)  by substituting another value of  x:

Clear[x]; Table[Cos[k x]/(k^2), {k, 1, 9}]x = (π/2); f[x]Table[Cos[k x]/(k^2), {k, 1, 19}]

((π^2)/6) = 2 (1 - (1/4) + ⋯ ?? )