Artificial intelligent assistant

Avoiding extraneous solutions When solving quadratic equations like $\sqrt{x+1} + \sqrt{x-1} = \sqrt{2x + 1}$ we are told to solve naively, for example we would get $x \in \\{\frac{-\sqrt{5}}{2},\frac{\sqrt{5}}{2}\\}$, even though the first solution doesn't work, and then try all the solutions and eliminate the extraneous ones. This is not a very elegant algorithm! How would one use the fact that $\sqrt{x}^2= |x|$ to avoid having to check answers?

If you ensure that $$ \begin{cases} x+1\ge0\\\ x-1\ge0\\\ 2x+1\ge0 \end{cases} $$ then you can square both sides, because they are guaranteed to exist and, when $a,b\ge0$, $a=b$ if and only if $a^2=b^2$.

The conditions above are equivalent to $x\ge1$.

Squaring we get $$ x+1+2\sqrt{x^2-1}+x-1=2x+1 $$ that simplifies to $$ 2\sqrt{x^2-1}=1 $$ and you can square again, because both sides are non negative. This gives $$ 4x^2=5. $$ Since you know that $x\ge1$, the only solution is $$ x=\frac{\sqrt{5}}{2}. $$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 60e3446dfd2efdb6c43df67e2fb037b9