I've been thinking about repeating square roots: $\sqrt{x+\sqrt{x+\sqrt{x+\cdots}}}$. I wrote a program on my calculator to do it $n$ times and I found that, if $x = y^2 - y$ then $\sqrt{x+\sqrt{x+\sqrt{x+\cdots}}}$ approaches $y$ as $n$ gets large. So, solving for $y$:
$$y^2 - y - x = 0$$ $$y = \frac{1 \pm \sqrt{1 + 4x}}{2} = \frac{\sqrt{4x + 1} + 1}{2}$$
$$\sqrt{x+\sqrt{x+\sqrt{x+\cdots}}} =\frac{\sqrt{4x + 1} + 1}{2} $$
This works, but where does the $y^2-y=x$ come from? I got here via plugging and guessing, but how can I prove that with an input of $x$ where $x = y^2 - y$, the answer will be $y$?