Hide code cell content

%pylab inline
import numpy as np, matplotlib.pyplot as plt
%pylab is deprecated, use %matplotlib inline and import the required libraries.
Populating the interactive namespace from numpy and matplotlib

1. Mathematical Preliminaries#

These notes are intended as a supplement and alternative perspective to [Arfken et al., 2013].

TL;DR#

Seriously: You must read and work through enough problems until you are comfortable with these techniques! Here is an overall strategy for checking if a series \(S = \sum_{n} a_n\) converges or diverges:

  1. Look at the asymptotic form for large \(n\) and compare with the integral:

    \[\begin{gather*} \int^{\infty} a_n\d{n}. \end{gather*}\]

    The series converges / diverges with the integral. This immediately tells you that the Harmonic series is divergent, and that the Riemann Zeta function \(\zeta(s)\) converges for \(s>1\).

  2. To derive various tests compare to slowly converging or diverging series. The more slowly diverging, the more sensitive (but complicated) the test. The most sensitive test we consider is comparison with \(u_n = 1/(n\ln ^s n)\):

    \[\begin{gather*} \frac{u_{n+1}}{u_{n}} \rightarrow \frac{(n+1)\ln^s(n+1)}{n\ln^s n} \rightarrow 1 - \frac{1}{n} - \frac{s}{n\ln n} + O(\tfrac{1}{n^2}). \end{gather*}\]

Common Series#

It is useful to recognize the following series:

  • Harmonic (divergent):

    \[\begin{gather*} \sum_{n=1}^{\infty} \frac{1}{n} = \frac{1}{1} + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} \dots. \end{gather*}\]

    Related is the following, which diverges even more slowly for \(s=1\):

    \[\begin{gather*} \sum_{n=2}^{\infty} \frac{1}{n(\ln n)^{s}}. \end{gather*}\]

    This diverges for \(s \leq 1\) and converges for \(s>1\).

  • Geometric (convergent for \(0 \leq \abs{r} < 1\)):

    \[\begin{gather*} \sum_{n=1}^{\infty} \frac{1}{r^n} = 1 + r + r^2 + r^3 = \dots = \frac{1}{1-r}. \end{gather*}\]
  • Riemann Zeta function shows up in various places, and has known values for even integers:

    \[\begin{gather*} \zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s}, \qquad \zeta(2) = \frac{\pi^2}{6}, \qquad \zeta(4) = \frac{\pi^4}{90}, \end{gather*}\]

    and some other particular values.

Convergence Tests#

Here we consider absolute convergence of the series

