How-to Guide 5 min read

How to Solve a Quadratic Equation Using the Discriminant

Solve ax² + bx + c = 0 with the quadratic formula: find the discriminant, tell two, one or complex roots apart, and check your answer, with worked examples.

how to solve quadratic equationquadratic formuladiscriminant b2-4acquadratic equation solvercomplex roots quadraticnature of roots

The short answer

Write the equation as ax² + bx + c = 0, calculate the discriminant D = b² − 4ac, then use x = (−b ± √D) / 2a. If D is positive you get two different real roots, if D is zero you get one repeated root, and if D is negative the roots are complex. The Quadratic Equation Solver does every step for you and shows the working, so you can check your own calculation line by line.

Step 1: put the equation in standard form

The formula only works when everything is on one side and the other side is zero, in the order x², x, number.

Example: 2x² = 3 − 5x

  • Move everything to the left: 2x² + 5x − 3 = 0
  • Read off the coefficients: a = 2, b = 5, c = −3
  • Two things trip people up here:

    • Signs travel with the number. In x² − 5x + 6 = 0, b is −5, not 5.
    • A missing term means a zero coefficient. In x² − 2 = 0, there is no x term, so b = 0.

    If a = 0, there is no x² term and the equation is linear, not quadratic. The solver's Solve Equation button stays disabled when a is 0.

    Step 2: calculate the discriminant

    The discriminant is the part under the square root in the quadratic formula:

    D = b² − 4ac

    For 2x² + 5x − 3 = 0: D = 5² − 4(2)(−3) = 25 + 24 = 49.

    Be careful with the minus signs. −4 × 2 × −3 is +24, so it is added.

    Step 3: use D to see what kind of roots you have

    DiscriminantRootsWhat the graph does
    D greater than 0Two different real rootsThe parabola crosses the x-axis twice
    D equal to 0One repeated real rootThe parabola just touches the x-axis
    D less than 0Two complex rootsThe parabola never reaches the x-axis

    If D is a perfect square (1, 4, 9, 16, 25, 49 ...), the roots are rational and the equation can also be factorised neatly.

    Step 4: apply the quadratic formula

    x = (−b ± √D) / 2a

    For 2x² + 5x − 3 = 0, with D = 49 and √D = 7:

  • x₁ = (−5 + 7) / 4 = 2 / 4 = 0.5
  • x₂ = (−5 − 7) / 4 = −12 / 4 = −3
  • Worked examples for each case

    All of these results come from the Quadratic Equation Solver.

    Two real roots: x² − 5x + 6 = 0

    • a = 1, b = −5, c = 6
    • D = 25 − 24 = 1
    • x = (5 ± 1) / 2, so x₁ = 3 and x₂ = 2

    This one factorises as (x − 3)(x − 2) = 0, which confirms the answer.

    Roots that are not whole numbers: 3x² − 7x + 2 = 0

    • D = 49 − 24 = 25
    • x = (7 ± 5) / 6, so x₁ = 2 and x₂ = 0.3333 (which is 1/3)

    The solver rounds to four decimal places, so 1/3 appears as 0.3333.

    Irrational roots: x² − 2 = 0

    • a = 1, b = 0, c = −2
    • D = 0 − 4(1)(−2) = 8
    • x = ±√8 / 2, so x = 1.4142 or −1.4142 (that is, ±√2)

    One repeated root: x² − 4x + 4 = 0

    • D = 16 − 16 = 0
    • x = 4 / 2 = 2

    The solver shows a single root because both values are the same. The equation is (x − 2)² = 0.

    Complex roots: x² + x + 1 = 0

    • D = 1 − 4 = −3
    • The real part is −b / 2a = −0.5
    • The imaginary part is √3 / 2 ≈ 0.866
    • So x = −0.5 ± 0.866i

    A second example: x² + 2x + 5 = 0 gives D = −16 and x = −1 ± 2i.

    If your course has not covered complex numbers yet, the expected answer is usually "no real roots".

    When factorising is quicker

    If D is a perfect square and a = 1, look for two numbers that multiply to c and add to b. For x² − 3x − 10 = 0 you need two numbers with product −10 and sum −3: −5 and 2. So (x − 5)(x + 2) = 0 and x = 5 or x = −2. The solver gives the same roots, with D = 49. When no such pair is easy to spot, go straight to the formula.

    Step 5: check your answer

    Two quick checks catch most mistakes:

  • Substitute back. Put each root into the original equation. For x = 3 in x² − 5x + 6: 9 − 15 + 6 = 0. ✓
  • Use the sum and product of roots. For any quadratic, x₁ + x₂ = −b/a and x₁ × x₂ = c/a. For 2x² + 5x − 3: the sum should be −2.5 and the product −1.5. Our roots 0.5 and −3 give 0.5 + (−3) = −2.5 and 0.5 × (−3) = −1.5. ✓
  • Using the solver

  • Open the Quadratic Equation Solver.
  • Enter a, b and c. Use negative numbers for minus signs, for example −5 for b in x² − 5x + 6. The equation preview above the boxes updates as you type.
  • Click Solve Equation.
  • Read the roots, the discriminant label (two real roots, one repeated root, or complex roots) and the step-by-step working.
  • Try the example buttons (two roots, repeated root, complex roots) to see each case.
  • Tip: keep a positive

    If a is negative and the roots are complex, the solver writes the imaginary part with a negative number, for example "0 + -1i". The roots are still correct, because the two roots are a ± pair, but it is easier to read if you first multiply the whole equation by −1. −x² − 1 = 0 and x² + 1 = 0 have the same roots, ±i.

    Common mistakes

    • Forgetting that −b flips the sign. If b = −5, then −b = +5.
    • Squaring a negative b wrongly. (−5)² = 25, not −25. Always put negative numbers in brackets when squaring.
    • Dividing only √D by 2a. The whole top line, −b ± √D, is divided by 2a.
    • Not rearranging first. x² = 5x − 6 must become x² − 5x + 6 = 0 before you read a, b and c.
    • Rounding too early. Keep √D unrounded until the final step, or your roots drift.

    Related tools

    Frequently asked questions

    What is the discriminant of a quadratic equation?

    It is D = b² − 4ac, the expression under the square root in the quadratic formula. Its sign tells you whether there are two real roots (D above 0), one repeated root (D equal to 0) or two complex roots (D below 0).

    What is the quadratic formula?

    For ax² + bx + c = 0, x = (−b ± √(b² − 4ac)) / 2a. The plus sign gives one root and the minus sign gives the other.

    What does it mean if the discriminant is negative?

    The equation has no real roots; its two roots are complex numbers. For example x² + x + 1 = 0 has D = −3 and roots −0.5 ± 0.866i.

    How many decimal places does the Lazyblink solver show?

    Up to four decimal places, with trailing zeros removed. So 1/3 appears as 0.3333 and √2 as 1.4142.

    Try this tool on Lazyblink

    Put this guide into practice with our free online tool — no signup required.

    Open tool