# How does this discontinuity occur in evaluating a nested square root?

This question is based on a comment I made on a question likely to be closed. Let $$y=\sqrt {x+ \sqrt {x+ \sqrt {x+ \sqrt {x+ \sqrt {x+ \dots}}}}}$$ be the classic nested square root which has appeared many times in questions in one form or another.

We have $y^2=x+y$ so that $$y=\frac {1\pm\sqrt {1+4x}}2$$

Now if $x\gt 0$ then $y\gt 0$ and we must take the positive square root, and we have $y\gt 1$ and tends to $1$ as $x$ approaches zero from above.

If $x=0$ it is obvious that we have $y=0$ and this is achieved by taking the negative square root in the quadratic formula. The positive square root gives the limit $1$ which looks ridiculous as a value of the expression.

I am looking for an explanation of how this rather curious discontinuity arises - what are the danger signs that there might be a problem with this value?

Note (8 July) - I'm still not satisfied that I have developed a sound intuition of what's going on here, except that nesting square roots need not commute with other limit operations at critical points - it is a nastier operation than meets the eye.

-
For $x=0$, $y = 0, 1$ are the two inevitable roots of $y^2 = x +y$, not necessarily the original problem. – Jason Knapp Jul 7 '14 at 14:20
@JasonKnapp Indeed, but what indication is there that the value at zero is not the same as the limit at zero? What in the formula might tell me that there is a switch? And incidentally a limit like this might be used to build discontinuous functions in a non-standard way. – Mark Bennet Jul 7 '14 at 15:03

Consider the simpler problem $\sqrt{\sqrt{\sqrt{\ldots\sqrt{x}}}}$. If $x=0$ then each square root produces 0 so the limit is 0. But if $x>0$ then each square root pushes the value toward 1 and the limit is 1.

Now going back to your problem, if $x=0$ then your problem reduces to the simplified one. Also, if $x$ is very small and positive, your problem is similar to the simplified problem because adding $x$ to each square root does not change it much.

Thus the discontinuity in your problem exists for the same reason as in the simplified problem: 0 and any value $> 0$ are in separate basins of attraction of the square root function, with respective fixed points 0 and 1.

-

For $x > 0$, the function $g(y) = \sqrt{x + y}$, $-x \le y < \infty$, has one fixed point $p = (-1 + \sqrt{1 + 4 x})/2$ (the other solution $q = (-1 - \sqrt{1+4x})/2$ is outside the domain). Since $0 < g'(p) = \dfrac{1}{\sqrt{4 x+2+2 \sqrt{1+4 x}}} < 1$, this fixed point is always stable; in fact it is globally stable. However, for $x=0$ the second solution $q$ is a fixed point which is an endpoint of the domain, and for $-1/4 < x < 0$ it is a fixed point inside the domain.

Now your nested square root should be interpreted as the limit, if it exists, of a sequence $y_n$ with $y_{n+1} = g(y_n)$. In principle this will depend on what is taken as the starting point $y_0$. If $x > 0$, it doesn't matter because the fixed point $p$ is globally stable: for any $y_0 \in [-x,\infty)$, $\lim_{n \to \infty} y_n = p$. For $x = 0$, this will still be the case if $y_0 > 0$, but if you start at $y_0 = 0$ you stay there.
For $-1/4 < x < 0$, again you have $y_n \to p$ if $y_0 > q$, but $y_n$ eventually becomes undefined if $y_0 < q$.

-

Hmm, it won't let newbs add comments so I have to add another reply. One way to get my result is first define $y=\sqrt{g}$ and chain it:

$$g=x+\sqrt{x+\sqrt{x+...}}\\ \frac{d}{dx}{g}=1+\frac{d}{dx}\sqrt{x+\sqrt{x+...}}=1+y'\\ \frac{d}{dx}y=\frac{d}{dx}\sqrt{g}=\frac{g^{-1/2}}{2}\frac{d}{dx}{g}=\frac{1}{2y}(1+y'), \left\{y\ne0\right\}$$

You can get the same thing through implicit differentation of $y^{2}=y+x$. Mark Bennet's approach crashes because we are not allowed to take a derivative of a multivalued relation without first restricting the range. In doing so, we could compare $y(0)$ with $\lim\limits_{x\to0^+}y$, recognize the discontinuity apriori, and thus anticipate weirdness from traditional derivative formulae; this is far from intuitive. However, you can see it if you apply the formal definition of the derivative and attempt to evaluate it at $x=0$:

$\frac{d}{dx}y\bigg|_{x=0}=\lim\limits_{h\to0}\frac{\sqrt{x+h+\sqrt{x+h+...}}-\sqrt{x+\sqrt{x+...}}}{h}\bigg|_{x=0}=\lim\limits_{h\to0}\sqrt{\frac{1}{h}+\sqrt{\frac{1}{h^3}+...}}$

--a limit which clearly does not exist.

-
You would expect the limit of the derivative not to exist at $x=0$ because it doesn't exist for $y=\sqrt x$ anyway (goes to infinity) - taking the positive value of the square root. – Mark Bennet Jul 8 '14 at 17:53

To answer "how" the discontinuity arises, just take the derivative:

y' = (1+y') / (2y)

Sorry, I don't know how to do the pretty math..anyway, even after only one application of the chain rule it is obvious there is a discontinuity at x=0.

-
I don't quite follow this - the derivative is not defined where the function is discontinuous. The formula comes out as $y'=\frac 1{2y-1}$ which only has an obvious problem when $y=\frac 12$ and that is not the case here. – Mark Bennet Jul 8 '14 at 5:47