\[\begin{gather*} S = \sum_{n=n_0}^{\infty} a_n. \end{gather*}\]
  1. The easiest way of testing convergence is by comparing with another series known to be convergence or divergent. Comparison with the geometric series \(u_n = r^n\) gives the Cauchy Root Test:

    \[\begin{gather*} a_n^{1/n} \leq r < 1, \end{gather*}\]

    and (slightly less powerful) D’Alembert (or Cauchy) Ratio Test:

    \[\begin{gather*} \Abs{\frac{a_{n+1}}{a_{n}}} \rightarrow r, \qquad \begin{cases} r < 1 & \text{converge},\\ r = 1 & \text{inconclusive},\\ r > 1 & \text{diverge}. \end{cases} \end{gather*}\]

    The inconclusive case of \(r=1\) can be refined by comparing with \(\zeta(s)\) where \(u_n = n^s\), which converges (diverges) for \(s>1\) (\(s>1\)) giving a more sensitive test:

    \[\begin{gather*} \Abs{\frac{a_{n+1}}{a_{n}}} \rightarrow 1 - \frac{s}{n}, \qquad \begin{cases} s > 1 & \text{converge},\\ s = 1 & \text{inconclusive},\\ s < 1 & \text{diverge}. \end{cases} \end{gather*}\]

    Again, this is inconclusive for \(s=1\), but comparison with \(u_n = 1/(n\ln^t n)\) gives an even more sensitive test

    \[\begin{gather*} \Abs{\frac{a_{n+1}}{a_{n}}} \rightarrow 1 - \frac{1}{n} - \frac{t}{n \ln n}, \qquad \begin{cases} t > 1 & \text{converge},\\ t = 1 & \text{inconclusive},\\ t < 1 & \text{diverge}. \end{cases} \end{gather*}\]

    Or, in summary:

    \[\begin{gather*} \Abs{\frac{a_{n+1}}{a_{n}}} \rightarrow r - \frac{s}{n} - \frac{t}{n\ln n}, \qquad \begin{cases} r < 1 & \text{convergence}\\ r > 1 & \text{divergence}\\ r = 1 & \begin{cases} s > 1 & \text{convergence}\\ s < 1 & \text{divergence}\\ s = 1 & \begin{cases} t > 1 & \text{convergence}\\ t < 1 & \text{divergence}\\ t = 1 & \text{inconclusive} \end{cases} \end{cases} \end{cases} \end{gather*}\]
  2. Another easy way to check for convergence is to compare to an integral. If \(a_n = f(n)\) with \(f(n)\) monotonically decreasing, then \(S\) converges or diverges a the integral

    \[\begin{gather*} \int^{\infty}f(n)\d{n}, \qquad 0 \leq S - \int^{\infty}_{n_0}f(n)\d{n} \leq a_{n_0}. \end{gather*}\]

    This allows us to establish the divergence of the harmonic series and the convergence of \(\zeta(s)\) and \(u_n = 1/(n\ln^s n)\) for \(s > 1\):

    \[\begin{gather*} \int^{N}\frac{\d{n}}{n} \rightarrow \ln N,\qquad \int^{N}\frac{\d{n}}{n^s} \rightarrow \frac{1}{(1-s)N^{s-1}},\qquad \int^{N}\frac{\d{n}}{n(\ln n)^s} \rightarrow \frac{1}{(1-s)\ln^{s-1} N}. \end{gather*}\]

These tests should deal with most of the series you might encounter in physics.

Familiar Power Series#

You should be familiar with the following McLauren series:

\[\begin{alignat*}{4} (1+x)^n &= 1 + nx + n(n-1)\frac{x^2}{2!} + \cdots &&= \sum_{m=0}^{\infty}\frac{n!}{(n-m)!}\frac{x^{m}}{m!} = \sum_{m=0}^{\infty}\binom{n}{m}x^{m},\\ e^{x} &= 1 + \frac{x}{1!} + \frac{x^2}{2!} + \cdots &&= \sum_{m=0}^{\infty}\frac{x^{m}}{m!}\\ \sin x &= x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots &&= \sum_{m=0}^{\infty}\frac{(-1)^{m}x^{2m+1}}{(2m+1)!},\\ \cos x &= 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots &&= \sum_{m=0}^{\infty}\frac{(-1)^{m}x^{2m}}{(2m)!},\\ \ln(1+x) &= x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \cdots &&= \sum_{m=1}^{\infty}\frac{(-x)^{m}}{m},\\ \tan^{-1}x &= x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \cdots &&= \sum_{m=0}^{\infty}\frac{(-1)^{m}x^{2m+1}}{(2m+1)}. \end{alignat*}\]

Less Familiar Power Series#

The Bernoulli numbers \(B_n\) appear in

\[\begin{gather*} \frac{x}{e^{x}-1} = \sum_{n=0}^{\infty} B_n\frac{x^n}{n!}. \end{gather*}\]

Manipulating Power Series#

Some useful techniques include relating a simple series to a power series evaluated at a specific point. The later might be manipulated by integration or differentiation.

Formal Power Series#

One is generally interested in power series that converge, however, one can consider manipulations and formulae related to the coefficients of a formal power series without consideration of convergence. These should be thought of as algebraic manipulations of the coefficients, expressing the results of manipulations like multiplying, series, inverting series, differentiating series, etc. Some of the results here and in the book can be studied in this framework.

