The quadratic formula, derived
The quadratic formula x = (−b ± √(b²−4ac))/(2a) is derived by completing the square on ax²+bx+c = 0. It works for every quadratic equation with real coefficients.
The discriminant Δ = b² − 4ac tells you everything about the roots before you compute them: Δ > 0 gives two real roots, Δ = 0 gives one repeated root, Δ < 0 gives a complex-conjugate pair.