ch7 MATHEMATICA tutorial, Part 4: Convergence

Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to computing page for the fourth course APMA0360
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to Mathematica tutorial for the fourth course APMA0360
Return to the main page for the first course APMA0330
Return to the main page for the second course APMA0340
Return to the main page for the fourth course APMA0360
Return to Part II of the course APMA0360
Introduction to Linear Algebra with Mathematica

Preface


Convergence


Let { 𝑎n }n≥0 be a sequence of (real or complex) numbers. We say that \( \sum_{n\ge 0} a_n \) converges to L if

\[ \lim_{N\to\infty} \sum_{n=0}^N a_n = L . \]
Sometimes, this relationship is abbreviates as
\[ \sum_{n\ge 0} a_n = \sum_{n= 0}^{\infty} a_n = L . \]
However, the equal sign undoubtedly originates from a time when the true nature of a limit process was not clearly understood. Hence, we prefer to use tilde (∼) instead of equal sign (=) in the right-hand side to signify that the equal sign does not mean really "equal," but has to be understood as "as nearly equal as we wish:"
\[ \sum_{n\ge 0} a_n \sim L \qquad\mbox{or} \qquad L \sim \sum_{n= 0}^{\infty} a_n . \]

We say that \( \sum_{n\ge 0} a_n \) converges absolutely if \( \sum_{n\ge 0} \vert a_n \vert \) converges. In case \( \sum_{n\ge 0} a_n \) converges, but does not converge absolutely, we say that \( \sum_{n\ge 0} a_n \) converges conditionally or is conditionally convergent. Note that absolute convergence implies convergence, but that the converse fails.

Theorem 1: If 𝑎n is approaching 0 monotonically, then the following estimate holds
\[ \left\vert \sum_{n\ge 0} (-1)^n a_n - \sum_{k=1}^m (-1)^k a_k \right\vert \le \left\vert a_{m+1} \right\vert . \]
Bernhard Riemann proved that a conditionally convergent series may be rearranged to converge to any value at all, including ∞ or −∞ (see Riemann series theorem).

Therefore, numerical evaluation of a conditionally convergent series is an ill-posed problem that usually requires a regularization. For instance, your computer evaluates trigonometric functions using Padé approximations but not alternating Taylor series

\[ \sin x = \sum_{k\ge 0} (-1)^k \frac{x^{2k+1}}{(2k+1)!} , \qquad \cos x = \sum_{k\ge 0} (-1)^k \frac{x^{2k}}{(2k)!} . \]
Example 1: Let us consider the alternating series
\[ \ln (2) = \sum_{k\ge 1} \frac{(-1)^{k+1}}{k} = \sum_{k= 1}^{\infty} \frac{(-1)^{k+1}}{k} \approx 0.693147 . \tag{1.1} \]
Sum[(1/n)*(-1)^(n + 1), {n, 1, Infinity}]
Log[2]
N[Log[2]]
Despite Mathematica "knows" the limit to be ln(2), we are unable to tell what the limit of the infinite sequence (1.1) will be because it is an irrational number. We can approximate this limit by rational partial sums with arbitrary accuracy, but we have no way of defining this irrational number by a finite construction that would not involve a limit process.

Since series (1.1) does not converge absolutely, we can rearrange the terms to obtain a series for ½ln(2):

