Closed Form Formula for Nonlinear Recurrence $a_{n+1}=\frac{a_{n}}{2} + \frac{5}{a_{n}}$ I'm trying to find a closed form solution to the sequence
$a_{n+1}=\frac{a_{n}}{2} + \frac{5}{a_{n}}$
I tried using a generating function approach in the following way:
Let $$f(x) = \sum_{n=1}^\infty a_n x^n$$
Then multiplying the original equation with $x^n$ and summing over all $n$, we get:
$$\sum_{n=1}^\infty a_{n+1}x^n= \sum_{n=1}^\infty \frac{a_{n}}{2} x^n + \sum_{n=1}^\infty\frac{5}{a_{n}} x^n$$
$$= \frac{f(x) - a_1}{x} = \frac{f(x)}{2} + 5 \sum_{n=1}^\infty \frac{x^n}{a_n}$$
But now I don't know how to simplify the last term and I get stuck. I put it on Wolframalpha and
found the general solution to the recurrence relation as:
$$a_n = -i \sqrt{10} \cot\left(c_1 2^n\right)$$
 A: Based on the Wolfram Alpha answer, this is how one would get a closed form for $a_n$:
First, the substitution $a_n = b_n\sqrt{10}$ yield the equation
$$b_{n+1}=\frac{b_n+b_n^{-1}}{2}$$
Now take $b_n = \coth c_n$ to get
$$\coth c_{n+1} = \frac{\coth c_n + \tanh c_n}{2} = \coth (2c_n)$$
From this, $c_{n+1} = 2 c_n$. This means that $c_n = k\, 2^n$ for some $k$.
So $a_n = \sqrt{10} \coth(k\, 2^n)$.
It's not hard to check that this satisfies the recurrence relation.
A: Let's make a change of variable $x_n = \frac{a_n}{\sqrt{10}}$, then
$$x_{n+1} = \frac{x_n^2 +1}{2x_n}$$
We have
$$x_{n+1} -1 = \frac{(x_n -1)^2}{2x_n}$$
$$x_{n+1} + 1 = \frac{(x_n +1)^2}{2x_n}$$
Then
$$\frac{x_{n+1} -1}{x_{n+1} + 1} = \left(\frac{x_n -1}{x_n +1}\right)^2$$
By reccurence, we obtain
$$\frac{x_{n} -1}{x_{n} + 1} = \left(\frac{x_0 -1}{x_0 +1}\right)^{2^n}$$
and we can deduce the closed form solution of $x_n$ and then $a_n$
A: Here is an intuition: Rewrite the recurrence relation s
$$ a_{n+1} = \frac{1}{2}\left(a_n + \frac{\ell^2}{a_n}\right), \qquad \ell = \sqrt{10}. $$
This is precisely what we get when we apply the Newton-Raphson method to $x^2 - \ell^2$. So,

*

*for any positive initial value, $(a_n)$ converges to $\ell$, and

*for any negative initial value, $(a_n)$ converges to $-\ell$.

This naturally leads us to study the behavior of the sequences $(x_n^+)$ and $(x_n^-)$ defined by
$$ x_n^{\pm} = a_n \pm \ell. $$
Let us find the recurrence relation for these sequences:
$$ x_{n+1}^{\pm} = a_{n+1} \pm \ell = \frac{1}{2}\left(a_n + \frac{\ell^2}{a_n}\right) \pm \ell = \frac{(a_n \pm \ell)^2}{2a_n} = \frac{(x_n^{\pm})^2}{2a_n}. $$
This gives an intuitive explanation to @NN2's wonderful trick. Indeed, taking ratio of the two sequences,
$$ \frac{x_{n+1}^+}{x_{n+1}^-} = \left( \frac{x_{n}^+}{x_{n}^-} \right)^2,
\qquad\text{i.e.,}\qquad
\frac{a_{n+1} + \ell}{a_{n+1} - \ell} = \left( \frac{a_n + \ell}{a_n - \ell} \right)^2. $$
Iterating this, we get
$$ \frac{a_n + \ell}{a_n - \ell} = \left( \frac{a_0 + \ell}{a_0 - \ell} \right)^{2^n}. $$
Now solving this for $a_n$ gives the desired recurrence relation for $(a_n)$.
