# Closed form for this continued fraction [closed]

Is there a closed form for this continued fraction?

$$x+\frac{1}{x+\frac{1}{x+\frac{1}{...}}}$$

## closed as unclear what you're asking by Grigory M, user85798, M Turgeon, Old John, Daniel Robert-NicoudJan 1 '14 at 19:19

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• What do you mean by generalized form? – Pratyush Sarkar Aug 5 '13 at 2:53
• I think he means "closed-form expression" the continued fraction...I'm guessing/hoping-since-I-already-answered ;p... – Alex Nelson Aug 5 '13 at 3:04

Here's a cute, handwavy way to do it:

$$f(x) = x + \cfrac{1}{x+\cfrac{1}{x+\cfrac{1}{x+\dots}}}$$

Notice then that

$$\frac{1}{f(x)} = \cfrac{1}{x+\cfrac{1}{x+\cfrac{1}{x+\dots}}}$$

Thus

\begin{align} x+\frac{1}{f(x)} &= x+\cfrac{1}{x+\cfrac{1}{x+\cfrac{1}{x+\dots}}} \\ &=f(x) \end{align}

So, we have a functional relationship

$$x + \frac{1}{f(x)} = f(x)$$

or equivalently

$$xf(x) + 1 = f(x)^{2}$$

This quadratic equation may be solved quite simply, we have candidate solutions:

$$f_{\pm}(x) = \frac{x\pm\sqrt{x^{2}+4}}{2}$$

We should note that $f(1)$ as a continued fraction is precisely the golden ratio. Hence we deduce

$$f(x) = \frac{x+\sqrt{x^{2}+4}}{2}.$$