\begin{align*} \ln (2) &= \left( 1 - \frac{1}{2} \right) - \frac{1}{4} + \left( \frac{1}{3} - \frac{1}{6} \right) - \frac{1}{8} + \left( \frac{1}{5} - \frac{1}{10} \right) - \frac{1}{12} + \cdots \\ &= \frac{1}{2} - \frac{1}{4} + \frac{1}{6} - \frac{1}{8} + \frac{1}{10} - \frac{1}{12} + \cdots \\ &= \frac{1}{2} \left( 1 - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} + \frac{1}{5} - \frac{1}{6} + \cdots \right) \\ &= \frac{1}{2}\, \ln (2) \approx 0.346574. \end{align*}
Let Sn denote the n-th partial sum (which is a rational number for any n∈ ℕ)
\[ S_n = \sum_{k=1}^n \frac{(-1)^{k+1}}{k} . \tag{1.2} \]
The rearrangment above shows that
\[ S_{10} = \sum_{k=1}^{10} \frac{(-1)^{k+1}}{k} = \frac{1}{2} \, S_5 + \frac{1}{7} + \frac{1}{9} . \]
Sum[(1/n)*(-1)^(n + 1), {n, 1, 10}]
1627/2520
Sum[(1/n)*(-1)^(n + 1), {n, 1, 5}]/2 + 1/7 + 1/9
1627/2520
Also,
\begin{align*} S_{12} & = \frac{1}{2}\, S_6 + \varepsilon_6 , \qquad \varepsilon_6 = \frac{1}{7} + \frac{1}{9} + \frac{1}{11} = \frac{239}{693} \approx 0.344877, \\ S_{14} & = \frac{1}{2}\, S_7 + \varepsilon_7 , \qquad \varepsilon_7 = \frac{1}{9} + \frac{1}{11} + \frac{1}{13} = \frac{359}{1287} \approx 0.278943, \\ S_{16} & = \frac{1}{2}\, S_8 + \varepsilon_8 , \qquad \varepsilon_8 = \frac{1}{9} + \frac{1}{11} + \frac{1}{13} + \frac{1}{15} = \frac{2224}{6435} \approx 0.34561, \\ S_{18} & = \frac{1}{2}\, S_9 + \varepsilon_9 , \qquad \varepsilon_9 = \frac{1}{11} + \frac{1}{13} + \frac{1}{15} + \frac{1}{17} = \approx 0.293322, \\ S_{20} & = \frac{1}{2}\, S_{10} + \varepsilon_{10} , \qquad \varepsilon_{10} = \frac{1}{11} + \frac{1}{13} + \frac{1}{15} + \frac{1}{17} + \frac{1}{19} = \frac{239689}{692835} \approx 0.345954 , \\ S_{200} & = \frac{1}{2}\, S_{100} + \varepsilon_{100} , \qquad \varepsilon_{100} \approx 0.346567 . \end{align*}
A similar result is valid for any even index:
\[ S_{2N} = \sum_{k=1}^{2N} \frac{(-1)^{k+1}}{k} = \frac{1}{2} \, S_N + \varepsilon_N , \tag{1.3} \]
where εN is a rational number that approaches (½)ln(2) ≈ 0.3465735902799727 as N → ∞.
Sum[(1/n)*(-1)^(n + 1), {n, 1, 200}] - Sum[(1/n)*(-1)^(n + 1), {n, 1, 100}]/2 - Sum[1/(2*k + 1), {k, 50, 99}]
0
Sum[1/(2*k + 1), {k, 50, 99}]
5735585996734904356954906125146895918738857109074007804725023892070250 52/1654970137420573382151630241522764878072019254051202158147899690950 368375
End of Example 1

A function f(x) is continuous in a closed domain if, given any ε > 0, there exists a δ > 0 such that |f(x) − f(ζ)| < ε for all |x − ζ| < δ in the domain.

An equivalent definition is that f(x) is continuous in a closed domain if
\[ \lim_{\zeta\to x} f(\zeta ) = f(x) \]
for all |x in the domain.

Consider a series in which the terms are functions of x, >  \( \displaystyle \sum_{n\ge 0} a_n (x) . \) The series is convergent in a domain if the series converges for each point x in the domain. We can then define the function \( \displaystylef(x) = \sum_{n\ge 0} a_n (x) . \) We can state the convergence criterion as: For any given ε > 0, there exists a function N(x) such that
\[ \left\vert f(x) - \sum_{n=0}^N a_n (x) \right\vert < \varepsilon \]
for all x in the domain. Note that the rate of convergence, i.e., the number of terms, N(x) required for for the absolute error to be less than ε, is a function of x.

The expression \( A_N = \sum_{n= 0}^N a_n \) is called the N-th partial sum (however, it is more common apply this definition to sums that start from 1, as \( A_N = \sum_{n= 1}^N a_n \) ).

Lemma 1: (Summation by parts) For 1 ≤ jN, consider complex or real numbers 𝑎j and bj, with \( B_N = \sum_{n= 1}^N b_n . \) Then
\[ \sum_{j=1}^N a_j b_j = a_N B_N - \sum_{j=1}^{N-1} \left( a_{j+1} - a_j \right) B_j . \]

Corollary 1: Suppose 𝑎n → 0 and that \( \sum_{n\ge 0} \left\vert a_{n+1} - a_n \right\vert \) converges. Assume also that the sequence { BN } of partial sums is bounded. Then \( \sum_{n\ge 0} a_{n} b_n \) converges.

Corollary 2: Suppose 𝑎n decreases monotonically to 0. Then \( \sum_{n\ge 0} (-1)^n a_n \) converges.

Uniform Convergence


Suppose { fn } is a sequence of continuous functions on [0, 1] (it can be any finite interval not necessarily [0, 1]). We assume that \( \lim_{n \to \infty} f_n (x) = f(x) \) exists for every x∈[0, 1], and inquire as to the nature of the limiting function f(x).

If we suppose that the convergence is uniform, matters are straight-forward and f is then everywhere continuous. However, once we drop the assumption of uniform convergence, things may change radically and the issues that arise can be quite subtle. An example of this is given by the fact that one can construct a sequence of continuous functions { fn(x) } converging everywhere to f(x) so that it is not Riemann integrable. So the relation

