Continued fraction of Gauss
In complex analysis, the continued fraction of Gauss is a particular continued fraction derived from the 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 clever algebraic trick 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 Thome 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
By substitution in the power series expansion of the classic hypergeometric series
F(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
-ne can verify that the following two formulas are power series identities:
\begin{align}
F(a,b;c;z)& = F(a,b+1;c+1;z) - \frac{a(c-b)}{c(c+1)}zF(a+1,b+1;c+2;z); \\
F(a,b+1;c+1;z)& = F(a+1,b+1;c+2;z) - \frac{(b+1)(c-a+1)}{(c+1)(c+2)}zF(a+1,b+2;c+3;z).
\end{align}
These two identities can be rewritten as
\frac{F(a,b+1;c+1;z)}{F(a,b;c;z)} = \frac{1}{1 - 
{\displaystyle\frac{a(c-b)}{c(c+1)}z\frac{F(a+1,b+1;c+2;z)}{F(a,b+1;c+1;z)}}}
and
\frac{F(a+1,b+1;c+2;z)}{F(a,b+1;c+1;z)} = \frac{1}{1 -
{\displaystyle\frac{(b+1)(c-a+1)}{(c+1)(c+2)}z\frac{F(a+1,b+2;c+3;z)}{F(a+1,b+1;c+2;z)}}}.
Now the ratio of the two functions F in the denominator on the right side of the first identity is the same as the ratio appearing on the left side of the second one, and the ratio of the two functions F on the right side of the second identity is the same as the left side of the first identity (after substituting a + 1 for a, b + 1 for b, and c + 2 for c). By substituting the second equation into the first, and then the first equation into the second, again and again, we obtain the continued fraction of Gauss:
\frac{F(a,b+1;c+1;z)}{F(a,b;c;z)} = \cfrac{1}{1 - \cfrac{\frac{a(c-b)}{c(c+1)}z}
{1 - \cfrac{\frac{(b+1)(c-a+1)}{(c+1)(c+2)}z}{1 - \cfrac{\frac{(a+1)(c-b+1)}{(c+2)(c+3)}z}
{1 - \cfrac{\frac{(b+2)(c-a+2)}{(c+3)(c+4)}z}{1 - \cfrac{\frac{(a+2)(c-b+2)}{(c+4)(c+5)}z}
{1 - \ddots}}}}}}.

# Convergence properties
Provided only that c is not zero or a negative integer, the continued fraction of Gauss converges almost everywhere in the complex plane. Specifically, it can be shown that
- The continued fraction of Gauss is equal to the function
f(z) = \frac{F(a,b+1;c+1;z)}{F(a,b;c;z)}
- The continued fraction of Gauss represents the analytic continuation of f(z) throughout the cut complex plane, where the cut extends along the positive real axis, from +1 to the point at infinity;
- The function represented by the continued fraction of Gauss is meromorphic; and
- The continued fraction of Gauss converges uniformly on every bounded closed region exterior to the cut (excluding those isolated points at which it has poles).
Notice also that if a is zero or a negative integer, or if b is a negative integer, the continued fraction of Gauss terminates after a finite number of partial quotients; in this case it represents a rational function of z. If a is neither zero nor a negative integer, and b is not a negative integer, the continued fraction of Gauss represents a transcendental function.

# Extensions and modifications

## Based on the hypergeometric function
The hypergeometric series F(a, 0; c; z) is equal to unity. By setting b to zero and writing c for c + 1, a simplified version of the continued fraction of Gauss can be derived:
F(a,1;c;z) = \cfrac{1}{1 - \cfrac{\frac{a}{c}z}{1 - \cfrac{\frac{c-a}{c(c+1)}z}
{1 - \cfrac{\frac{c(a+1)}{(c+1)(c+2)}z}{1 - \cfrac{\frac{2(c-a+1)}{(c+2)(c+3)}z}
{1 - \cfrac{\frac{(c+1)(a+2)}{(c+3)(c+4)}z}{1 - \cfrac{\frac{3(c-a+2)}{(c+4)(c+5)}z}{1 - \ddots}}}}}}}.

## Based on Kummer's confluent hypergeometric function
There are other ways to obtain modified versions of the continued fraction of Gauss. The derivation procedure can be applied to Kummer's confluent hypergeometric function
\,_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
to obtain the formula
\frac{\,_1F_1(a+1;b+1;z)}{\,_1F_1(a;b;z)} = \cfrac{1}{1- \cfrac{\frac{b-a}{b(b+1)}z}
{1 + \cfrac{\frac{a+1}{(b+1)(b+2)}z}{1 - \cfrac{\frac{b-a+1}{(b+2)(b+3)}z}
{1 + \cfrac{\frac{a+2}{(b+3)(b+4)}z}{1 - \cfrac{\frac{b-a+2}{(b+4)(b+5)}z}{1 + - \ddots}}}}}}.
Since 1F1(a; b; z) is an entire function of z (provided that b = 0), it can be shown that this version of the continued fraction of Gauss converges uniformly on every bounded closed region that contains no poles of the function to which it corresponds.
Since 1F1(0; b; z) is equal to unity, this formula can also be simplified. Substituting a = 0 in the preceding formula, replacing b + 1 by b, and applying an eqivalence transformation produces the identity
\,_1F_1(1;b;z) = \cfrac{1}{1 - \cfrac{z}{b + \cfrac{z}{b + 1 - \cfrac{bz}{b + 2 + \cfrac{2z}
{b + 3 - \cfrac{(b+1)z}{b + 4 + \cfrac{3z}{b + 5 - \cfrac{(b+2)z}{b + 6 +- \ddots}}}}}}}},
which is valid throughout the entire complex plane.

## Based on the confluent hypergeometric function 0F1
Another confluent hypergeometric function is defined by the series
\,_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
By entirely analogous arguments it can be shown that the continued fraction of Gauss becomes
\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}}}}
and that this expansion converges uniformly 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).

