Quadratic Equation Solver

real & complex roots, step by step

Loading interactive simulation...

One sign under the root decides everything 🖖

The quadratic formula is more than an algebraic trick — it is a mapping of symmetry. In the standard form, x = -b/(2a) represents the axis of symmetry, the central spine of the parabola. The term under the square root, b² - 4ac, is the discriminant Δ. Its sign says which side of the x-axis the vertex falls on, and dividing it by 4a gives how far. When Δ > 0, the parabola crosses the axis at two distinct points, symmetric about the vertex. When Δ = 0, the vertex sits exactly on the axis, yielding a repeated root. And when Δ < 0, the parabola floats above or below the axis, its roots departing into the complex plane as a conjugate pair. In modern mathematics, this simple formula is the foundation of field theory: solving quadratic equations requires extending the rational numbers to include radicals, showing how geometry and algebra are fundamentally unified.

A shortcut to check your roots 🖖

Before the formula existed, mathematicians noticed a neat pattern hidden in the coefficients. For any ax² + bx + c = 0, the two roots always add up to -b/a and multiply to c/a — a result named Vieta's formulas. So for x² - 5x + 6, the roots must sum to 5 and multiply to 6, giving 2 and 3. It is the fastest way to sanity-check the solver's answer without substituting anything back.

When the famous formula quietly fails 🖖

The textbook formula can betray you on a computer. When b² is far larger than 4ac, the square root is nearly equal to |b|, so one of the two roots subtracts two almost-identical numbers — -b + √Δ when b is positive, and -b − √Δ when b is negative — wiping out most of the significant digits in an effect called catastrophic cancellation. Numerical libraries dodge this by computing one root first, then finding the other as c/(a·x₁). Centuries-old algebra and modern floating-point arithmetic quietly disagree.

QUADRATIC THEORY — READING ax² + bx + c BEFORE YOU SOLVE IT

The Discriminant: How Many Roots, and Which Way Up?

Two numbers settle the shape of the answer before you touch the quadratic formula. The discriminant Δ = b² − 4ac tells you how many real roots exist, and the sign of a tells you which way the parabola opens and whether its vertex is a lowest or a highest point.

Δ > 0 — two distinct real roots Δ = b2 − 4ac > 0
Δ = 0 — one repeated real root Δ = 0
Δ < 0 — two complex conjugate roots Δ < 0
a < 0 — the parabola opens downward a < 0

01

Δ > 0 — two distinct real roots

What you know: The discriminant b² − 4ac comes out positive. The parabola crosses the x-axis at two separate points.

Roots: Δ = b2 − 4ac > 0

Worked example: x² − 5x + 6 = 0 → Δ = 25 − 24 = 1 → x = 2 and x = 3

Open this case: two roots
Δ > 0 — two distinct real roots. Δ > 0: the curve cuts the axis twice, symmetrically about the vertex. The discriminant b² − 4ac comes out positive. The parabola crosses the x-axis at two separate points.
Δ > 0: the curve cuts the axis twice, symmetrically about the vertex.

02

Δ = 0 — one repeated real root

What you know: The discriminant is exactly zero. The parabola touches the x-axis at a single point instead of crossing it.

Roots: Δ = 0

Worked example: x² − 4x + 4 = 0 → Δ = 16 − 16 = 0 → x = 2, counted twice

Open this case: repeated root
Δ = 0 — one repeated real root. Δ = 0: the vertex sits exactly on the axis — a tangent, not a crossing. The discriminant is exactly zero. The parabola touches the x-axis at a single point instead of crossing it.
Δ = 0: the vertex sits exactly on the axis — a tangent, not a crossing.

03

Δ < 0 — two complex conjugate roots

What you know: The discriminant is negative. The parabola never reaches the x-axis, so there is no real solution.

Roots: Δ < 0

Worked example: x² + 2x + 5 = 0 → Δ = 4 − 20 = −16 → x = −1 ± 2i

Open this case: complex roots
Δ < 0 — two complex conjugate roots. Δ < 0: the whole curve stays on one side of the axis. The discriminant is negative. The parabola never reaches the x-axis, so there is no real solution.
Δ < 0: the whole curve stays on one side of the axis.

04

a < 0 — the parabola opens downward

What you know: The leading coefficient a is negative. This is independent of the discriminant: it flips the curve and turns the vertex into a maximum.

Roots: a < 0

Worked example: −x² + 4 = 0 → Δ = 0 + 16 = 16 > 0 → x = ±2, with a maximum at (0, 4)

Open this case: opens down
a < 0 — the parabola opens downward. a < 0: the arms point down and the vertex is the maximum. The leading coefficient a is negative. This is independent of the discriminant: it flips the curve and turns the vertex into a maximum.
a < 0: the arms point down and the vertex is the maximum.
References (1)

Problem solved in full

  1. Solving x² − 5x + 6 = 0 by completing the square 5 steps

    Solve x² − 5x + 6 = 0 by completing the square. Then answer something the quadratic formula will not tell you: the discriminant counts the roots, but what does its size measure?

    1. Completing the square is not a trick for solving quadratics — it is the proof that the quadratic formula is true, run on one specific equation. Halve the coefficient of x, square it, add and subtract. The 6.25 that appears is the price of forcing the first two terms into a perfect square, and it has to be paid back in the same line.

    2. Vertex form puts the variable in exactly one place, so it can be undone directly: isolate the square, take both roots, add 2.5 back. No formula was needed and none was memorised.

    3. Now the discriminant. Here Δ = 1, and it is positive, so there are two real roots. That is the part every textbook mentions.

    4. It appears twice more, and neither is usually said out loud. The gap between the roots is √Δ/|a|, because the ± in the formula contributes ±√Δ/2a to each one. And the vertex sits Δ/4a below the axis — the −0.25 on the panel above is not an independent result, it is the discriminant again, divided by four.

    5. Vieta's relations close the loop. Expand a(xx₁)(xx₂), match it term by term against ax² + bx + c, and the sum and product of the roots fall out without solving anything.

    Answer

    The roots are x = 2 and x = 3, and the tool prints the vertex at (2.5, −0.25) from the same completion. The payoff is that one number governs three separate facts. Δ = 1 makes the roots real, sets them exactly 1 apart, and drops the vertex exactly 0.25 below the axis. Raise c towards 6.25 and watch all three go together: the roots slide in, the gap closes as √Δ, and the parabola rises until it touches the axis at Δ = 0. They were never three coincidences — they are one quantity seen from three directions.

Learning path

Beyond the quadratic

Leads to complex-numbers

Example problems