Quadratic Equation Calculator

Solve quadratic equations of the form: ax² + bx + c = 0

Graph

Worked example: two real roots

With a=1, b=-3, c=2 (the default values loaded in the tool), the discriminant is b² - 4ac = (-3)² - 4(1)(2) = 9 - 8 = 1. Since it's positive, there are two real roots: x = (-b ± √Δ) / (2a) = (3 ± 1) / 2, giving x₁ = 2 and x₂ = 1. Check by substitution: 1(2)² - 3(2) + 2 = 4 - 6 + 2 = 0, and 1(1)² - 3(1) + 2 = 1 - 3 + 2 = 0 — both roots satisfy the original equation. The vertex sits at x = -b/2a = 1.5, y = 1(1.5)² - 3(1.5) + 2 = 2.25 - 4.5 + 2 = -0.25, the minimum point of this upward-opening parabola.

Worked example: complex roots

With a=1, b=2, c=5, the discriminant is 2² - 4(1)(5) = 4 - 20 = -16, which is negative — no real solutions exist, meaning the parabola never crosses the x-axis. The calculator still returns an answer using imaginary numbers: real part = -b/2a = -1, imaginary part = √16/2 = 4/2 = 2, giving roots x = -1 + 2i and x = -1 - 2i.

What the discriminant tells you before solving

The sign of b² - 4ac alone determines the root type: positive means two distinct real roots (the graph crosses the x-axis twice), zero means exactly one repeated real root (the vertex touches the x-axis), and negative means two complex conjugate roots (the graph never touches the x-axis). The tool computes and displays this value first, before the roots themselves, so you can predict the outcome.

The a=0 edge case

If a is 0, the x² term vanishes and the equation collapses to linear (bx + c = 0), solved as x = -c/b instead of using the quadratic formula. If both a and b are 0, there's no x term left at all — the tool reports either "infinitely many solutions" (if c is also 0) or "no solution" (if c is nonzero, making the equation a false statement like 5 = 0).