<s>[INST] Solve for x (quadratic equation) How do you solve the following equation:
\begin{align*}
\sqrt{2017 + \sqrt{2017 - x}} &= x
\end{align*}
I tried squaring it twice, but then I am left with quadratic equation that I can not solve.
 [/INST] Let $2017-x=y^2$, where $y\geq0$.
Hence, $x+y>0$ and $2017+y=x^2$, which gives $y+x=x^2-y^2$ or $x-y=1$ and the rest is smooth.
We have $y=x-1$, $2017+x-1=x^2$ or $$x^2-x-2016=0$$ and since $x>0$, 
we get the answer $\{\frac{1+\sqrt{8065}}{2}\}$.
</s>