The Infinitely Nested Radicals Problem and Ramanujan's wondrous formula In mathematics, a nested-radical is any expression where a radical (or root sign) is nested inside another radical, e.g. $\sqrt{2 + \sqrt{3}}$.
By extension, an infinitely nested radical (aka, a continued root) is an expression where infinitely many radical expressions are nested within each other. A famous example would be:
$\sqrt{x\sqrt{x\sqrt{x \dots}}} = \sqrt{x x} = x, \forall x \in \mathbb{R}$.
Another common (and easy to solve) variety occurs when the pattern of numbers within the radicals follows a regular repeating pattern.
A simple example of this type is $y = \sqrt{2 + \sqrt{2 + \sqrt{2 + \dots}}} = \sqrt{2 + y} = 2$. The key is simply to notice that the expression after one repeated cycle is the same as the original and solve the resulting polynomial equation. (A couple of examples here.

However, while the above examples were simple, nested roots can actually be quite important and satisfying beyond the surface level.
a) The Golden Ratio :
The Golden Ratio, $\phi = \frac{1 + \sqrt{5}}{2}$ is well-known for its regularity and recurring appearance is diverse areas of nature, art and mathematics. The famous continued fraction expression  $\phi = 1 + \cfrac{1}{1+ \cfrac{1}{1 + \cdots}}$ is however, also equivalent to the folowing continued square root $\phi = \sqrt{1 + \sqrt{1+ \sqrt{1 + \dots}}}$
b) Viète's formula: An approximation for $\pi$ that has been called the starting point of mathematical analysis and even "the dawn of modern mathematics", the formula is:
$$\frac{2}{\pi} = \frac{\sqrt{2}}{2} \cdot \frac{\sqrt{2 + \sqrt{2}}}{2} \cdot \frac{\sqrt{2 + \sqrt{2 + \sqrt{2}}}}{2} \cdot \dots$$ which already contains nested radicals.
Interestingly, this can also be expressed as:
$$\pi = \lim_{k\to\infty} 2^k\cdot\sqrt{2-\sqrt{2+\sqrt{2+... (\text{k - 1 times})}}}$$
which not only contains an infinitely nested radical, but it also contains the same elementary example $\sqrt{2+\sqrt{2 + \dots}}$ from above in slightly modified form!
(c) All real numbers in the range $[0,2]$ can be expressed as the infinitely nested radical $\sqrt{2 \pm \sqrt{2 \pm \sqrt{2 \pm \dots}}}$
Examples: $2=\sqrt{2 + \sqrt{2 + \sqrt{2 + \dots}}}=(+)$, $1=\sqrt{2 - \sqrt{2 - \sqrt{2 - \dots}}}=(-)$, $\phi=\sqrt{2 + \sqrt{2 - \sqrt{2 + \sqrt{2 - \dots}}}}=(+-)$ (The Golden Ratio again!)
(d) Infinitely nested equations are related to polynomial equations and can be sued to find their roots

There can be many more examples of such problems.
However, the difficult problem here is to solve non-repeating continued-roots such as $\sqrt{1 + \sqrt{2 + \sqrt{3 + \dots}}}$. From a cursory look, one might even expect that expression might be divergent! However, it is actually the Nested Radical constant $1.757932 \dots$ (OEIS A072449), for which no closed-form expression is known.
Thus, one can have an arbitrary continued-root, say $\sqrt{a_1 + b_1 \sqrt{a_2 + b_2 \sqrt{a_3 + b_3 \sqrt{a_4 + \dots}}}}$, where the constants might be determined by some complicated set of rules of formulae. And even for the simplest non-repeating cases, one's ability to solve will be entirely dependent on the ability for algebraic manipulation and knowledge of diverse theorems which might sometimes help.
Or so I believed ...
Enter Srinivasa Ramanujan...
In 1911, around 2 years before he first contacted Hardy, Ramanujan published the following problem in the Journal of the Indian Mathematical Society:
$$\sqrt{1 + 2 \sqrt{1 + 3 \sqrt{1 + \dots}}}$$
After waiting 6 months without any solutions, he supplied the following formula from page 105 of his first notebook:
$$x + n + a = \sqrt{ax + (n+a)^2 + x \sqrt{a(x+n) + (n+a)^2 + (x+n) \sqrt{\dots}}}$$
And setting $x=2$, $n=1$ and $a=0$, we get the solution $$\sqrt{1^2 + (2) \sqrt{1^2+ (2+1)\sqrt{1^2 + \dots}}} = 2+1+0 = 3$$.
(Pg 86-87, The Man Who Knew Infinity: A Life of the Genius Ramanujan, Robert Kanigel, 5th ed. 1991)

