4. Solve the equation for $x$

$$
\sqrt{x-\sqrt{x-a}}=a
$$
Solution. By squaring the irrational equation, we obtain

$$
x-\sqrt{x-a}=a^{2} \text { or } \quad \sqrt{x-a}=x-a^{2} .
$$

By squaring again, we obtain the following quadratic equation

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

whose solutions are:

$$
x_{1}=a^{2}+a, x_{2}=a^{2}-a+1
$$

It is necessary to check in which case these are solutions to the irrational equation. For $a>1, \sqrt{a^{2}-2 a-2}>1$ and there are no solutions for $a<0$.

## III year