a) Determine the sum of the real roots of the equation

$$
x^{2}+18 x+30=2 \cdot \sqrt{x^{2}+18 x+45}
$$

b) Solve the equation $\sqrt{5-\sqrt{5-x}}=x$, with $0<x<5$.

#
Solution

a) Let $x^{2}+18 x+30=y$. Then we have

$$
\begin{aligned}
y & =2 \cdot \sqrt{y+15} \\
y^{2} & =(2 \cdot \sqrt{y+15})^{2} \\
y^{2} & =4 \cdot(y+15) \\
y^{2}-4 y-60 & =0
\end{aligned}
$$

The roots of the last equation are $y=2 \pm 8$, that is, $y_{1}=10$ and $y_{2}=-6$. Since we are looking for real roots, $y$ must be non-negative. Thus, we must discard $y_{2}=-6$ and obtain $x^{2}+18 x+30=10$. Since the discriminant of this equation is positive, both roots are real and both satisfy the equation, as $y_{1}+15 \geq 0$. Thus, the sum of the roots is -18.

b) Let $x$ be a solution of the equation. Then:

$$
\begin{aligned}
\sqrt{5-\sqrt{5-x}} & =x \\
(\sqrt{5-\sqrt{5-x}})^{2} & =x^{2} \\
5-\sqrt{5-x} & =x^{2} \\
5-x^{2} & =\sqrt{5-x} \\
\left(5-x^{2}\right)^{2} & =(\sqrt{5-x})^{2} \\
\left(5-x^{2}\right)^{2} & =(5-x)
\end{aligned}
$$

Developing the above notable products, we have:

$$
\begin{aligned}
\left(5-x^{2}\right)^{2} & =(5-x) \\
5^{2}-2 \cdot 5 \cdot x^{2}+x^{4} & =5-x \\
5^{2}-\left(2 x^{2}+1\right) \cdot 5+\left(x^{4}+x\right) & =0
\end{aligned}
$$

For a fixed $x$, the number 5 is a root of the quadratic equation:

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

The discriminant of the above equation is:

$$
\begin{aligned}
\Delta & =\left[-\left(2 x^{2}+1\right)\right]^{2}-4 \cdot 1 \cdot\left(x^{4}+x\right) \\
& =4 x^{4}+4 x^{2}+1-4 x^{4}-4 x \\
& =(2 x-1)^{2}
\end{aligned}
$$

Since $x>0, \sqrt{\Delta}= \pm(2 x-1)$. Since 5 is one of the roots of the equation, we have:

$$
5=\frac{2 x^{2}+1 \pm(2 x-1)}{2}
$$

We have two cases to consider:

$$
\begin{aligned}
\frac{2 x^{2}+1+(2 x-1)}{2} & =5 \\
x^{2}+x-5 & =0 \\
x & =\frac{-1 \pm \sqrt{21}}{2}
\end{aligned}
$$

or

$$
\begin{aligned}
\frac{2 x^{2}+1-(2 x-1)}{2} & =5 \\
x^{2}-x-4 & =0 \\
x & =\frac{1 \pm \sqrt{17}}{2}
\end{aligned}
$$

Since $0<x<5$, the two negative roots need to be eliminated. Moreover, it is easy to verify that the other two satisfy the original equation. Therefore,

$$
S=\left\{\frac{-1+\sqrt{21}}{2}, \frac{1+\sqrt{17}}{2}\right\}
$$