(Infinite) Nested radical equation, how to get the right solution? I've been tasked with coming up with exam questions for a high school math contest to be hosted at my university. I offer the following equation,
$$\sqrt{x+\sqrt{x-\sqrt{x+\sqrt{x-\cdots}}}}=2$$
and ask for the solution for $x$.
Here's what I attempted so far. The first utilizes some pattern recognition, but it gives me two solutions (only one of which is correct).
$$\begin{align*}
\sqrt{x+\sqrt{x-\sqrt{x+\sqrt{x-\cdots}}}}&=2\\
\sqrt{x-\sqrt{x+\sqrt{x-\cdots}}}&=4-x\\
\sqrt{x+\sqrt{x-\cdots}}&=x-(4-x)^2\\
2&=x-(4-x)^2&\text{(from line 1)}\\
(x-6)(x-3)&=0
\end{align*}$$
$x=6$ is the extraneous solution. Where did I go wrong, and how can I fix this?
I know there's a closed form for non-alternating nested radicals $\sqrt{n+\sqrt{n+\cdots}}$ and $\sqrt{n-\sqrt{n-\cdots}}$, but I can't seem to find anything on alternating signs.

In the second line, ......$=4-x$. The LHS is a square root which is positive. So $x<4$. After you take the square $(4-x)^2$, you introduced an extra root, which should be rejected at the end.
