Post · 2 min read· pp. 204–205

Summing a divergent series

The function

f(x)=∫0∞e−t1+xtdtf(x) = \int_0^{\infty} {e^{-t} \over 1 + xt} dt
is an easy one for Chebfun to evaluate. For example, the value at x=1x=1 is

text
format long
sum(chebfun(@(t) exp(-t)/(1+t),[0 inf]))
text
ans =
   0.596347362323193

It's not hard to make a Chebfun of the result, like this:

text
ff = @(x) sum(chebfun(@(t) exp(-t)/(1+x*t),[0 inf]));
f = chebfun(ff,[0,5]);
hold off, plot(f)
title('The integral f as a function of parameter x')

One of the interesting features of ff is that its derivatives at x=0x=0 are (0!)2,−(1!)2,(2!)2,−(3!)2,… .(0!)^2, -(1!)^2, (2!)^2, -(3!)^2, \dots. Chebfun manages to compute a few of these, at any rate, to good accuracy:

text
for j = 0:6
  fj = diff(f,j);
  fprintf('%21.12f  (should be %7.0f)\n',fj(0),(-1)^j*factorial(j)^2)
end
text
       1.000000000000  (should be       1)
      -0.999999999998  (should be      -1)
       3.999999996404  (should be       4)
     -35.999996324084  (should be     -36)
     575.997547930357  (should be     576)
  -14398.796599478534  (should be  -14400)
  517929.744379208831  (should be  518400)

In other words, at x=0x=0, ff has the asymptotic series

f(x)∼0!−1!x+2!x2−3!x3+⋯ .f(x) \sim 0! - 1!x + 2!x^2 - 3! x^3 + \cdots .
It can't be a Taylor series, because the terms increase too fast: the radius of convergence is zero.

And this brings us to the famous old problem of divergent series, going back to Euler in 1760 and with its own entry in Wikipedia [1]. What is the value of the series

0!−1!+2!−3!+⋯= ?0! - 1! + 2!- 3! + \cdots = ~?
Of course the series simply doesn't converge, from one point of view. But this didn't stop Euler and Hardy and many others from discussing what it might mean for such a series to have a limit. And of course we know one pretty good candidate for an answer, namely the value f(1)f(1) computed above:

text
f(1)
text
ans =
   0.596347362323191

Suppose we try to estimate this limit from those not-quite-Taylor coefficients. We could use the epsilon algorithm, which amounts to constructing a Pade approximation and evaluating it at z=1z=1. Here's the result, showing 2 digits of accuracy:

text
r = padeapprox((-1).^(0:10).*factorial(0:10),5,5);
r(1)
text
ans =
   0.597383362132805

At z=1/2z=1/2 we get 3 or 4 digits:

text
f(0.5)
r(0.5)
text
ans =
   0.722657233776442
ans =
   0.722739361702127

References

  1. http://tiny.cc/wiki_diverge_series/