Shanks transformation: Example 2

To illustrate the Shanks transformation we will use the following series:

\displaystyle \ln(x) = (x-1)-\frac{1}{2}(x-1)^2+\frac{1}{3}(x-1)^3-\dots
\displaystyle \ln(x) = \sum_{n=1}^{\infty} (-1)^{n+1} \frac{(x-1)^n}{n}

This series is converging very slowly. To illustate this we will compute ln(2):

\displaystyle \ln(2) = 1 - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} + \frac{1}{5} + \dots
\displaystyle \ln(2) = \sum_{n=1}^{\infty} (-1)^{n+1} \frac{1}{n}

The corresponding partial sum of ln(2) is:

\displaystyle S_N = \sum_{n=1}^{N} (-1)^{n+1} \frac{1}{n}

Let calculate some terms of this partial sum:

\displaystyle S_1 = 1 \quad S_{10} = 0.6456
\displaystyle S_2 = 0.5 \quad S_{400} = 0.6919
\displaystyle S_3 = 0.8333 \quad \ln(2) = 0.6931

Perform the Shanks transform (using SN = S4):

\displaystyle S_4 = 1 - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} = \frac{12}{12} - \frac{6}{12} + \frac{4}{12} - \frac{3}{12} = \frac{7}{12}
\displaystyle S_4^2 = \frac{49}{144}
\displaystyle S_5 = \frac{7}{12} + \frac{1}{5} = \frac{35}{60} + \frac{12}{60} = \frac{47}{60}
\displaystyle S_3 = 1 -\frac{1}{2} + \frac{1}{3} = \frac{6}{6} - \frac{3}{6} + \frac{2}{6} = \frac{5}{6}
\displaystyle \mathcal{S} = \frac{S_N^2 - S_{N+1}S_{N-1}}{2S_N -S_{N+1}- S_{N-1}}
\displaystyle \mathcal{S} = \frac{\frac{49}{144} - (\frac{47}{60} \frac{5}{6})}{\frac{14}{12} - \frac{47}{60} -\frac{5}{6}}
\displaystyle \mathcal{S} = \frac{\frac{49}{144} - \frac{235}{360}}{\frac{70}{60} - \frac{47}{60} -\frac{50}{60}}
\displaystyle \mathcal{S} = \frac{-225/720}{-27/60}
\displaystyle \mathcal{S} = 0.6944

Since S_{358} = 0.6918 and \ln(2) = 0.6931 It is necessary to calculate up to 358 terms of the partial sum SN to obtain a relative error equal to that of the Shanks transformation \mathcal{S} based on the first 4 terms.

Comments

Leave a comment