# Applications

## Of the classic hypergeometric function F
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{z^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} = 1 - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} + - \dots
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.

## Of Kummer's confluent hypergeometric function
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.

## Of the confluent hypergeometric function 0F1
J. H. Lambert showed that
\frac{e^z - e^{-z}}{e^z + e^{-z}} = 
\frac{\,_1F_1({\scriptstyle\frac{3}{2}};{\scriptstyle\frac{z^2}{4}})}
{\,_1F_1({\scriptstyle\frac{1}{2}};{\scriptstyle\frac{z^2}{4}})},
from which the following continued fraction expansion of the hyperbolic tangent function is easily derived:
\tanh z = \cfrac{z}{1 + \cfrac{z^2}{3 + \cfrac{z^2}{5 + \cfrac{z^2}{7 + \ddots}}}}.
This expansion is valid for every complex number z. Since tan z = i tanh iz, the continued fraction of Gauss also gives a representation of the ordinary tangent function:
\tan z = \cfrac{z}{1 - \cfrac{z^2}{3 - \cfrac{z^2}{5 - \cfrac{z^2}{7 - \ddots}}}}.
This formula is also valid for every complex z.

# Notes
-  Jones & Thron (1980) p. 5
-  C. F. Gauss (1813), Werke, vol. 3 pp. 134-138.
-  B. Riemann (1863), "Sullo svolgimento del quoziente di due serie ipergeometriche in frazione continua infinita" in Werke. pp. 400-406. (Posthumous fragment).
-  L. W. Thome (1867), "Uber die Kettenbruchentwicklung des Gaussen quotienten ...," Jour. fur Math. vol. 67 pp. 299-309.
-  E. B. Van Vleck (1901), "On the convergence of the continued fraction of Gauss and other continued fractions." Annals of Mathematics, vol. 3 pp. 1-18.
-  This function, commonly written as 2F1(a, b; c; z) in modern texts, is written as F(a, b; c; z) in this article as a matter of notational convenience.
-  Wall, 1973 (p. 337)
-  Wall, 1973 (p. 339)
-  The function 1F1 is sometimes written as M(a; b; z), or (in both Wall (1973) and Jones & Thron (1980)) as (a; b; z).
-  Jones & Thron (1980) p. 206
-  Both Wall (1973) and Jones & Thron (1980) refer to this function as (a; z).
-  Wall (1973) p. 343. Notice that i and i are branch points for the inverse tangent function.
-  Jones & Thron (1980) p. 202.
-  Jones & Thron (1980) p. 208.
-  See the example in the article Pade table for the expansions of ez as continued fractions of Gauss.
-  Wall (1973) p. 349. This particular expansion is known as Lambert's continued fraction and dates back to 1768.