<s>[INST] Finding solution of the irrational equation Given equation $\sqrt{x + 3 - 2\sqrt{x + 2}} + \sqrt{x + 27 - 10\sqrt{x + 2}} = 4$, find its solution(s).
At first, finding the domain of the function. Noting that $\sqrt{x + 2} \geq 0 \implies x \geq -2$. Then, solving inequalities for $x + 3 - 2\sqrt{x + 2} \geq 0$ and $x + 27 - 10\sqrt{x + 2} \geq 0$ we get that their domain $D = \mathbb{R}$, because quadratics which arise from those inequalities have exactly one root - $S_1 = \{-1\}$ and $S_2 = \{23\}$. Because all expressions are greater than $0$, I am omitting absolute values. 
Solving the equation via substitution $t = \sqrt{x + 2}$ we get:
$$\sqrt{x + 3 - 2t} + \sqrt{x + 27 - 10t} = 4$$
$$x + 3 - 2t = 16 - 8\sqrt{x + 27 - 10t} + x + 27 - 10t$$
$$t^2 - 10t + 25 = x + 27 - 10t$$
$$t^2 = x + 2$$
$$x + 2 = x + 2 \implies S = [-2, \infty).$$
But according to my textbook (which I use as a preparation for entrance exams) the solution must be $S = [-1, 23]$, where -1 and 23 are, obviously not coincidently, solutions to the quadratics, which we obtain while solving expressions under square roots. Where do I have a mistake, then?
 [/INST] 
Solving the equation via substitution $t = \sqrt{x + 2}$ we get:
  $$\sqrt{x + 3 - 2t} + \sqrt{x + 27 - 10t} = 4$$
  $$x + 3 - 2t = 16 - 8\sqrt{x + 27 - 10t} + x + 27 - 10t$$

Here, you have to have
$$\sqrt{x+3-2t}=4-\sqrt{x+27-10t}\color{red}{\ge 0}$$

$$t^2 - 10t + 25 = x + 27 - 10t$$

Here, you have to have
$$\sqrt{x+27-10t}=5-t\color{red}{\ge 0}$$

By the way, the equation can be written as
$$\sqrt{(\sqrt{x+2}-1)^2}+\sqrt{(\sqrt{x+2}-5)^2}=4,$$
i.e.
$$|\sqrt{x+2}-1|+|\sqrt{x+2}-5|=4$$
which should be easy to deal with.
</s>