Country & language

Sets the currency, units and country-specific rules (tax, VAT, salary) in calculators. General tools stay the same.

Pages that are not translated yet open in English.

↑ ↓ to move · Enter to open · Esc to close

Quadratic Equation Solver

Enter a, b and c from ax² + bx + c = 0. You get the roots as exact fractions or surds and as decimals, the discriminant that decides what kind of roots they are, the factored form when there is one, the vertex of the parabola – and every step of the quadratic formula.

Quick answer: The quadratic formula is x = (−b ± √(b² − 4ac)) ÷ 2a. For x² − 3x + 2 = 0 the discriminant is (−3)² − 4 × 1 × 2 = 1, so x = (3 ± 1) ÷ 2: the roots are 2 and 1, the factored form is (x − 1)(x − 2) and the vertex is (1.5, −0.25).

Updated · Free · No sign-up

Quadratic Equation Solver inputs

Result

x² − 3x + 2 = 0

x₁ = 2, x₂ = 1

Two distinct real roots (discriminant > 0)

Discriminant (b² − 4ac)
1
Vertex
(1.5, −0.25)
Axis of symmetry
x = 1.5
Exact rootsx₁ = 2, x₂ = 1
Factored form(x − 1)(x − 2) = 0
Parabola opensUpward (minimum at vertex)
y-intercept(0, 2)
Sum of roots (−b/a)3
Product of roots (c/a)2

Step by step

  1. Identify the coefficients: a = 1, b = −3, c = 2
  2. Discriminant: D = b² − 4ac = (−3)² − 4 × 1 × 2 = 1
  3. Quadratic formula: x = (−b ± √D) ÷ 2a = (3 ± √1) ÷ 2
  4. Roots: x₁ = 2, x₂ = 1
  5. Vertex: x = −b ÷ 2a = 1.5, y = c − b² ÷ 4a = −0.25

Where the formula comes from

In ninth-century Baghdad, al-Khwarizmi – whose book gave us the word algebra – solved “a square and ten roots equal thirty-nine”, x² + 10x = 39, by drawing it: a square of side x, strips for the 10x, and the missing corner filled in to complete a bigger square. Halve the 10 to get 5, add 5² = 25 to 39 to get 64, take the square root, 8, and subtract the 5: x = 3. The quadratic formula is the same move done once for every equation. Divide ax² + bx + c = 0 by a, complete the square and solve:

(x + b ÷ 2a)² = (b² − 4ac) ÷ 4a²  →  x = (−b ± √(b² − 4ac)) ÷ 2a

Entered here as a = 1, b = 10, c = −39, the calculator returns 3 – and a second root, −13, which al-Khwarizmi, working without negative numbers, did not count. Solving by factorising, completing the square and the formula is standard school content on both sides of the Atlantic: AQA’s GCSE specification lists all three methods (A18), and the US Common Core asks students to recognise complex solutions and write them as a ± bi (HSA-REI.B.4).

The discriminant decides the kind of answer

The part under the square root, D = b² − 4ac, tells you what you will get before you finish:

EquationDRoots (exact)DecimalGraph
x² − 3x + 2 = 012 and 12, 1crosses the x-axis twice
4x² − 12x + 9 = 003/2 (repeated)1.5touches it at the vertex
x² − x − 1 = 05(1 ± √5)/21.618, −0.618crosses twice
x² + x + 1 = 0−3(−1 ± i√3)/2−0.5 ± 0.866inever meets it

A perfect-square D (1, 4, 9, 16…) also tells you the equation factors neatly, so the calculator writes the factored form: 4x² − 12x + 9 = (2x − 3)². The positive root of x² − x − 1 = 0, 1.618…, is the golden ratio.

Worked examples

A garden of 40 m²

A rectangular bed is 3 m longer than it is wide and covers 40 m². With width x, x(x + 3) = 40, so x² + 3x − 40 = 0. D = 9 + 160 = 169 = 13², and x = (−3 ± 13) ÷ 2 gives 5 or −8, factored as (x + 8)(x − 5). A width can’t be negative, so the bed is 5 m × 8 m. Check: 5 + (−8) = −3 = −b/a, and 5 × (−8) = −40 = c/a.

How long a thrown ball stays in the air

A ball thrown straight up at 20 m/s from a hand 1.5 m above the ground has height h = −4.9t² + 20t + 1.5 metres after t seconds (the −4.9 is half of gravity’s 9.8 m/s², and air resistance is ignored). Set h = 0: a = −4.9, b = 20, c = 1.5, D = 429.4, and the roots are t = 4.16 s and t = −0.07 s. The negative root is a moment before the throw, so the ball lands after 4.16 seconds. Because a is negative the parabola opens downward, and the vertex (2.04, 21.91) is the top of the flight: 21.91 m after 2.04 s. Decimal coefficients like these get decimal roots only; exact surds are worked out for whole-number coefficients.

Complex roots, written exactly

