Gauss's continued fraction

In complex analysis, Gauss's continued fraction is a particular class of continued fractions derived from hypergeometric functions. It was one of the first analytic continued fractions known to mathematics, and it can be used to represent several important elementary functions, as well as some of the more complicated transcendental functions.

History
Lambert published several examples of continued fractions in this form in 1768, and both Euler and Lagrange investigated similar constructions, but it was Carl Friedrich Gauss who utilized the algebra described in the next section to deduce the general form of this continued fraction, in 1813.

Although Gauss gave the form of this continued fraction, he did not give a proof of its convergence properties. Bernhard Riemann and L.W. Thomé obtained partial results, but the final word on the region in which this continued fraction converges was not given until 1901, by Edward Burr Van Vleck.

Derivation
Let $$f_0, f_1, f_2, \dots$$ be a sequence of analytic functions so that
 * $$f_{i-1} - f_i = k_i\,z\,f_{i+1}$$

for all $$i > 0$$, where each $$k_i$$ is a constant.

Then
 * $$\frac{f_{i-1}}{f_i} = 1 + k_i z \frac{f_{i+1}}, \text{ and so } \frac{f_i}{f_{i-1}} = \frac{1}{1 + k_i z \frac{f_{i+1}}}$$

Setting $$g_i = f_i / f_{i-1},$$
 * $$g_i = \frac{1}{1 + k_i z g_{i+1}},$$

So
 * $$g_1 = \frac{f_1}{f_0} = \cfrac{1}{1 + k_1 z g_2} = \cfrac{1}{1 + \cfrac{k_1 z}{1 + k_2 z g_3}}

= \cfrac{1}{1 + \cfrac{k_1 z}{1 + \cfrac{k_2 z}{1 + k_3 z g_4}}} = \cdots.\ $$

Repeating this ad infinitum produces the continued fraction expression
 * $$\frac{f_1}{f_0} = \cfrac{1}{1 + \cfrac{k_1 z}{1 + \cfrac{k_2 z}{1 + \cfrac{k_3 z}{1 + {}\ddots}}}}$$

In Gauss's continued fraction, the functions $$f_i$$ are hypergeometric functions of the form $${}_0F_1$$, $${}_1F_1$$, and $${}_2F_1$$, and the equations $$f_{i-1} - f_i = k_i z f_{i+1}$$ arise as identities between functions where the parameters differ by integer amounts. These identities can be proven in several ways, for example by expanding out the series and comparing coefficients, or by taking the derivative in several ways and eliminating it from the equations generated.

The series 0F1
The simplest case involves
 * $$\,_0F_1(a;z) = 1 + \frac{1}{a\,1!}z + \frac{1}{a(a+1)\,2!}z^2 + \frac{1}{a(a+1)(a+2)\,3!}z^3 + \cdots. $$

Starting with the identity


 * $$\,_0F_1(a-1;z)-\,_0F_1(a;z) = \frac{z}{a(a-1)}\,_0F_1(a+1;z),$$

we may take


 * $$f_i = {}_0F_1(a+i;z),\,k_i = \tfrac{1}{(a+i)(a+i-1)},$$

giving


 * $$\frac{\,_0F_1(a+1;z)}{\,_0F_1(a;z)} = \cfrac{1}{1 + \cfrac{\frac{1}{a(a+1)}z}

{1 + \cfrac{\frac{1}{(a+1)(a+2)}z}{1 + \cfrac{\frac{1}{(a+2)(a+3)}z}{1 + {}\ddots}}}}$$

or


 * $$\frac{\,_0F_1(a+1;z)}{a\,_0F_1(a;z)} = \cfrac{1}{a + \cfrac{z}

{(a+1) + \cfrac{z}{(a+2) + \cfrac{z}{(a+3) + {}\ddots}}}}.$$

This expansion converges to the meromorphic function defined by the ratio of the two convergent series (provided, of course, that a is neither zero nor a negative integer).

The series 1F1
The next case involves
 * $${}_1F_1(a;b;z) = 1 + \frac{a}{b\,1!}z + \frac{a(a+1)}{b(b+1)\,2!}z^2 + \frac{a(a+1)(a+2)}{b(b+1)(b+2)\,3!}z^3 + \cdots$$

for which the two identities
 * $$\,_1F_1(a;b-1;z)-\,_1F_1(a+1;b;z) = \frac{(a-b+1)z}{b(b-1)}\,_1F_1(a+1;b+1;z)$$
 * $$\,_1F_1(a;b-1;z)-\,_1F_1(a;b;z) = \frac{az}{b(b-1)}\,_1F_1(a+1;b+1;z)$$

