3-4. Solve the equation $\sqrt{a-\sqrt{a+x}}=x$.

---

(Translation provided as requested, maintaining the original formatting and line breaks.)
Solve 4. By eliminating the radicals, we arrive at the equation

$$
x^{4}-2 a x^{2}-x+a^{2}-a=0
$$

With respect to $a$, this is a quadratic equation. Solving it, we get two solutions:

$$
\begin{aligned}
& a=x^{2}+x+1 \\
& a=x^{2}-x
\end{aligned}
$$

Solving these quadratic equations with respect to $x$, we obtain four solutions:

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