Right off the bat, we can notice some interesting things here:

*

*While we cannot use this formula for the Nested Radical Constant above, it does allow us to find the values of infinitely many continued-roots. In particular we can immediately solve any fraction where the terms are in an Arithmetic Progression $\sqrt{a + b \sqrt{(a+d) + (a+d) \sqrt{(a+2d) + (a+2d) \sqrt{\dots}}}} = a+d + 1$.


*We can generalize this further:
$\sqrt{c.a + b \sqrt{(a+d) + c.(a+d) \sqrt{c.(a+2d) + (a+2d) \sqrt{\dots}}}} = a+d + c$.


*For any given natural number $n$, we can use this formula to find a number of unique nested fraction expressions equal to $q(n)$, the number of partitions of that number.
And so on...

My question:

*

*How can we prove this formula? While Ramanujan himself usually derived results with great insight via intuition, I expect that the formula itself should be provable with usual mathematical techniques, especially with the amount of influence Ramanujan had on subsequent mathematics, and the high volume of work on continued fractions which are related to nested-radicals. So, can anyone find any proof for this - either on their own or in existing literature?


*If we cannot prove this, is it possible to find some motivation that makes it more intuitively clear. This should be possible since that was the way it was originally obtained.


*Any other interesting observations about this formula? Is it related to any other mathematical results? Perhaps it is related to some series, constants or continued fractions?
 A: Method 1:- (More General)
As $$(x+a)^2=x^2+a^2+2ax$$
Replacing $a$ by $n+a$ in above equation where $x,n,a\in R$
$$(x+(n+a))^2=x^2+(a+n)^2+2x(a+n)$$
$\ \implies(x+(n+a))^2=x^2+(a+n)^2+2ax+2nx$
$\ \implies(x+(n+a))^2=ax+(a+n)^2+x^2+2nx+ax$
$\ \implies(x+(n+a))^2=ax+(a+n)^2+x(x+2n+a)$
Taking positive square roots on both sides of above equation
$(x+n+a)=\sqrt{ax+(a+n)^2+x(x+2n+a)}$
Now replacing $x$ by $x+n$
$x+2n+a=\sqrt{a(x+n)+(a+n)^2+(x+n)(x+3n+a)}$
$x+3n+a=\sqrt{a(x+2n)+(a+n)^2+(x+2n)(x+4n+a)}$
$x+4n+a=\sqrt{a(x+3n)+(a+n)^2+(x+3n)(x+5n+a)}$
Inducing these results to $k\in N$ we have,
$x+kn+a=\sqrt{a(x+(k-1)n)+(a+n)^2+(x+(k-1)n)(x+(k+1)n+a)}$
Putting the value for $x+2n+a$ in square root of $x+n+a$
$$(x+n+a)=\sqrt{ax+(a+n)^2+x \sqrt{a(x+n)+(a+n)^2+(x+n)(x+3n+a)}}$$
Now Doing this Process continuously we have our orignal infinite nested radical for $x+n+a$.
On setting $x=2,a=0,n=1$ we get
$$\sqrt{1^2 + (2) \sqrt{1^2+ (2+1)\sqrt{1^2 + \dots}}} = 2+1+0 = 3$$
Method 2:-(slightly less general)
Let $f(n)=\sqrt {1+(n+1)\sqrt{1+(n+2)\sqrt{1+...}}}$
Then $f(n)=\sqrt{1+(n+1)f(n+1)}$
$\implies f(n+1)=\frac{(f(n))^2-1}{n+1}$
Asymptotically we have $(f(n))^2\sim(n+1)f(n+1)$
If we assume $f(n)=an+b$(By equating degrees on both sides) and put in equation for $f(n+1)$
we get,
$n^2(a^2-a)+n(2ab-2a-b)+(b^2-1-a-b)=0$
This gives $a=1$ and $b=2$
so $f(n)=n+2$
For $n=1$ we have
$$\sqrt {1+2\sqrt{1+3\sqrt{1+...}}}=3$$
