I'm currently learning about radicals and simplifying them, and I came across this problem on the internet and tried to solve it:
$\sqrt{x+5} = x - 1$
So I used this logic:
$ \begin{align} \sqrt{x+5} &= x - 1 \\ x + 5 &= (x-1)^2 \\ x + 5 &= (x-1)(x-1) \\ x + 5 &= x^2 - 2x + 1 \\ 0 &= x^2 - 3x - 4 \\ 0 &= (x-4)(x+1) \\ \end{align} $
Therefore, $x = -1$ and $x = 4$ satisfy the equation $0 = (x-4)(x+1)$.
But then I tried to plug them in the original problem $\sqrt{x+5}=x-1$:
$ \begin{align} \sqrt{4 + 5} &= 4 - 1 \\ \sqrt{9} &= 3 \\ 3 &= 3 \end{align} $
So using 4 works as expected, but when using $-1$:
$ \begin{align} \sqrt{-1 + 5} &= -1 - 1 \\ \sqrt{4} &= -2 \\ 2 &\ne -2 \end{align} $
At what stage am I going wrong?
And according the WolframAlpha, the solution is $x = 4$.