Inversion#

We can invert a power series \(y = a_1x + a_2x^2 + \cdots\) locally if \(a_1 \neq 0\) by brute force as shown in the book

\[\begin{gather*} y = \sum_{n=1}^{\infty} a_n x^n, \qquad x = \sum_{n=1}^{\infty} b_n y^n,\\ b_1 = \frac{1}{a_1}, \qquad b_2 = - \frac{a_2}{a_1^3}, \qquad \cdots. \end{gather*}\]

The book mentioned another technique based on complex analysis described in the 1st and 2nd editions, but I cannot find these to check. I expect this is based on the Lagrange inversion theorem which states that if

\[\begin{gather*} z = f(w) \end{gather*}\]

is analytic at \(w=0\) and \(f'(0) \neq 0\), then we can locally invert this to find a function \(g = f^{-1}\) where \(w = g(z)\):

\[\begin{gather*} w = g(z) = \sum_{n=1}^{\infty} g_n \frac{z^n}{n!}, \qquad g_n = \lim_{w\rightarrow 0} \diff[n-1]{}{w}\left(\frac{w}{f(w)}\right)^n \end{gather*}\]

Example: Lambert \(W\) function \(we^w = z\).

Though not a power series, the Lagrange inversion theorem is helpful for computing a series expansion for the Lambert \(W\) function \(W(z)\):

\[\begin{gather*} w = W(z), \qquad z = f(w) = we^w. \end{gather*}\]

We need to compute

\[\begin{gather*} \diff[n-1]{}{w}\left(\frac{w}{we^w}\right)^n = \diff[n-1]{e^{-nw}}{w} = (-n)^{n-1}e^{-nw}, \end{gather*}\]

so we have

\[\begin{gather*} g_n = (-n)^{n-1}, \qquad W(z) = \sum_{n=1}^{\infty} \frac{(-n)^{n-1}z^{n}}{n!} = z - z^{2} + \frac{3z^{3}}{2} -\frac{8z^{4}}{3} + \dots \end{gather*}\]

Improving Convergence#

Several strategies exist for improving convergence:

  • Subtracting a known series (comparing with an integral can sometimes help).

  • Expanding in partial fractions may allow you to identify parts of a series, summing them analytically.

  • Accelerating convergence. Please see Appendix A of [Bornemann et al., 2004] for a great description of many acceleration techniques. The method due to Euler describe in the text can be explained more generally as follows:

    To accelerate a series \(f(x)\), consider the related series \(g(x)\) whose sum is known. We relate the two series by coefficients \(c_n\):

    \[\begin{gather*} g(x) = \sum_{n=0}^{\infty} b_n x^n, \qquad f(x) = \sum_{n=0}^{\infty} c_nb_n x^n. \end{gather*}\]

    One can solve this terms by term to eliminate \(b_n\) to obtain

    \[\begin{gather*} f(x) = c_0 g(x) + (c_1-c_0)xg'(x) + (c_1-2c_1+c_0)\frac{x^2g''(x)}{2!} + (c_3 - 3c_2 + 3c_1 - c_0)\frac{x^3 g''(x)}{3!} + \cdots. \end{gather*}\]

    The successive terms in this series are the leading differences in the difference table for the coefficients \(c_n\):

    \[\begin{align*} c_0 \qquad & \\ & c_1 - c_0\\ c_1 \qquad & & c_2 - 2c_1 + c_0 &\\ & c_2 - c_1 & & \qquad c_3 - 3c_2 + 3c_1 - c_0\\ c_2 \qquad & & c_3 - 2c_2 + c_1 &\\ & c_3 - c_2 &\\ c_3 \qquad \end{align*}\]

    Comparison with \(g(x) = 1/(1+x)\) where \(b_n = (-1)^n\) yields Euler’s method described in the book.