<s>[INST] Confusion about the use of principal roots and their use in expressions I'm struggling to derive the quadratic equation using the principal root $(\sqrt{x^2} = |x|).$
Taking $ax^2 + bx + c = 0$ and solving for $x$, I got $$\left(x+\frac{b}{2a}\right)^2 = \frac{b^2-4ac}{4a^2}.$$
Taking the principal root both sides gave me $$\left|x+\frac{b}{2a}\right| = \frac{\sqrt{b^2-4ac}}{\sqrt{4a^2}}\\x+\frac{b}{2a} = \frac{±\sqrt{b^2-4ac}}{2|a|}.$$
And there's where I struggle. While for $a \geq 0, |a|=a,$ and it goes just well.
But that's not true if $a<0$, I can´t get it right with $a<0.$
Edit : Changed a typing error into the expression of the discriminant
 [/INST] You are making a mistake; you should have $b^2\color{red}-4ac$ instead of $b^2\color{red}+4ac$. Besides, you are using the fact that $a^2=b^2\iff|a|=|b|$, which is correct. However, it is better here to use the fact that $a^2=b^2\iff a=\pm b$. So\begin{align}\left(x+\frac b{2a}\right)^2=\frac{b^2-4ac}{4a^2}\left(=\left(\frac{\sqrt{b^2-4ac}}{2a}\right)^2\right)&\iff x+\frac b{2a}=\pm\frac{\sqrt{b^2-4ac}}{2a}\\&\iff x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}.\end{align}
</s>