Closed / explicit form of a recursively defined real function involving a square root? Let $x\geqslant-1$ be a real number, and $x_n$ be a sequence defined recursively as:
$$x_{n+1}= \begin{cases}
x_n\sqrt{\dfrac{1+x_n/x_{n-1}}2}, &\text{ if } x_n\neq 0 \\
0, &\text{ if } x_n = 0
\end{cases}$$
for $n\in\Bbb N$ with starting values $(x_0,x_1) := (1, x)$.
The sequence depends on $x$ and thus the limit (if it exists) defines a function
$$\begin{align}
f: [-1,\infty) &\to \Bbb R \\
x &\mapsto \lim_{n\to\infty} x_n
\end{align}$$
The question is then to find a representation for $f(x)$.
I have no idea even where to start.  It's easy to show that $f(1) = 1$ and $f(-1) = f(0) = 0$, but apart from these trivial cases I only have that $f(x) \geqslant 0$ if $x>0$, and that $f(x) \leqslant 0$ if $-1<x<0$ (under the assumption the limit exists).
It's easy to show that $x_n/x_{n-1}\to 1$ provided all $x_n\neq0$, but that doesn't lead anywhere.
There are two values given:
$$f(1/2) = \frac{3\sqrt3}{4\pi}$$
and
$$f(2) = \frac{2\sqrt3}{\ln(2+\sqrt3)}$$
but they only serve to verify the solution.
Edit: There is also a hint that $\cos 2x = 2\cos^2x-1$ which appears to be somehow related to the recursion, but I have no idea how to apply it.
 A: We first treat the case where $-1\leq x<1$. Let $x=x_1=\cos\theta$, where $0<\theta\leq \pi$. Then we claim that
$$x_n=\prod_{k=0}^{n-1}\cos\left(\frac\theta{2^k}\right).$$
We can show this by strong induction on $n$. It is clear that this holds for $n=0$ and $n=1$; if it holds for some $n$ and $n-1$ then
$$x_{n+1}=x_n\sqrt{\frac{1+\frac{x_n}{x_{n-1}}}2}=x_n\sqrt{\frac{1+\cos\left(\frac{\theta}{2^{n-1}}\right)}2}=x_n\cos\left(\frac\theta{2^n}\right),$$
where we have used that $\sqrt{\frac{1+\cos(2\alpha)}2}=\cos\alpha$ whenever $\alpha<\pi$. Now, we can show by induction on $n$ that
$$x_n=\frac{\sin(2\theta)}{2^n\sin\left(\frac{\theta}{2^{n-1}}\right)},$$
using the formula $\cos\alpha=\frac{\sin2\alpha}{2\sin\alpha}$ and telescoping. Since $\sin \epsilon\sim\epsilon$ for small $\epsilon$,
$$\lim_{n\to\infty}x_n=\lim_{n\to\infty}\frac{\sin2\theta}{2^n\sin\left(\frac\theta{2^{n-1}}\right)}=\frac{\sin2\theta}{2\theta}.$$
Put another way,
$$f(x)=\frac{x\sqrt{1-x^2}}{\arccos(x)}$$
for $-1\leq x<1$.

Now, we treat the case where $x>1$. Let $x=x_1=\cosh(t)=\frac{e^t+e^{-t}}2$ for $t>0$; we claim that
$$x_n=\frac{e^{2t}-e^{-2t}}{2^n\left(e^{2^{1-n}t}-e^{-2^{1-n}t}\right)}$$
for every $n$. Again, this holds for $n=0$ and $n=1$. If it holds for some $n$ and $n-1$, then
$$\frac{x_n}{x_{n-1}}=\frac{2^{n-1}\left(e^{2^{2-n}t}-e^{-2^{2-n}t}\right)}{2^n\left(e^{2^{1-n}t}-e^{-2^{1-n}t}\right)}=\frac{e^{2^{1-n}t}+e^{-2^{1-n}t}}2,$$
so that
$$\sqrt{\frac{1+\frac{x_n}{x_{n-1}}}2}=\sqrt{\frac{e^{2^{1-n}t}+2+e^{-2^{1-n}t}}4}=\frac{e^{2^{-n}t}+e^{-2^{-n}t}}2,$$
and
$$x_{n+1}=\frac{e^{2t}-e^{-2t}}{2^n\left(e^{2^{1-n}t}-e^{-2^{1-n}t}\right)}\cdot \frac{e^{2^{-n}t}+e^{-2^{-n}t}}2=\frac{e^{2t}-e^{-2t}}{2^{n+1}\left(e^{2^{-n}t}-e^{-2^{-n}t}\right)}$$
as desired. This gives
$$f(x)=\lim_{n\to\infty}x_n=\lim_{n\to\infty}\frac{e^{2t}-e^{-2t}}{2^n\left(e^{2^{1-n}t}-e^{-2^{1-n}t}\right)};$$
since $e^\epsilon-e^{-\epsilon}\sim2\epsilon$ as $\epsilon\to 0$, the limit is
$$f(x)=\frac{e^{2t}-e^{-2t}}{4t}.$$
Solving $2x=e^t+e^{-t}$ with $t>0$ for $t$, we get $t=\ln(x+\sqrt{x^2-1})$, which gives
$$f(x)=\frac{4x\sqrt{x^2-1}}{4\ln(x+\sqrt{x^2-1})}=\frac{x\sqrt{x^2-1}}{\ln(x+\sqrt{x^2-1})}.$$

So,
$$f(x)=\begin{cases}\frac{x\sqrt{1-x^2}}{\arccos(x)}&-1\leq x<1\\1&x=1\\\frac{x\sqrt{x^2-1}}{\ln(x+\sqrt{x^2-1})}&x>1.\end{cases}$$