are used alternately.

Let
 * $$f_0(z) = \,_1F_1(a;b;z),$$
 * $$f_1(z) = \,_1F_1(a+1;b+1;z),$$
 * $$f_2(z) = \,_1F_1(a+1;b+2;z),$$
 * $$f_3(z) = \,_1F_1(a+2;b+3;z),$$
 * $$f_4(z) = \,_1F_1(a+2;b+4;z),$$

etc.

This gives $$f_{i-1} - f_i = k_i z f_{i+1}$$ where $$k_1=\tfrac{a-b}{b(b+1)}, k_2=\tfrac{a+1}{(b+1)(b+2)}, k_3=\tfrac{a-b-1}{(b+2)(b+3)}, k_4=\tfrac{a+2}{(b+3)(b+4)}$$, producing


 * $$\frac{{}_1F_1(a+1;b+1;z)}{{}_1F_1(a;b;z)} = \cfrac{1}{1 + \cfrac{\frac{a-b}{b(b+1)} z}{1 + \cfrac{\frac{a+1}{(b+1)(b+2)} z}{1 + \cfrac{\frac{a-b-1}{(b+2)(b+3)} z}{1 + \cfrac{\frac{a+2}{(b+3)(b+4)} z}{1 + {}\ddots}}}}}$$

or


 * $$\frac{{}_1F_1(a+1;b+1;z)}{b{}_1F_1(a;b;z)} = \cfrac{1}{b + \cfrac{(a-b) z}{(b+1) + \cfrac{(a+1) z}{(b+2) + \cfrac{(a-b-1) z}{(b+3) + \cfrac{(a+2) z}{(b+4) + {}\ddots}}}}}$$

Similarly
 * $$\frac{{}_1F_1(a;b+1;z)}{{}_1F_1(a;b;z)} = \cfrac{1}{1 + \cfrac{\frac{a}{b(b+1)} z}{1 + \cfrac{\frac{a-b-1}{(b+1)(b+2)} z}{1 + \cfrac{\frac{a+1}{(b+2)(b+3)} z}{1 + \cfrac{\frac{a-b-2}{(b+3)(b+4)} z}{1 + {}\ddots}}}}}$$

or


 * $$\frac{{}_1F_1(a;b+1;z)}{b{}_1F_1(a;b;z)} = \cfrac{1}{b + \cfrac{a z}{(b+1) + \cfrac{(a-b-1) z}{(b+2) + \cfrac{(a+1) z}{(b+3) + \cfrac{(a-b-2) z}{(b+4) + {}\ddots}}}}}$$

Since $${}_1F_1(0;b;z)=1$$, setting a to 0 and replacing b + 1 with b in the first continued fraction gives a simplified special case:


 * $${}_1F_1(1;b;z) = \cfrac{1}{1 + \cfrac{-z}{b + \cfrac{z}{(b+1) + \cfrac{-b z}{(b+2) + \cfrac{2z}{(b+3) + \cfrac{-(b+1)z}{(b+4) + {}\ddots}}}}}}$$

The series 2F1
The final case involves


 * $${}_2F_1(a,b;c;z) = 1 + \frac{ab}{c\,1!}z + \frac{a(a+1)b(b+1)}{c(c+1)\,2!}z^2 + \frac{a(a+1)(a+2)b(b+1)(b+2)}{c(c+1)(c+2)\,3!}z^3 + \cdots.\,$$

Again, two identities are used alternately.
 * $$\,_2F_1(a,b;c-1;z)-\,_2F_1(a+1,b;c;z) = \frac{(a-c+1)bz}{c(c-1)}\,_2F_1(a+1,b+1;c+1;z), $$
 * $$\,_2F_1(a,b;c-1;z)-\,_2F_1(a,b+1;c;z) = \frac{(b-c+1)az}{c(c-1)}\,_2F_1(a+1,b+1;c+1;z). $$

These are essentially the same identity with a and b interchanged.

Let
 * $$f_0(z) = \,_2F_1(a,b;c;z),$$
 * $$f_1(z) = \,_2F_1(a+1,b;c+1;z),$$
 * $$f_2(z) = \,_2F_1(a+1,b+1;c+2;z),$$
 * $$f_3(z) = \,_2F_1(a+2,b+1;c+3;z),$$
 * $$f_4(z) = \,_2F_1(a+2,b+2;c+4;z),$$

