<s>[INST] Determine the general term of a Recurrent Rational Sequence How to determine the general term of the $(u_n)$ sequence with $u_0 \in \mathbb R_+$ and $u_{n+1}=\frac{u_n^2+1}{1+2u_n}$ ?
Source : les dattes à Dattier
 [/INST] 1/The trick :

Let $t,u,v$ functions with $t\circ v=v\circ u$, then : $t^n\circ v=v\circ u^n$.
Here, we have choosen, $t,u,v$ of the type : $$t(x)=\frac{x^2+1}{2x+1},
 u(x)=x^2 \text{ and } v(x)=\frac{ax+b}{cx+d}$$



2/For the solution proposed by Francesco, the form is :
$$h_n=f\circ g^n\circ f^{-1}$$

with $$f(x)=\frac{\sqrt 5}{2}\coth(x)-\frac{1}{2}$$
$$g(x)=2x$$
We have : $h_n\circ h_m=h_{n+m}$
and a conjecture: $$h_1(x)=\frac{1+x^2}{2x+1}$$

3/
we go to show : $h_1(x)=\frac{1+x^2}{2x+1}$
we have : $$(1):\coth(2x)=\frac{\coth(x)^2+1}{2\coth(x)}$$
More : $$f=w \circ \coth$$
with $$w(x)=\frac{\sqrt{5}}{2}x-\frac{1}{2}$$
and $$w^{-1}(x)=\frac{(2x+1)}{\sqrt{5}}$$
so 

$$h_1=w \circ \coth \circ g \circ \coth^{-1} \circ w^{-1} $$
$$\text{ with } w(x)=\frac{\sqrt{5}}{2}x-\frac{1}{2} \text{ and }  g(x)=2x$$

with using of $(1)$ then :
$$ \coth \circ g \circ \coth^{-1}(x)=\frac{x^2+1}{2x} $$
so 
$$h_1(x)=w\left(\frac{w^{-1}(x)^2+1}{2w^{-1}(x)}\right)=\frac{\sqrt{5}}{2}\left(\frac{(\frac{2x+1}{\sqrt{5}})^2+1}{2(\frac{2x+1}{\sqrt{5}})}\right)-\frac{1}{2}$$
$$h_1(x)=\frac{\sqrt{5}}{2}\left(\sqrt{5}\frac{(\frac{4x^2+4x+1}{5})+1}{2(2x+1)}\right)-\frac{1}{2}=\frac{\sqrt{5}}{2}\left(\frac{\sqrt{5}}{5}\frac{4x^2+4x+1+5}{2(2x+1)}\right)-\frac{1}{2}$$
$$h_1(x)=\frac{\sqrt{5}}{2}\left(\frac{1}{2\sqrt{5}}\frac{4x^2+4x+6}{(2x+1)}\right)-\frac{1}{2}$$
$$h_1(x)=\frac{1}{4}\left(\frac{4x^2+4x+6}{2x+1}-\frac{4x+2}{2x+1}\right)$$
$$h_1(x)=\frac{1}{4}\left(\frac{4x^2+4}{2x+1}\right)$$
$$h_1(x)=\frac{x^2+1}{2x+1}$$

4/ 
about the case $a_{n+1}=a_n^2-2$
This case is interested because, for the previous case, resolved by Francesco and Jean-Marie, we could make changes of invertible variables, here not.
We use, a function $v$, no invertible, so $u(x)=x^2$ and $t(x)=x^2-2$ are not conjugate, but the trick continues to work and here 
$$v(x)=x+\frac{1}{x}$$
we have : 

$$\text{ if } a_{n+1}=a_n^2-2, \text{ and }b \in \mathbb C \text{ with } a_0=b+\frac{1}{b} \text{ then } a_n=b^{2^{n}}+\frac{1}{b^{2^n}}$$

</s>