x² + x + 1 = 0 has D = 1 − 4 = −3. The square root of −3 is i√3, so x = (−1 ± i√3)/2 – in decimals −0.5 + 0.8660254i and −0.5 − 0.8660254i. Many solvers stop at the decimals; an exam answer usually wants the exact form, and the page gives both.

Exact or decimal?

For whole-number coefficients the calculator simplifies the surd and cancels the common factor: 3x² + 6x − 2 = 0 gives (−6 ± √60) ÷ 6, and since √60 = 2√15 that reduces to (−3 ± √15)/3 – 0.291 and −2.291. When the coefficients are decimals, multiply through to clear them first if you want an exact answer: 0.5x² − 1.5x + 1 = 0 is the same equation as x² − 3x + 2 = 0.

Things that change the answer

  • The signs of b and c. In x² − 3x + 2, b is −3, not 3. Entering 3 flips both roots to −1 and −2.
  • Everything on one side. x² + 3x = 40 is c = −40, not 40; with +40 the discriminant is −151 and the roots become complex.
  • Which root makes sense. Lengths, times and prices rule out negative or complex answers; the formula still returns them.
  • Rounding. Round only at the end. For very lopsided equations the solver uses a numerically stable form of the formula, so the small root of x² − 100,000,000x + 1 = 0 comes out as 0.00000001 – the textbook formula run in ordinary floating point gives 0.0000000075, 25% too small.

Common mistakes

  • Dividing only √(b² − 4ac) by 2a instead of the whole numerator −b ± √(b² − 4ac).
  • Squaring a negative b without brackets: (−3)² = 9, but typing −3² into many calculators gives −9.
  • Writing 4ac as 4 + a + c, or dropping the minus sign in −b.
  • Reporting one root when D > 0 – there are two unless D = 0.

When to get help

If the equation has x³ or higher powers, it is not a quadratic and this formula does not apply. If a word problem gives a negative time or length, re-read how the equation was set up – the sign of a or c is the usual culprit. For physics or engineering models, the quadratic is only as good as the assumptions behind it (constant gravity, no drag), so check those with your teacher or the standard you are working to.

Frequently asked questions

What is the quadratic formula?

For ax² + bx + c = 0 with a ≠ 0, x = (−b ± √(b² − 4ac)) ÷ 2a. For 2x² + x − 3 = 0: b² − 4ac = 1 + 24 = 25, so x = (−1 ± 5) ÷ 4, giving x = 1 and x = −3/2.

What does the discriminant tell you?

D = b² − 4ac decides the roots before you finish. D > 0: two real roots (x² − 3x + 2 has D = 1). D = 0: one repeated root (4x² − 12x + 9 has D = 0 and x = 3/2). D < 0: two complex roots (x² + 2x + 5 has D = −16 and x = −1 ± 2i).

What happens when the discriminant is negative?

There are no real solutions – the parabola never crosses the x-axis – but there are two complex conjugate roots. x² + x + 1 = 0 has D = −3, so x = (−1 ± i√3)/2 = −0.5 ± 0.866i; its vertex (−0.5, 0.75) sits above the axis.

How do you find the vertex of a parabola?

The vertex is at x = −b ÷ 2a, and y = c − b² ÷ 4a. For y = x² − 3x + 2 it is (1.5, −0.25). A ball thrown up at 20 m/s from 1.5 m, h = −4.9t² + 20t + 1.5, peaks at the vertex: 21.91 m after 2.04 s.

When should I factor instead of using the formula?

With whole-number coefficients the equation factors over whole numbers exactly when the discriminant is a perfect square (0, 1, 4, 9, 16, 25…). 2x² + x − 3 has D = 25 and factors as (2x + 3)(x − 1); x² − 3x + 1 has D = 5, so it does not, and the roots are (3 ± √5)/2.

How do you check the roots are right?

The roots always add up to −b/a and multiply to c/a. For x² + 3x − 40 = 0 the roots 5 and −8 give 5 + (−8) = −3 = −b/a and 5 × (−8) = −40 = c/a. Substituting one back also works: 5² + 3 × 5 − 40 = 0.

How do I enter an equation like x² + 3x = 40?

Move everything to one side first: x² + 3x − 40 = 0, so a = 1, b = 3 and c = −40, giving x = 5 or x = −8. If x is the width of a garden whose length is 3 m more and whose area is 40 m², only the 5 m answer makes sense.

What if a = 0?

Then there is no x² term and the equation is linear: bx + c = 0 gives x = −c ÷ b, a single answer. The quadratic formula would divide by 2a = 0, so the calculator asks for a non-zero a.

What changed

  • – Page fully reviewed: roots are now also given in exact form – fractions such as 3/2 and simplified surds such as (3 ± √5)/2 or (−1 ± i√3)/2 – with the factored form whenever the discriminant is a perfect square; key rules, six scenarios, a discriminant table with examples, the completing-the-square derivation and the common mistakes added.

Sources

Last reviewed: · Reviewed by Chelsea, CalcBright's animated guide, for the CalcBright editorial team · How we check our numbers