“Factor it and solve” falls apart the moment a quadratic refuses to factor. The rescue is simple: substituting into the quadratic formula always produces the roots, factorable or not. Computing the discriminant $D = b^2 - 4ac$ first tells you how many real roots exist before you finish solving.

This guide includes a method-selection table, a visual comparison of the three discriminant parabola cases, five worked examples with full substitutions, and a free interactive calculator.

Which Method Should You Use? Quick Decision Table

First move all terms to one side so the equation is in standard form $ax^2 + bx + c = 0$ ($a \neq 0$), then choose the fastest method:

Method Best Equation Pattern Practical Rule Example
Square Root Property $b = 0$ (no linear $x$ term) Solve $x^2 = -c/a$ directly $x^2 - 9 = 0 \rightarrow x = \pm 3$
Factoring Integer pair multiplying to $c$ and adding to $b$ is obvious Use if spotted within 30 seconds $x^2 - 5x + 6 = (x-2)(x-3) = 0$
Quadratic Formula Non-factorable, fractional/irrational roots, or any case Universal fallback that always works $2x^2 + 3x - 2 = 0,\ x^2 + x + 1 = 0$

The Quadratic Formula and the Discriminant D = b² − 4ac

For $ax^2 + bx + c = 0$ ($a \neq 0$), the roots are given by:

x = (−b ± √(b² − 4ac)) ÷ 2a

The expression under the square root, $b^2 - 4ac$, is the discriminant ($D$). Its sign matches the number of real roots and the number of times the parabola $y = ax^2 + bx + c$ intersects the $x$-axis ($y = 0$):

Discriminant $D = b^2 - 4ac$ Root Classification Graph of $y = ax^2 + bx + c$ vs. $x$-Axis Worked Example
D > 0 Two distinct real roots Crosses the $x$-axis at 2 points $x^2 - 5x + 6 = 0\ (D = 1 \rightarrow x = 2, 3)$
D = 0 One repeated real root Vertex touches the $x$-axis at 1 point $x^2 + 6x + 9 = 0\ (D = 0 \rightarrow x = -3)$
D < 0 No real roots (two complex conjugates) Never meets the $x$-axis $x^2 + x + 1 = 0\ (D = -3 \rightarrow x = \frac{-1 \pm \sqrt{3}i}{2})$
Side-by-side comparison of three parabolas: D > 0 (y = x² - 5x + 6 crossing the x-axis at x = 2 and x = 3), D = 0 (y = x² + 6x + 9 touching the x-axis at x = -3), and D < 0 (y = x² + x + 1 staying above the x-axis with no real roots)
How the sign of the discriminant D = b² − 4ac determines where y = ax² + bx + c meets the x-axis (y = 0). Open full image

The quadratic formula comes directly from completing the square on $ax^2 + bx + c = 0$ to obtain $(x + \frac{b}{2a})^2 = \frac{b^2 - 4ac}{4a^2}$. Notice that when $D$ is zero or a perfect square ($1, 4, 9, 16, 25\dots$) with integer coefficients, $\sqrt{D}$ is an integer and the quadratic factors over the rationals.

Worked Examples with Step-by-Step Substitutions

Example 1: x² − 5x + 6 = 0 (Two Distinct Real Roots)

With $a = 1,\ b = -5,\ c = 6$, the discriminant is:

D = (−5)² − 4 × 1 × 6 = 25 − 24 = 1

Since $D = 1 > 0$, there are two distinct real roots. Substituting into the formula:

x = (−(−5) ± √1) ÷ (2 × 1) = (5 ± 1) ÷ 2

giving $x = 3$ and $x = 2$. Factoring $(x - 2)(x - 3) = 0$ gives the same result, and substituting $x = 2$ gives $4 - 10 + 6 = 0$.

Example 2: 2x² + 3x − 2 = 0 (Leading Coefficient a ≠ 1 and c < 0)

With $a = 2,\ b = 3,\ c = -2$:

D = 3² − 4 × 2 × (−2) = 9 + 16 = 25

x = (−3 ± √25) ÷ (2 × 2) = (−3 ± 5) ÷ 4

so $x = 2/4 = 1/2$ and $x = -8/4 = -2$, matching $(2x - 1)(x + 2) = 0$. Watch how negative $c$ makes $-4ac$ positive ($+16$) and the denominator is $2a = 4$.