• To me, it seems that the square root should take the sign of $x$ – ccorn Aug 5 '13 at 3:11
• Simpler to consider $f(0)$ or the sign of the function for positive $x$. Also, what about for negative $x$? ccorn gives a possible solution (didn't check if it works though). – Pratyush Sarkar Aug 5 '13 at 3:28
• Rigorously speaking, $f(x)$ doesn't converge when $x\leq0$. If I recall correctly, this is by Worpitzky's theorem...I would be rather excited if I am wrong, though, and certainly do not rule it out! – Alex Nelson Aug 6 '13 at 3:58
• @AlexNelson: No, Worpitzky's theorem is for a totally different kind of continued fraction, so it's not relevant here. ccorn is correct for non-zero real $x$, and see my answer for the general solution for complex $x$. It's interestingly non-trivial! – user21820 Jan 1 '14 at 15:43

The continued fraction $[x;x,x,...]$ converges for any $x \in \mathbb{C} \backslash i(-2,2) = \{ z : z \in \mathbb{C} \wedge z \not\in \{ ir : r \in(-2,2) \} \}$, and here is my proof:

If $[x;x,x,...]$ converges to $c$,

$c = x + 1/c$ and hence $c$ is a root of the quadratic $t \mapsto t^2 - x t - 1$

Let $r$,$s$ be the roots of the quadratic $t \mapsto t^2 - x t - 1$ and so $r + s = x$ and $r s = -1$

Let the sequence of approximants be $(a_n)$ where $a_1 = x$ (and the sequence stops if it becomes $0$)

Let $b_n = a_n b_{n-1}$ where $b_0 = 1$ and so $a_n = \frac{b_n}{b_{n-1}}$ (if $a_n$ is defined)

$b_{n+1} = a_{n+1} b_n = ( x + \frac{1}{a_n} ) b_n = ( x + \frac{b_{n-1}}{b_n} ) b_n = x b_n + b_{n-1}$ (if $a_n \ne 0$)

$b_{n+1} - r b_n = s ( b_n - r b_{n-1} ) = s^n ( b_1 - r b_0 ) = (x-r) s^n = s^{n+1}$

$b_n - r^n b_0 = \sum_{k=1}^n r^{n-k} s^k$ and hence $b_n = \sum_{k=0}^n r^{n-k} s^k$

If $r \ne s$,

$b_n = {\large \frac{ r^{n+1} - s^{n+1} }{r-s} }$   [Or we can subtract $b_{n+1} - r b_n = s^{n+1}$ and $b_{n+1} - s b_n = r^{n+1}$]

$a_n = {\large \frac{ r^{n+1} - s^{n+1} }{ r^n - s^n } }$ (if $a_n$ is defined)

If $r = s$,

$b_n = (n+1) r^n$

$a_n = \frac{n+1}{n} r$ (if $a_n$ is defined)

If $x \not\in i[-2,2]$,

$|r| \ne 1$ otherwise $x = r - \frac{1}{r} = r - r^* = 2i~Im(r) \in i[-2,2]$

Permute $r$,$s$ such that $|r| > 1 > |s|$ because $|r| \cdot |s| = |rs| = 1$

$a_n \ne 0$ for any $n \in \mathbb{N}$ because $b_n = {\large \frac{ r^{n+1} - s^{n+1} }{r-s} } \ne 0$ for any $n \in \mathbb{Z}_{\ge 0}$ since $|r^{n+1}| > 1 > |s^{n+1}|$

$a_n = {\large \frac{ r^{n+1} - s^{n+1} }{ r^n - s^n } } = r + {\large \frac{ (r-s) s^n } { r^n - s^n } } = r + {\large \frac{r-s}{ (\frac{r}{s})^n - 1 } } \to r$ as $n \to \infty$ because $(\frac{r}{s})^n \to \infty$

If $x \in \{2i,-2i\}$,

$r = s \in \{i,-i\}$ because $(r-s)^2 = (r+s)^2 - 4rs = 0$

$a_n \ne 0$ for any $n \in \mathbb{N}$ because $b_n = (n+1) r^n \ne 0$ for any $n \in \mathbb{Z}_{\ge 0}$

$a_n = \frac{n+1}{n} r \to r$ as $n \to \infty$

If $x \in i(-2,2)$,

$a_n \in i\mathbb{R}$ (if $a_n$ is defined) because $x,\frac{1}{a_{n-1}} \in i\mathbb{R}$

If $a_n \to c$ as $n \to \infty$,

$c \in i\mathbb{R}$ because $i\mathbb{R}$ is closed

But $c \in \{r,s\} = {\large \frac{ x \pm \sqrt{x^2+4} }{2} }$ and hence $c \not\in i\mathbb{R}$ since $x^2+4 > 0$

$\Rightarrow\Leftarrow$

Therefore $( a_n )$ either terminates in a $0$ or does not converge

• Note that for those values of $x \in i(-2,2)$ for which the continued fraction becomes undefined due to division by zero, we could continue on if we work in the extended complex plane $\hat{\mathbb{C}} = \mathbb{C} \cup \{\infty\}$ where $1/0 = \infty$ and $1/\infty = 0$ and $z + \infty = \infty$ for any $z$ and $z \cdot \infty = \infty$ for $z \ne 0$ and $z \cdot 0 = 0$ for $z \ne \infty$. It still doesn't converge, of course, since at the next iteration the continued fraction becomes $x$. But the continued fraction does converge for $x = \infty$. – user21820 Jan 1 '14 at 15:49
• Note, though, for $x=i$, the convergents just fluctuates, cycling through $1$, $1+i$, $(1+i)/2$, without settling. So here's a puzzle: for which values of $x\in i(-2,2)$ does the partial fraction experience a divide-by-zero problem? (I mean, aside from the obvious $x=0$ solution!) – Alex Nelson Jan 1 '14 at 23:44
• @AlexNelson: From my proof it's easy to find all $x \in \mathbb{C}$ such that it has a divide by zero; namely $\{ 2~Im(r) : r^n = 1 \text{ for some } n \in \mathbb{N} \}$. The simplest non-zero such $x$ is $\sqrt{2}i$. – user21820 Jan 2 '14 at 0:29