etc.

This gives $$f_{i-1} - f_i = k_i z f_{i+1}$$ where $$k_1=\tfrac{(a-c)b}{c(c+1)}, k_2=\tfrac{(b-c-1)(a+1)}{(c+1)(c+2)}, k_3=\tfrac{(a-c-1)(b+1)}{(c+2)(c+3)}, k_4=\tfrac{(b-c-2)(a+2)}{(c+3)(c+4)}$$, producing
 * $$\frac{{}_2F_1(a+1,b;c+1;z)}{{}_2F_1(a,b;c;z)} = \cfrac{1}{1 + \cfrac{\frac{(a-c)b}{c(c+1)} z}{1 + \cfrac{\frac{(b-c-1)(a+1)}{(c+1)(c+2)} z}{1 + \cfrac{\frac{(a-c-1)(b+1)}{(c+2)(c+3)} z}{1 + \cfrac{\frac{(b-c-2)(a+2)}{(c+3)(c+4)} z}{1 + {}\ddots}}}}}$$

or


 * $$\frac{{}_2F_1(a+1,b;c+1;z)}{c{}_2F_1(a,b;c;z)} = \cfrac{1}{c + \cfrac{(a-c)b z}{(c+1) + \cfrac{(b-c-1)(a+1) z}{(c+2) + \cfrac{(a-c-1)(b+1) z}{(c+3) + \cfrac{(b-c-2)(a+2) z}{(c+4) + {}\ddots}}}}}$$

Since $${}_2F_1(0,b;c;z)=1$$, setting a to 0 and replacing c + 1 with c gives a simplified special case of the continued fraction:


 * $${}_2F_1(1,b;c;z) = \cfrac{1}{1 + \cfrac{-b z}{c + \cfrac{(b-c) z}{(c+1) + \cfrac{-c(b+1) z}{(c+2) + \cfrac{2(b-c-1) z}{(c+3) + \cfrac{-(c+1)(b+2) z}{(c+4) + {}\ddots}}}}}}$$

Convergence properties
In this section, the cases where one or more of the parameters is a negative integer are excluded, since in these cases either the hypergeometric series are undefined or that they are polynomials so the continued fraction terminates. Other trivial exceptions are excluded as well.

In the cases $${}_0F_1$$ and $${}_1F_1$$, the series converge everywhere so the fraction on the left hand side is a meromorphic function. The continued fractions on the right hand side will converge uniformly on any closed and bounded set that contains no poles of this function.

In the case $${}_2F_1$$, the radius of convergence of the series is 1 and the fraction on the left hand side is a meromorphic function within this circle. The continued fractions on the right hand side will converge to the function everywhere inside this circle.

Outside the circle, the continued fraction represents the analytic continuation of the function to the complex plane with the positive real axis, from $+1$ to the point at infinity removed. In most cases $+1$ is a branch point and the line from $+1$ to positive infinity is a branch cut for this function. The continued fraction converges to a meromorphic function on this domain, and it converges uniformly on any closed and bounded subset of this domain that does not contain any poles.

The series 0F1
We have


 * $$\cosh(z) = \,_0F_1({\tfrac{1}{2}};{\tfrac{z^2}{4}}),$$
 * $$\sinh(z) = z\,_0F_1({\tfrac{3}{2}};{\tfrac{z^2}{4}}),$$

so


 * $$\tanh(z) = \frac{z\,_0F_1({\tfrac{3}{2}};{\tfrac{z^2}{4}})}{\,_0F_1({\tfrac{1}{2}};{\tfrac{z^2}{4}})}

= \cfrac{z/2}{\tfrac{1}{2} + \cfrac{\tfrac{z^2}{4}}{\tfrac{3}{2} + \cfrac{\tfrac{z^2}{4}}{\tfrac{5}{2} + \cfrac{\tfrac{z^2}{4}}{\tfrac{7}{2} + {}\ddots}}}} = \cfrac{z}{1 + \cfrac{z^2}{3 + \cfrac{z^2}{5 + \cfrac{z^2}{7 + {}\ddots}}}}.$$

This particular expansion is known as Lambert's continued fraction and dates back to 1768.

It easily follows that


 * $$\tan(z) = \cfrac{z}{1 - \cfrac{z^2}{3 - \cfrac{z^2}{5 - \cfrac{z^2}{7 - {}\ddots}}}}.$$