Example 3: x² + 6x + 9 = 0 (Repeated Root, D = 0)

Here $D = 6^2 - 4 \times 1 \times 9 = 36 - 36 = 0$:

x = (−6 ± √0) ÷ 2 = −6 ÷ 2 = −3

Because $\sqrt{0} = 0$, the “$\pm$” collapses into a single value $x = -3$, corresponding to $(x + 3)^2 = 0$.

Example 4: x² + x + 1 = 0 (No Real Roots, D < 0)

Here $D = 1^2 - 4 \times 1 \times 1 = -3 < 0$, so no real roots exist. Over the complex numbers ($i^2 = -1$), the two complex conjugate roots are $x = \frac{-1 \pm \sqrt{3}i}{2}$.

Example 5: x² − 4x + 3 = 0 (Checking with Vieta’s Formulas)

With $D = (-4)^2 - 12 = 4 = 2^2$, the roots are $x = (4 \pm 2) \div 2 = 1, 3$. You can verify any pair of roots $\alpha, \beta$ immediately using Vieta’s relations: sum of roots $\alpha + \beta = -b/a = 4$ and product of roots $\alpha\beta = c/a = 3$.

Three common mistakes: (1) dropping the negative sign in −b (when b = −5, −b is +5); (2) dividing by 2 instead of 2a; and (3) mis-signing −4ac when c is negative. Always rearrange into standard form ax² + bx + c = 0 before reading off coefficients.

Verify with the Interactive Calculator

The Quadratic Equation Calculator takes $a, b$ and $c$ and displays the discriminant, the substituted quadratic formula, and the roots (including complex roots when $D < 0$). Use the 1-click preset chips in the companion box at the top of this article to launch directly into two real roots, a repeated root, or complex roots.

How to use it (3 steps)

1

Rearrange into standard form

Move all terms to one side so the equation reads ax² + bx + c = 0, then check the signs of a, b and c.

2

Enter a, b and c (or click a preset)

Type the three coefficients or click one of the example chips above to load values automatically.

3

Read the discriminant, roots and working

Inspect D, the substituted formula and the roots, or copy a shareable link to your calculation state.

The tool featured in this article

Quadratic Equation Calculator

Roots with the discriminant and substituted working, covering repeated and complex roots. Free and browser-based.

Try it now

For simplifying fractions in radical expressions, see How to Calculate Fractions, or use the Complex Number Calculator when working with complex roots.

Summary

  • Every quadratic equation $ax^2 + bx + c = 0\ (a \neq 0)$ is solved by $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$
  • The discriminant $D = b^2 - 4ac$ determines whether there are two real roots ($D > 0$), one repeated root ($D = 0$), or two complex conjugate roots ($D < 0$)
  • A perfect-square discriminant indicates rational factorability
  • Verify roots by substitution or via Vieta’s sum ($-b/a$) and product ($c/a$) relations

FAQ

Why compute the discriminant first?

It reveals the root count before you simplify the radical, saving time when $D < 0$ (no real solution) and showing whether integer factoring is possible ($D$ is a perfect square).

What are “complex roots” when D is negative?

When $D < 0$, the square root of a negative number is expressed using the imaginary unit $i$ ($i^2 = -1$). For $x^2 + x + 1 = 0$, $D = -3$ yields $x = (-1 \pm \sqrt{3}i)/2$.

How are a = 0 and extreme floating-point values handled?

The quadratic formula requires $a \neq 0$; if $a = 0$, solve $bx + c = 0$ as a linear equation. In floating-point arithmetic, when $b^2 \gg |4ac|$, subtracting nearly equal numbers in $-b \pm \sqrt{b^2 - 4ac}$ can lose precision (see NIST DLMF 1.11), so pair numerical outputs with exact algebraic forms when needed.

References and October 18, 2026 Update Note

Updated on October 18, 2026 to add the solving-method comparison table, the three-panel discriminant parabola diagram ($D > 0, D = 0, D < 0$), and NIST DLMF polynomial root references.

  • OpenStax, College Algebra 2e, Section 2.5 “Quadratic Equations”: openstax.org
  • NIST Digital Library of Mathematical Functions (DLMF), Section 1.11 “Zeros of Polynomials”: dlmf.nist.gov