The quadratic equation \[ax^2 + bx + c = 0\] has the solution(s) \[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}\] assuming that \(a\neq 0\).

Consider \(ax^2 + bx + c = 0\), where \(a \neq 0\).

Since \(a \neq 0\), we can divide by \(a\) to get \[x^2 + \frac{b}{a} x + \frac{c}{a} = 0.\]

We complete the square.

This shows that the original equation is equivalent to \[\left(x + \frac{b}{2a} \right)^2 - \frac{b^2}{4a^2} + \frac{c}{a} = 0.\]

Since \(x\) appears only once in the equation, we can rearrange this to solve for \(x\).

Get the squared term on one side of the equation: \[\left(x + \frac{b}{2a} \right)^2 = \frac{b^2}{4a^2} - \frac{c}{a}.\]

We can rewrite the right-hand side by putting it over a common denominator: \[\left(x + \frac{b}{2a} \right)^2 = \frac{b^2 - 4ac}{4a^2}.\]

We can take the square root of both sides.

Taking account of the possibility of positive and negative square roots, we see \[x + \frac{b}{2a} = \frac{\pm\sqrt{b^2 - 4ac}}{2a}.\]

Subtracting \(\frac{b}{2a}\) from both sides and putting the right-hand side over a common denominator gives \[x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.\]