Example of Padé acceleration

Acceleration of (divergent) power series expansion of f 
        (z) = 
      (∫_0^∞) ((e^(-t))/(1 + zt)) 
            dt  around z = 0

Display of function

\(TraditionalForm
    \`The\ function\ features\ a\ branch\ cut\ along\ the\ negative\ real\ 
      axis, \ very\ clearly\ visible\ by\ displaying\ its\ imaginary\ part\ 
        around\ the\ origin\ in\ the\ complex\ z - plane\)

Plot3D[
      Im[NIntegrate[
          Exp[-t]/(1 + (x + I y) t), {t, 0, ∞}]], {x, 
        -3, 3}, {y, -3, 3}, PlotPoints -> 20]

Since the branch point is located at z  =  0, 
    a power series expansion at this point must have zero radius of
       convergence.

Generation of power series

\(TraditionalForm
    \`We\ can\ get\ the\ power\ series\ expansion\ of\ \ \(f(z)\) = 
      \(∫\_0\%∞\( e\^\(-t\)\/\(1 + zt\)\) 
            dt\ \ around\ z = 
        0\ for\ example\ by\ repeated\ integration\ by\ parts\), \ 
    or\ by\ ' expansion'\ after\ noting\ that\ \ \(f(z)\)\ satisfies\ \ z^2\ 
          \(f'\)[z] + \((1 + z)\)\ f[z] - 1 == 0\ , \ \ 
    with\ initial\ condition\ \ f[0] = \(1 : \)\)

n = 8;  f[z_] := 1 + Sum[a[i] z^i, {i, 1, n}] + O[z]^(n + 1); 
    LogicalExpand[z^2 f'[z] + (1 + z) f[z] - 1 == 0]Solve[%]

\(TraditionalForm
    \`The\ power\ series\ expansion\ becomes\ 
      \(∑\+\(k = 0\)\%∞\((\(-z\))\)\^k\ \(k!\)\)\ , \ 
    and\ this\ indeed\ diverges\ for\ all\ values\ of\ \(z.\)\)

Comparison of truncated power series with its Padé approximation

We calculate for example 6 terms of the power series expansion

n = 6 ;  f = Sum[(-z)^k k!, {k, 0, n}]

As expected, this entirely fails to represent the function even quite near the origin

z = x + I y ; 
    Plot3D[Im[f], {x, -1, 1}, {y, -1, 1}, PlotPoints -> 20]

To use the routine Padé,  
    a special ibrary needs first to be loaded

<< Calculus`Pade`

\(TraditionalForm
    \`We\ now\ convert\ the\ \((very\ bad)\)\ polynomial\ approximation\ into
      \ its\ Padé\ counterpart\)

Clear[z];   p = Pade[f, {z, 0, n/2, n/2}]

and plot it

\(z = x + I\ y\ ; 

    Plot3D[Im[p], {x, \(-1\), 1}, {y, \(-1\), 1}, PlotPoints -> 20]\)

Not only does this approximation stay bounded  away from the origin, it has even (although somewhat crudely) managed to approximate the branch cut. We next compare the power series approximation and its Pade approximation (solid lines) with the exact result (dashed line) for values along the positive real axis:

\(pl = 
      Plot[{f, p}, {z, 0, 3}, PlotRange -> {0, 2}, 
        DisplayFunction -> Identity]; 

    p2 = Plot[
        NIntegrate[Exp[\(-t\)]/\((1 + z*t)\), {t, 0, Infinity}], {z, 0, 3}, 
        PlotStyle -> Dashing[{0.05, 0.05}], PlotRange -> {0, 2}, 
        DisplayFunction -> Identity]; 
    Show[{pl, p2}, DisplayFunction -> $DisplayFunction]\)

This illustrates that a truncated, even divergent power series somehow does contain a lot more information than is apparent from direct summation. For analytic functions, conversion to a rational function via a Padé approximation recovers much of this 'concealed' information. In the contect of asymptotic- and perturbation expansions, Padé expansion of the brief power series obtained can much improve their utility.