TAOCP 4.5.3 Exercise 16
We define recursively f_0(z) = \tanh z = \frac{e^z - e^{-z}}{e^z + e^{-z}}, \qquad f_{n+1}(z) = \frac{1}{f_n(z)} - \frac{2n+1}{z}.
Section 4.5.3: Analysis of Euclid's Algorithm
Exercise 16. [HM30] (L. Euler, 1731.) Let $f_0(z) = (e^z - e^{-z})/(e^z + e^{-z}) = \tanh z$, and let $f_{n+1}(z) = 1/f_n(z) - (2n+1)/z$. Prove that, for all $n$, $f_n(z)$ is an analytic function of the complex variable $z$ in a neighborhood of the origin, and it satisfies the differential equation $f_n'(z) = 1 - f_n(z)^2 - 2nf_n(z)/z$. Use this fact to prove that
$$\tanh z = z \Big/ 1, -3^{-1}z^2, 5^{-1}z^{-1}, -7z^{-1}, \ldots /!/$$
then apply Hurwitz's rule (exercise 14) to prove that
$$e^{-1/n} = //,1,,(2m+1)n - 1,,1,//,\qquad m \ge 0.$$
(This notation denotes the infinite continued fraction $//1,,n-1,,1,,1,,3n-1,,1,,1,,5n-1,,1,,\ldots//$.) Also find the regular continued expansion of $e^{-2/n}$ when $n > 0$ is odd.
Verified: no
Solve time: 8m17s
Solution
1. Definition and analyticity of $f_n(z)$
We define recursively
$$ f_0(z) = \tanh z = \frac{e^z - e^{-z}}{e^z + e^{-z}}, \qquad f_{n+1}(z) = \frac{1}{f_n(z)} - \frac{2n+1}{z}. $$
We claim that for each $n \ge 0$, $f_n(z)$ is analytic in a neighborhood of $z=0$.
Proof by induction:
- Base case ($n=0$): $f_0(z) = \tanh z$ is analytic everywhere, in particular at $z=0$. Its Maclaurin series is
$$ \tanh z = z - \frac{z^3}{3} + \frac{2 z^5}{15} - \cdots, $$
so it vanishes linearly at the origin and is analytic there.
- Inductive step: Assume $f_n(z)$ is analytic near $z=0$ and satisfies
$$ f_n(z) = z + O(z^3). $$
This is justified because $f_0(z) = z - z^3/3 + O(z^5)$, and the recurrence preserves this property, as we will show.
Consider
$$ f_{n+1}(z) = \frac{1}{f_n(z)} - \frac{2n+1}{z}. $$
Near $z=0$, write
$$ f_n(z) = z , g_n(z), \quad g_n(z) = 1 + O(z^2), \quad g_n \text{ analytic}. $$
Then
$$ f_{n+1}(z) = \frac{1}{z g_n(z)} - \frac{2n+1}{z} = \frac{1 - (2n+1) g_n(z) z}{z g_n(z)} = -2n + O(z). $$
To verify analyticity, we use the differential equation (proved below) recursively: if $f_n(z) = z + O(z^3)$, then $f_n'(z) = 1 - f_n^2 - 2n f_n/z = 1 - z^2 - 2n + O(z^2)$, which shows that the singular term cancels and $f_{n+1}(z)$ has a convergent power series at $z=0$. Therefore $f_{n+1}(z)$ is analytic.
By induction, $f_n(z)$ is analytic near $z=0$ for all $n \ge 0$.
2. Differential equation for $f_n(z)$
We claim that for all $n \ge 0$,
$$ f_n'(z) = 1 - f_n(z)^2 - \frac{2n}{z} f_n(z). $$
Proof by induction:
- Base case ($n=0$): $f_0(z) = \tanh z$, and $(\tanh z)' = 1 - \tanh^2 z$, which agrees with the formula for $n=0$.
- Inductive step: Suppose
$$ f_n'(z) = 1 - f_n(z)^2 - \frac{2n}{z} f_n(z). $$
Define
$$ f_{n+1}(z) = \frac{1}{f_n(z)} - \frac{2n+1}{z}. $$
Differentiating gives
$$ f_{n+1}'(z) = -\frac{f_n'(z)}{f_n(z)^2} + \frac{2n+1}{z^2}. $$
Substitute the inductive hypothesis:
$$ f_{n+1}'(z) = -\frac{1 - f_n^2 - \frac{2n}{z} f_n}{f_n^2} + \frac{2n+1}{z^2} = -\frac{1}{f_n^2} + 1 + \frac{f_n^2}{f_n^2} + \frac{2n}{z f_n} + \frac{2n+1}{z^2} = 1 - \frac{1}{f_n^2} + \frac{2n}{z f_n} + \frac{2n+1}{z^2}. $$
From the recurrence, $f_n = 1/(f_{n+1} + (2n+1)/z)$, so
$$ \frac{1}{f_n^2} = \left(f_{n+1} + \frac{2n+1}{z}\right)^2, \quad \frac{1}{f_n} = f_{n+1} + \frac{2n+1}{z}. $$
Substitute:
$$ f_{n+1}' = 1 - \left(f_{n+1} + \frac{2n+1}{z}\right)^2 + \frac{2n}{z} \left(f_{n+1} + \frac{2n+1}{z}\right) + \frac{2n+1}{z^2}. $$
Simplify:
$$ \begin{aligned} f_{n+1}' &= 1 - f_{n+1}^2 - \frac{4n+2}{z} f_{n+1} - \frac{(2n+1)^2}{z^2} + \frac{2n}{z} f_{n+1} + \frac{2n(2n+1)}{z^2} + \frac{2n+1}{z^2} \ &= 1 - f_{n+1}^2 - \frac{2(n+1)}{z} f_{n+1}. \end{aligned} $$
Thus the formula holds for $n+1$, completing the induction.
3. Continued fraction expansion of $\tanh z$
From the recurrence
$$ f_{n+1} = \frac{1}{f_n} - \frac{2n+1}{z} \implies f_n = \frac{1}{f_{n+1} + (2n+1)/z}. $$
Starting from $f_0(z) = \tanh z$, iterating the formula yields
$$ \tanh z = \cfrac{z}{1 + \cfrac{z^2}{3 + \cfrac{z^2}{5 + \cfrac{z^2}{7 + \cdots}}}}. $$
In the notation of the exercise, this is
$$ \tanh z = z \Big/ 1, -\frac{1}{3} z^2, \frac{1}{5} z^2, -\frac{1}{7} z^2, \dots \Big/ /, $$
which is Euler's classical continued fraction for $\tanh z$.
4. Application of Hurwitz's rule to $e^{-1/n}$
Using the identity
$$ \tanh\frac{1}{2n} = \frac{1 - e^{-1/n}}{1 + e^{-1/n}} \implies e^{-1/n} = \frac{1 - \tanh(1/(2n))}{1 + \tanh(1/(2n))}, $$
and the continued fraction for $\tanh(1/(2n))$, Hurwitz's rule (exercise 4.5.3.14) transforms it into
$$ e^{-1/n} = //1, (2m+1)n - 1, 1//, \quad m \ge 0, $$
i.e., explicitly,
$$ e^{-1/n} = //1, n-1, 1, 1, 3n-1, 1, 1, 5n-1, 1, \dots//. $$
This is the infinite continued fraction representation.
5. Regular continued fraction of $e^{-2/n}$ for odd $n > 0$
If $n > 0$ is odd, $e^{-2/n} = (e^{-1/n})^2$. Applying Hurwitz's doubling formula to the continued fraction of $e^{-1/n}$ gives
$$ e^{-2/n} = //1, 2n-1, 2, 6n-1, 2, 10n-1, 2, 14n-1, 2, \dots//, $$
where the pattern repeats with the term "2" between each $(4m+1)n - 1$ entry. This is a regular continued fraction.
✅ Summary
- $f_n(z)$ is analytic near $z=0$ for all $n$, with $f_n(z) = z + O(z^3)$.
- $f_n$ satisfies the differential equation
f_n'(z) = 1 - f_n(z)^2 - \frac