239. Solve the equation

$$
\sqrt{a-\sqrt{a+x}}=x
$$
239. First solution. Let $\sqrt{a+x}$ be denoted by $y$; we obtain a system of two equations.

$$
\sqrt{a+x}=y, \sqrt{a-y}=x
$$

Square these equations:

$$
a+x=y^{2}, a-y=x^{2}
$$

Subtract the second from the first:

$$
x+y=y^{2}-x^{2}
$$

$\mathrm{H} / \mathrm{H}$

$$
x^{2}-y^{2}+x+y=(x+y)(x-y+1)=0
$$

From this, there are two possibilities:

1) $x+y=0 ; y=-x$ and $x^{2}-x-a=0$, from which

$$
x_{1,2}=\frac{1}{2} \pm \sqrt{a+\frac{1}{4}}
$$

2) $x-y+1=0 ;$ then $y=x+1$ and $x^{2}+x+1-a=0$, from which

$$
x_{3,4}=-\frac{1}{2} \pm \sqrt{a-\frac{3}{4}}
$$

It can be verified by checking that with the appropriate choice of sign for each of the radicals appearing in the original equation, the roots $x_{1}, x_{2}, x_{3}$ and $x_{4}$ satisfy this equation ${ }^{1}$ ).

Second solution. Eliminate the radicals in our equation:

$$
\begin{gathered}
a-\sqrt{a+x}=x^{2} \\
\left(a-x^{2}\right)^{2}=a+x \\
x^{4}-2 a x^{2}-x+a^{2}-a=0
\end{gathered}
$$

Thus, we arrive at a fourth-degree equation. However, this last equation is quadratic in relation to $a$. Solve this equation for $a$, i.e., assume for the moment, [^9] that $x$ is known to us, and on the contrary, $a$ needs to be determined:

$$
\begin{gathered}
a^{2}-\left(2 x^{2}+1\right) a+x^{4}-x=0 \\
a=\frac{2 x^{2}+1 \pm \sqrt{4 x^{4}+4 x^{2}+1-4 x^{4}+4 x}}{2}= \\
=\frac{2 x^{2}+1 \pm \sqrt{4 x^{2}+4 x+1}}{2}=\frac{2 x^{2}+1 \pm(2 x+1)}{2} \\
a_{1}=x^{2}+x+1, \quad a_{2}=x^{2}-x
\end{gathered}
$$

Thus, we see that the equation

$$
a^{2}-\left(2 x^{2}+1\right) a+x^{4}-x=0
$$

has roots

$$
\text { . } a_{1}=x^{2}+x+1, a_{2}=x^{2}-x
$$

from which, according to the general properties of quadratic equations,

$a^{2}-\left(2 x^{2}+1\right) a+x^{4}-x=\left(a-a_{1}\right)\left(a-a_{2}\right)=$

$$
=\left(a-x^{2}-x-1\right)\left(a-x^{2}+x\right)
$$

Thus, our equation takes the form

$$
\left(x^{2}-x-a\right)\left(x^{2}+x-a+1\right)=0
$$

and is easily solved:

$$
\begin{gathered}
x_{1,2}=\frac{1}{2} \pm \sqrt{\frac{1}{4}+a}=\frac{1}{2} \pm \sqrt{a+\frac{1}{4}} \\
x_{3,4}=-\frac{1}{2} \pm \sqrt{\frac{1}{4}+a-1}=-\frac{1}{2} \pm \sqrt{a-\frac{3}{4}}
\end{gathered}
$$