Quadratic Equation Calculator

Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 9/5/2026

A quadratic equation ax² + bx + c = 0 is solved by calculating the discriminant Δ = b² − 4ac, then the roots x = (−b ± √Δ) ÷ (2a). For x² − 3x + 2 = 0, the discriminant is 1 and the two roots are 1 and 2.

Explanation

A quadratic equation is written in the form ax² + bx + c = 0, with a not equal to 0. Solving it involves calculating the discriminant Δ = b² − 4ac, which determines the number of real solutions: if Δ > 0, the equation has two distinct real roots; if Δ = 0, a single real root called a "double" root; if Δ < 0, no real root (solutions then exist among complex numbers, outside the scope of this calculator, which only displays the discriminant in that case). Real roots are calculated with the formula x = (−b ± √Δ) ÷ (2a), the ± sign giving the two solutions x₁ and x₂ when they exist. This calculator always shows the discriminant, then the real roots if they exist. For the hypotenuse of a right triangle, another classic application of squares and square roots, see our Pythagorean theorem calculator.

Example: x² − 3x + 2 = 0

Inputs

a = 1. b = −3. c = 2.

Calculation

Δ = (−3)² − 4 × 1 × 2 = 9 − 8 = 1. x₁ = (3 + √1) ÷ 2 = 4 ÷ 2 = 2. x₂ = (3 − √1) ÷ 2 = 2 ÷ 2 = 1.

Result

The two roots of this equation are x = 1 and x = 2.

Frequently asked questions

What does a negative discriminant mean?

A negative discriminant means the equation has no solution among the real numbers: the parabola representing the function ax² + bx + c never crosses the x-axis. Solutions exist among complex numbers (with an imaginary number i such that i² = −1), but this calculator is limited to real roots.

What happens if a = 0?

If a = 0, the equation is no longer quadratic but linear (bx + c = 0, with a single solution x = −c ÷ b if b ≠ 0). This calculator assumes a ≠ 0; with a = 0, the displayed result has no valid mathematical meaning.

How do I check that the roots found are correct?

Substitute x with the value found back into the original equation ax² + bx + c: the result should equal 0. For x² − 3x + 2 = 0 with x = 2: 2² − 3 × 2 + 2 = 4 − 6 + 2 = 0, which confirms that x = 2 is indeed a root.

Related resources

Similar calculators