Thursday 22 April 2021

Alternating Series Test

Just lately, I fell to wondering what the sum of the following infinite series was:$$1-\frac{1}{2}+\frac{1}{3}-\frac{1}{4}+\frac{1}{5}-\cdots = \sum_{n=1}^{\infty}(-1)^{n+1} \, \frac{1}{n}$$This can be called the alternating harmonic series. I knew that the harmonic series diverged but I was certain its alternating equivalent was convergent. But what did it converge to? Of course, the answer to such questions is always close at hand but the question had been bouncing around in my head without my doing anything to answer it. Today, I decided to answer it.

It turns out that the question of convergence of this sum can be decided for a much broader category of sums using what's referred to the Alternating Series Test but also Leibniz's test, Leibniz's rule, or the Leibniz criterion. Here is a statement of the test:

A series of the form:$$\sum_{n=0}^{\infty} (-1)^{n} a_n = a_0-a_1 + a_2 - a_3 + \cdots$$where \(a_n\) are all positive (or all negative) is called an alternating series. The alternating series test then says that if |\(a_n\)| decreases monotonically and \( \displaystyle \lim_{n \rightarrow \infty} a_n=0\) then the alternating series converges.

There are plenty of sources that will prove this to be true but I'll just use the result here, namely that the series converges because it satisfies the alternating test criteria. The question remains however, of what the sum converges to. Let's use SageMathCell to find the answer. Figure 1 shows the result.


Figure 1: permalink
$$ \text{Thus we see that }\sum_{n=1}^{\infty}(-1)^{n+1} \, \frac{1}{n}=\ln{2} $$This result is in fact a particular instance of a more general sum:$$x-\frac{x^2}{2}+\frac{x^3}{3}-\frac{x^4}{4}+ \cdots =\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} x^n = \ln (1+x)$$This infinite series is known as the Mercator or Newton-Mercator series and, when \(x=1\) it becomes the alternating harmonic series. The series converges to the natural logarithm (shifted by 1) whenever \( -1<x\leq 1 \). Reference

Again, SageMathCell will generate the correct result as shown in Figure 2.


Figure 2: permalink

It's relatively easy to prove that:$$\ln (1+x)=\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} x^n $$Here is the proof as described in Wikipedia:

Start with the finite geometric series where \( t \ne -1 \):$$\begin{align} \frac{1-(-t)^n}{1+t}&=1-t+t^2-\cdots+(-t)^{n-1}\\
\frac1{1+t}&=1-t+t^2-\cdots+(-t)^{n-1}+\frac{(-t)^n}{1+t}\\
\int_0^x \frac{dt}{1+t}&=\int_0^x \left(1-t+t^2-\cdots+(-t)^{n-1}+\frac{(-t)^n}{1+t}\right)\ dt\\
\ln(1+x)&=x-\frac{x^2}{2}+\frac{x^3}{3}-\cdots+(-1)^{n-1}\frac{x^n}{n}+(-1)^n \int_0^x \frac{t^n}{1+t}\ dt\\
&= \sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} x^n \end{align}$$
This is because the remainder term tends to 0 as \( n \to \infty \) if \( -1< x \le 1 \). This is apparent if you graph \( \displaystyle \frac{t^n}{1+t} \) as shown in Figure 3 for \(n=50\).


Figure 3: created in GeoGebra

That will do for this post. There is a lot more that can be said about convergent alternating series and I may look at some more examples at a later date.

No comments:

Post a Comment