How to find integral $\underbrace{\int\sqrt{2+\sqrt{2+\sqrt{2+\cdots+\sqrt{2+x}}}}}_{n}dx,x>-2$ Find the integral
$$\int\underbrace{\sqrt{2+\sqrt{2+\sqrt{2+\cdots+\sqrt{2+x}}}}}_{n}dx,x>-2$$
where $n$ define  the number of  the square 
I know  this  if 
$0 \le x\le 2$, then let $$x=2\cos{t},0\le t\le\dfrac{\pi}{2}$$
so
$$\sqrt{2+x}=\sqrt{2+2\cos{t}}=2\cos{\dfrac{t}{2}}$$
so
$$\sqrt{2+\sqrt{2+x}}=2\cos{\dfrac{t}{2^2}}$$
so
$$\int\sqrt{2+\sqrt{2+\sqrt{2+\cdots+\sqrt{2+x}}}}dx=\int2\cos{\dfrac{t}{2^n}}(-2\sin{t})dt$$
and for $x\ge 2$ case, I  let
$x=\cosh{t}$, but for  $-2\le x\le 0$ case, I can't do it.
 A: You were too timid: For $-2\leq x\leq2$ use the substitution
$$x=2\cos t\qquad(-\pi\leq t\leq 0)\ .$$
Then everything goes through as before:
$$\sqrt{2+x}=\sqrt{2+2\cos t}=2\cos{t\over2},\quad \sqrt{2+\sqrt{2+x}}=\sqrt{2+\cos{t\over2}}=2\cos{t\over4}\ ,$$
etcetera.
A: For the finitely many nested radical case,
$$-4\int \cos\left(\frac{t}{2^n}\right)\sin t\,dt=-2\int \left(\sin(2^{-n}t+t)-\sin(2^{-n}t-t)\right)\,dt$$
$$=-2\left(-\frac{\cos(t(2^{-n}+1))}{2^{-n}+1}+\frac{\cos(t(2^{-n}-1))}{2^{-n}-1}\right)+C$$
Substitute $t=\arccos(x/2)$ to obtain the answer.
The substitution is valid for $-2\le x\le 2$. 
I hope this addresses the issue.
A: I think you have the wrong approach, take a look at this
$$f(x) = \sqrt{2+\sqrt{2+...+\sqrt{2+x}}}   $$
Square both sides
$$(f(x))^2 = 2+\sqrt{2+...+\sqrt{2+x}}   $$
$$(f(x))^2 = 2+f(x) $$
$$(f(x))^2 -f(x)-2= 0 $$
This has two solutions $f(x)=2$ and $f(x)=-1$
Note that $f(x)$ cannot be -1, since square root is always positive for real numbers, and it is given that $x > -2$
Hence you have $f(x)=2$, which is independent of $x$
The answer is therefore finally 2x
