CZ
CalcyZone
Mathematics CalcyZone Calculator

Quadratic Equation Solver

Solve ax² + bx + c = 0 for real or complex roots, with the discriminant, vertex and full step-by-step working.

Roots
x₁ = 2, x₂ = 1
Discriminant (b² − 4ac)
1
Vertex (h, k)
(1.5, -0.25)

Step-by-step working

  1. D = b² − 4ac = (-3)² − 4·(1)·(2) = 1
  2. √D = 1
  3. x = (−b ± √D) / 2a = (3 ± 1) / 2

Mathematical Formula

x = (−b ± √(b² − 4ac)) / 2a. D = b² − 4ac: D > 0 two real roots, D = 0 one double root, D < 0 complex conjugate roots. Vertex h = −b/2a, k = f(h).

Overview & Explanation

The quadratic formula gives the roots of any second-degree polynomial. The solver uses a numerically stable form to avoid cancellation errors when b² ≫ 4ac.

How It Works

  • Compute the discriminant D.
  • Classify the roots by the sign of D.
  • Apply the formula (stable variant q = −½(b + sign(b)√D), x₁ = q/a, x₂ = c/q).
  • Report the vertex of the parabola.

Practical Applications

  • Algebra homework and exam checks.
  • Projectile and optimisation problems.

How the quadratic formula works

A quadratic equation has the form ax² + bx + c = 0 with a ≠ 0. Its solutions are x = (−b ± √(b² − 4ac)) ÷ 2a. The expression under the square root, D = b² − 4ac, is the discriminant, and it decides what kind of roots you get: D > 0 gives two different real roots, D = 0 gives one repeated real root, and D < 0 gives two complex conjugate roots.

The formula comes from completing the square, so it always works, even when the equation does not factor neatly.

Worked examples

For 2x² − 7x + 3 = 0: D = 49 − 24 = 25, √D = 5, so x = (7 ± 5) ÷ 4, giving x = 3 and x = 0.5. Check: 2(9) − 21 + 3 = 0. For x² + 2x + 5 = 0: D = 4 − 20 = −16, so x = (−2 ± 4i) ÷ 2 = −1 ± 2i.

Useful checks

The roots always satisfy x₁ + x₂ = −b/a and x₁ × x₂ = c/a, which is a fast way to check an answer. The vertex of the parabola y = ax² + bx + c lies at x = −b/2a, exactly halfway between the two roots.

Example 1: x² − 3x + 2 = 0

Two real roots.

1

Inputs

Coefficient a: 1 · Coefficient b: -3 · Coefficient c: 2

= entered
2

Step 1

D = b² − 4ac = (-3)² − 4·(1)·(2) = 1

3

Step 2

√D = 1

4

Step 3

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

5

Roots

Result

= x₁ = 2, x₂ = 1

Example 2: x² + 2x + 5 = 0

Complex roots.

1

Inputs

Coefficient a: 1 · Coefficient b: 2 · Coefficient c: 5

= entered
2

Step 1

D = b² − 4ac = (2)² − 4·(1)·(5) = -16

3

Step 2

D < 0 → complex roots, √|D| = 4

4

Step 3

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

5

Roots

Result

= x = -1 ± 2i

How it's calculated & sources

x = (−b ± √(b² − 4ac)) / 2a. D = b² − 4ac: D > 0 two real roots, D = 0 one double root, D < 0 complex conjugate roots. Vertex h = −b/2a, k = f(h).

Frequently Asked Questions

What does the discriminant tell me?
Its sign gives the number and type of roots: positive → two real, zero → one repeated real, negative → two complex conjugates.
What if a = 0?
The equation is linear (bx + c = 0) and has the single root −c/b.
Why use the “stable” formula?
When b² is much larger than 4ac, subtracting two nearly equal numbers loses precision. Computing one root via q and the other via c/q avoids that.