\[ \int_0^1 f(x)\,{\text d}x = \lim_{n\to \infty} \int_0^1 f_n (x)\,{\text d}x \]
holds with Lebesgue integration, but not the Riemann one. For example, let
\[ f_n (x) = \begin{cases} n, & \ \mbox{ if } \ 0 < x < 1/n , \\ 0 , & \ \mbox{ otherwise. } \end{cases} \]
Then fn(x) → 0 for every x, yet \( \int f_n (x)\,{\text d}x = 1 \) for all n ∈ ℕ = {0,1,2, …}.

     
p1 = Plot[x^2, {x, -1, 1}, PlotStyle -> {Black, Thickness[0.01]}];
p2 = Plot[{(x^2) - 1, (x^2) + 1}, {x, -1, 1}, PlotStyle -> Gray, Filling -> {1 -> {2}} ];
p3 = Plot[(l^2 + Sqrt[Abs[l]]*Sin[10*l^2]), {l, -1, 1}, PlotStyle -> {Thick, Blue}];
Show[p1, p2, p3, PlotRange -> All]
       Uniform convergence.            Mathematica code

Consider a series in which the terms are functions of x, >  \( \displaystyle \sum_{n\ge 0} a_n (x) \) that is convergent in some domain. If the rate of convergence is independent of x, then the series is said to be uniformly convergent. Stating this a little more mathematically, the series is uniformly convergent in the domain if for any given ε > 0 there exists an N, independent of x, such that
\[ \left\vert f(x) - \sum_{n=0}^N a_n (x) \right\vert < \varepsilon \]
for all x in the domain.

There are known some tests that guarantee uniform convergence of a series.

Weierstrass M-test: The series \( \displaystyle \sum_{n\ge 0} a_n (x) \) is uniformly and absolutely convergent in a domain if there exists a convergent series of positive terms \( \displaystyle \sum_{n\ge 0} M_n \) such that \( \displaystyle \left\vert a_n (x) \right\vert \le M_n . \)

The Weierstrass M-test first implies that the series is absolutely convergent for all x in the domain. The condition |𝑎n(x)| ≤ Mn also ensures that the rate of convergence is independent of x, which is the criterion for uniform convergence

Note that absolute convergence and uniform convergence are independent. A series of functions may be absolutely convergent without being uniformly convergent or vice versa. The Weierstrass M-test is a sufficient but not a necessary condition for uniform convergence. The Weierstrass M-test can succeed only if the series is uniformly and absolutely convergent.

Example 2: The series
\[ f(x) = \sum_{n\ge 1} \frac{\cos x}{n \left( n+1 \right)} \]
is uniformly and absolutely convergent for all real x because
\[ \left\vert \frac{\cos x}{n \left( n+1 \right)} \right\vert < \frac{1}{n^2} \]
and the series Σ n−2 converges.
Dirichlet test: Consider a sequence of monotone decreasing, positive constants cn with limit zero. If all the partial sums of 𝑎n(x) are bounded in some closed domain, that is
\[ \left\vert \sum_{n=0}^N a_n (x) \right\vert < \mbox{constant} \]
for all N, then \( \displaystyle \sum_{n\ge 0} c_n a_n (x) \) is uniformly convergent in that closed domain.

Note that the Dirichlet test does not imply that the series is absolutely convergent.

Example 3: Consider the series
\[ \sum_{n\ge 1} \frac{\sin (nx)}{n} . \]
We cannot use the Weierstrass M-test to determine if the series is uniformly convergent on an interval. While it is easy to bound the terms with |sin(nx)| ≤ 1/n. the corresponding harmonic series Σn−1 diverges.

Thus, we will try the Dirichlet test. Consider the sum

\[ \sum_{n= 1}^{N-1} \sin (nx) = \frac{\cos (x/2) - \cos \left( (N-1/2)x \right)}{2\,\sin (x/2)} \qquad\mbox{for}\quad x \ne 2\pi k . \]
Obviously, the sum is zero when x = 2&pik, k ∈ ℤ. The partial sums have infinite discontinuities at x = 2πk. The partial sums are bounded on any closed interval that does not contain an integer multiple of 2π. By the Dirichlet test, the sum \( \displaystyle \sum_{n\ge 1} \frac{\sin (nx)}{n} is uniformly convergent on any such closed interval. The series may not be uniformly convergent in neighborhoods of x = 2πk.

Consider a series \( \displaystyle f(x) = \sum_{n\ge 0} a_n (x) \) that is uniformly convergent in some domain and whose terms 𝑎n(x) are continuous functions. Since the series is uniformly convergent, for any given positive ε there exists an N such that | RNx in the domain.

 

  1. Osler, T.J., A remarkable formula for approximating the sum of alternating series, The Mathematical Gazette, 2009, Vol. 93, No. 526, pp. 76--82.
  2. Phulip, J.R., The convergence and partial convergence of alternating series, Mathematics of Computations, 1980, Vol. 35, N. 151l pp. 907--916.

 

Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to computing page for the fourth course APMA0360
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to Mathematica tutorial for the fourth course APMA0360
Return to the main page for the course APMA0330
Return to the main page for the course APMA0340
Return to the main page for the course APMA0360
Introduction to Linear Algebra with Mathematica