TITLE: How to find integral $\underbrace{\int\sqrt{2+\sqrt{2+\sqrt{2+\cdots+\sqrt{2+x}}}}}_{n}dx,x>-2$
QUESTION [8 upvotes]: 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.

REPLY [5 votes]: 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.