For a quadratic equation \(ax^2+bx+c=0\) where \(a,b,c\in\C\) and \(a\neq0\), the solution(s) is(are):
\[x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\]A quadratic equation has the form \(ax^2+bx+c=0\) where \(a,b,c\in\C\) (sometimes \(\R\) is used instead of \(\C\)) and \(a\neq0\). To solve for \(x\), first divide both sides by \(a\):
\[x^2+\frac{b}{a}x+\frac{c}{a}=0\]Next we write out the form for completing the square:
\[x^2+2\left(\frac{b}{2a}\right)x+\left(\frac{b}{2a}\right)^2 -\left(\frac{b}{2a}\right)^2+\frac{c}{a}=0\]The leftmost 3 terms can be factored in the form \(u^2+2uv+v^2=(u+v)^2\) where \(u=x\) and \(v=\frac{b}{2a}\).
\[\left(x+\frac{b}{2a}\right)^2-\left(\frac{b}{2a}\right)^2+\frac{c}{a}=0\]Now, move the other terms to the right side and simplify.
\[\left(x+\frac{b}{2a}\right)^2=\left(\frac{b}{2a}\right)^2-\frac{c}{a} =\frac{b^2}{4a^2}-\frac{4ac}{4a^2}=\frac{b^2-4ac}{(2a)^2}\]Now, the quantity \(x+\frac{b}{2a}\) is squared on the left side, so it is equal to either sign of the square root of the right side. For additional details, see note about roots of complex numbers.
\[x+\frac{b}{2a}=\pm\frac{\sqrt{b^2-4ac}}{2a}\]Then we rearrange this into the form commonly seen:
\[x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\]When \(b^2-4ac=0\), there is 1 root with multiplicity 2. Often, we are interested in quadratic equations where \(a,b,c\in\R\). For those, there are 2 real solutions when \(b^2-4ac>0\), and 2 imaginary solutions when \(b^2-4ac<0\). Sometimes the quantity \(b^2-4ac\) is called the discriminant.
We look at solving the equation specifically for square roots: \(x^2=y\). Let \(x=re^{i\theta}\) and \(y=r'e^{i\theta'}\). Substituting these, we have:
\[r^2e^{2i\theta}=r'e^{i\theta'}\]This means we have \(r=\sqrt{r'}\) and \(2i\theta=i(\theta'+2n\pi)\) for some \(n\in\Z\), so \(i\theta=i\left(\frac{\theta'}{2}+n\pi\right)\). When \(n\) is even, this means \(x=\sqrt{r'}e^{i\theta'/2}=\sqrt{y}\). When \(n\) is odd, we have:
\[x=\sqrt{r'}e^{i\theta'/2+i\pi}=\sqrt{r'}e^{i\theta'/2}e^{i\pi} =-\sqrt{r'}e^{i\theta'/2}=-\sqrt{y}\]So, properties of complex numbers show us that the only roots are \(x=\pm\sqrt{y}=\pm\sqrt{r'}e^{i\theta'/2}\).