A proof for the quadratic formula, in my textbook had: $$\left( x+\frac{b}{2a} \right)^2 = \frac{b^2-4ac}{4a^2}$$ For $b^2-4ac > 0,$ $$x+\frac{b}{2a}=\pm \sqrt{\frac{b^2-4ac}{4a^2}}$$ So it looks like the operation made to get from the first line to the second was to square both sides.
How come $x+\frac{b}{2a}$ is not $\lvert x+\frac{b}{2a}\rvert$, if $\sqrt {x^2} = \lvert x\rvert$? Does it just only apply when $x \in ℝ$?
Hint: Look at the plus and minus on the right hand side.
$$|x| = y \implies x = \pm y $$