<s>[INST] Calculating $ x= \sqrt{4+\sqrt{4-\sqrt{ 4+\dots}}} $ If $ x= \sqrt{4+\sqrt{4-\sqrt{ 4+\sqrt{4-\sqrt{ 4+\sqrt{4-\dots}}}}}} $
then find value of 2x-1
I tried the usual strategy of squaring and substituting the rest of series by x again but could not solve.
 [/INST] Solution without complex factorization:
Let,
$ x= \sqrt{4+\sqrt{4-\sqrt{ 4+\dots}}} $
$ y= \sqrt{4-\sqrt{4+\sqrt{ 4-\dots}}} $
Clearly,
$x = \sqrt{4 + y} \implies x^2 - y = 4$    (i)
$y = \sqrt{4 - x} \implies y^2 + x = 4$    (ii)
from (i) and (ii) we get,
$x^2 - y = y^2 + x$
$\implies (x+y)(x-y) = x+y$
Since, $x,y \ge 0$, we have $x+y \ne 0$
So, $x = y + 1$   (iii)
Putting (iii) in (i) or (ii) we get:
$x = \frac{\sqrt{13}+1}{2}$.
</s>