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)$$

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$
