How to prove $\sqrt{5+\sqrt{5+\sqrt{5-\sqrt{5+\sqrt{5+\sqrt{5+\sqrt{5-\cdots}}}}}}} = \frac{2+\sqrt 5 +\sqrt{15-6\sqrt 5}}{2}$

The correct period has length 4, namely (+,+,+,-) $$x_1=\small+\sqrt{5+\sqrt{5+\sqrt{5\color{red}-\sqrt{5+\sqrt{5+\sqrt{5+\sqrt{5\color{red}-\cdots}}}}}}} = \frac{2+\sqrt 5 +\sqrt{15-6\sqrt 5}}{2}=2.7472\dots$$ The other roots of the quartic in $x$ are given by the patterns $\small(+,+,-,+),\; (+,-,+,+),\; (-,+,+,+)$, respectively
$$x_2=\small+\sqrt{5+\sqrt{5\color{red}-\sqrt{5+\sqrt{5+\sqrt{5+\sqrt{5\color{red}-\sqrt{5+\cdots}}}}}}} = \frac{2-\sqrt 5 +\sqrt{15+6\sqrt 5}}{2}=2.5473\dots$$

$$x_3=\small+\sqrt{5\color{red}-\sqrt{5+\sqrt{5+\sqrt{5+\sqrt{5\color{red}-\sqrt{5+\sqrt{5+\cdots}}}}}}} = \frac{2+\sqrt 5 -\sqrt{15-6\sqrt 5}}{2}=1.4888\dots$$

$$x_4=\small\color{red}-\sqrt{5+\sqrt{5+\sqrt{5+\sqrt{5\color{red}-\sqrt{5+\sqrt{5+\sqrt{5+\cdots}}}}}}} = \frac{2-\sqrt 5 -\sqrt{15+6\sqrt 5}}{2}=-2.7833\dots$$

This immediately implies that the four roots obey the system, $$\begin{aligned} x_1^2 &= x_2+5\\ x_2^2 &= x_3+5\\ x_3^2 &= x_4+5\\ x_4^2 &= x_1+5\\ \end{aligned}$$ also studied by Ramanujan. (See this related post.) More generally, using any of the $2^4=16$ possible periods,

$$x = \pm\sqrt{a\pm \sqrt{a\pm \sqrt{a\pm \sqrt{a\pm\dots}}}}$$

will be the absolute value of a root of the 16th deg eqn,

$$x = (((x^2 - a)^2 - a)^2 - a)^2 - a\tag{1}$$

In his Notebooks IV (p.42-43), Ramanujan stated that (1) was a product of 4 quartic polynomials, one of which is the reducible,

$$(x^2-x-a)(x^2+x-a+1)=0\tag{2}$$

and the other three had coefficients in the cubic,

$$y^3+3y = 4(1+ay)\tag{3}$$

Using Mathematica to factor (1), we find that it is indeed a product of (2) and a 12th deg eqn with coefficients in a. After some manipulation, the 12 roots are,

$$x_n = -\frac{y-z}{4}\pm\frac{1}{2}\sqrt{\frac{(y-2)(y+z)z}{2y}}\tag{4}$$

where,

$$z =\pm\sqrt{y^2+4}\tag{5}$$

Since there are 4 sign changes and (3) gives 3 choices for $y$, this yields the 12 roots.

Note: For $a=5$ (as well as $a=2$), the cubic factors over $\mathbb{Q}$, hence no cubic irrationalities are involved, and one of the $x_n$ will give the value of the appropriate infinite nested radical.

P.S. Interestingly, for period length $n> 4$, not all the roots of the deg $2^n$ equation will be expressible as finite radical expressions for general $a$. The exception is $a=2$ where the solution involves roots of unity as discussed in this post.


If @Cocopops is correct, in that the +,- signs go like +,+,-,+,+,+,-,+,+,+, ... and the aperiodicity is just at the beginning, this is far less impressive.

Then if

$$x= \sqrt{5+\sqrt{5+\sqrt{5-\sqrt{5+\sqrt{5+\sqrt{5+\sqrt{5-\dots}}}}}}} $$ then $$ y = \sqrt{5+x} = \sqrt{5+\sqrt{5+\sqrt{5+\sqrt{5-\sqrt{5+\sqrt{5+\sqrt{5+\sqrt{5-\dots}}}}}}}}, $$ so the pattern for $y$ is +,+,+,-,+,+,+,-,+,+,+, ... and we can say $$ (((y^2-5)^2-5)^2-5)^2-5 = -y. $$ Numerically we should be able to find a root. However finding the analytic expression still seems hard.

I'd like to suggest that we pose this as a dual question, what if the signs DO follow +,+,-,+,+,+,-,+,+,+,+,-, ...

Does the expression have a closed form? In general, what about radicals of the form $$ \sqrt{a+\sqrt{a-\sqrt{a+\sqrt{a+\sqrt{a-\sqrt{a+\sqrt{a+\sqrt{a+\sqrt{a- \ldots}}}}}}}}}? $$