<s>[INST] Integrals of $\sqrt{x+\sqrt{\phantom|\dots+\sqrt{x+1}}}$ in elementary functions Let $f_n(x)$ be recursively defined as
$$f_0(x)=1,\ \ \ f_{n+1}(x)=\sqrt{x+f_n(x)},\tag1$$
i.e. $f_n(x)$ contains $n$ radicals and $n$ occurences of $x$:
$$f_1(x)=\sqrt{x+1},\ \ \ f_2(x)=\sqrt{x+\sqrt{x+1}},\ \ \ f_3(x)=\sqrt{x+\sqrt{x+\sqrt{x+1}}},\ \dots\tag2$$
The functions $f_0(x)$, $f_1(x)$ and $f_2(x)$ are integrable in elementary functions, e.g.:
$$\int\sqrt{x+\sqrt{x+1}}\,dx=\left(\frac{2\,x}3+\frac{\sqrt{x+1}}6-\frac14\right)\sqrt{x+\sqrt{x+1}}+\frac58\ln\left(2\,\sqrt{x+1}+2\,\sqrt{x+\sqrt{x+1}}+1\right).\tag3$$


Question: Is there an integer $n>2$ such that $f_n(x)$ is integrable in elementary functions?


Update: The question is reposted at MathOverflow as was suggested by moderator.
 [/INST] I think there is highly have no chance to have an integer $n>2$ such that $f_n(x)$ is integrable in elementary functions.
The reasons are mainly because of the processes of eliminating the radicals.
For $f_0(x)$ and $f_1(x)$ , they are trivially integrable in elementary functions.
For $\int f_2(x)~dx$ ,
Let $u=\sqrt{x+1}$ ,
Then $x=u^2-1$
$dx=2u~du$
$\therefore\int\sqrt{x+\sqrt{x+1}}~dx$
$=\int2u\sqrt{u^2+u-1}~du$ , which can express in elementary functions.
Starting from $\int f_3(x)~dx$ ,
Let $u=\sqrt{x+1}$ ,
Then $x=u^2-1$
$dx=2u~du$
$\therefore\int\sqrt{x+\sqrt{x+\sqrt{x+1}}}~dx$
$=\int2u\sqrt{u^2-1+\sqrt{u^2+u-1}}~du$
Introduce the Euler substitution:
Let $v=u+\sqrt{u^2+u-1}$ ,
Then $u=\dfrac{v^2+1}{2v+1}$
$du=\dfrac{2v(2v+1)-(v^2+1)2}{(2v+1)^2}dv=\dfrac{2v^2+2v-2}{(2v+1)^2}dv$
$\therefore\int2u\sqrt{u^2-1+\sqrt{u^2+u-1}}~du$
$=\int2\dfrac{v^2+1}{2v+1}\sqrt{\left(\dfrac{v^2+1}{2v+1}\right)^2-1+v-\dfrac{v^2+1}{2v+1}}\dfrac{2v^2+2v-2}{(2v+1)^2}dv$
$=\int4\dfrac{(v^2+1)(v^2+v-1)}{(2v+1)^3}\sqrt{\dfrac{(v^2+1)^2-(v^2+1)(2v+1)+(v-1)(2v+1)^2}{(2v+1)^2}}~dv$ , which is highly have no chance to express in elementary functions.
</s>