The expansion of tanh can be used to prove that en is irrational for every non-zero integer n (which is alas not enough to prove that e is transcendental). The expansion of tan was used by both Lambert and Legendre to prove that π is irrational.

The Bessel function $$J_\nu$$ can be written


 * $$J_\nu(z) = \frac{(\tfrac{1}{2}z)^\nu}{\Gamma(\nu+1)}\,_0F_1(\nu+1;-\frac{z^2}{4}),$$

from which it follows


 * $$\frac{J_\nu(z)}{J_{\nu-1}(z)}=\cfrac{z}{2\nu - \cfrac{z^2}{2(\nu+1) - \cfrac{z^2}{2(\nu+2) - \cfrac{z^2}{2(\nu+3) - {}\ddots}}}}.$$

These formulas are also valid for every complex z.

The series 1F1
Since $$e^z = {}_1F_1(1;1;z)$$, $$1/e^z = e^{-z}$$


 * $$e^z = \cfrac{1}{1 + \cfrac{-z}{1 + \cfrac{z}{2 + \cfrac{-z}{3 + \cfrac{2z}{4 + \cfrac{-2z}{5 + {}\ddots}}}}}}$$
 * $$e^z = 1 + \cfrac{z}{1 + \cfrac{-z}{2 + \cfrac{z}{3 + \cfrac{-2z}{4 + \cfrac{2z}{5 + {}\ddots}}}}}.$$

With some manipulation, this can be used to prove the simple continued fraction representation of e,
 * $$e=2+\cfrac{1}{1+\cfrac{1}{2+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{4+{}\ddots}}}}}$$

The error function erf (z), given by



\operatorname{erf}(z) = \frac{2}{\sqrt{\pi}}\int_0^z e^{-t^2} \, dt, $$

can also be computed in terms of Kummer's hypergeometric function:



\operatorname{erf}(z) = \frac{2z}{\sqrt{\pi}} e^{-z^2} \,_1F_1(1;{\scriptstyle\frac{3}{2}};z^2). $$

By applying the continued fraction of Gauss, a useful expansion valid for every complex number z can be obtained:



\frac{\sqrt{\pi}}{2} e^{z^2} \operatorname{erf}(z) = \cfrac{z}{1 - \cfrac{z^2}{\frac{3}{2} + \cfrac{z^2}{\frac{5}{2} - \cfrac{\frac{3}{2}z^2}{\frac{7}{2} + \cfrac{2z^2}{\frac{9}{2} - \cfrac{\frac{5}{2}z^2}{\frac{11}{2} + \cfrac{3z^2}{\frac{13}{2} - \cfrac{\frac{7}{2}z^2}{\frac{15}{2} + - \ddots}}}}}}}}. $$

A similar argument can be made to derive continued fraction expansions for the Fresnel integrals, for the Dawson function, and for the incomplete gamma function. A simpler version of the argument yields two useful continued fraction expansions of the exponential function.

The series 2F1
From
 * $$(1-z)^{-b}={}_1F_0(b;;z)=\,_2F_1(1,b;1;z),$$
 * $$(1-z)^{-b} = \cfrac{1}{1 + \cfrac{-b z}{1 + \cfrac{(b-1) z}{2 + \cfrac{-(b+1) z}{3 + \cfrac{2(b-2) z}{4 + {}\ddots}}}}}$$

It is easily shown that the Taylor series expansion of arctan z in a neighborhood of zero is given by



\arctan z = zF({\scriptstyle\frac{1}{2}},1;{\scriptstyle\frac{3}{2}};-z^2). $$

The continued fraction of Gauss can be applied to this identity, yielding the expansion



\arctan z = \cfrac{z} {1+\cfrac{(1z)^2} {3+\cfrac{(2z)^2} {5+\cfrac{(3z)^2} {7+\cfrac{(4z)^2} {9+\ddots}}}}}, $$

which converges to the principal branch of the inverse tangent function on the cut complex plane, with the cut extending along the imaginary axis from i to the point at infinity, and from −i to the point at infinity.

This particular continued fraction converges fairly quickly when z = 1, giving the value π/4 to seven decimal places by the ninth convergent. The corresponding series



\frac{\pi}{4} = \cfrac{1} {1+\cfrac{1^2} {2+\cfrac{3^2} {2+\cfrac{5^2} {2+\ddots}}}} = 1 - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} \pm \cdots $$

converges much more slowly, with more than a million terms needed to yield seven decimal places of accuracy.

Variations of this argument can be used to produce continued fraction expansions for the natural logarithm, the arcsin function, and the generalized binomial series.