Quadratic Formula Calculator
Result
Root 1 (larger)
- Root 2 (smaller)
- 1
- Discriminant (Δ)
- 1.000000
- Sum of roots
- 3.000000
- Product of roots
- 2.000000
A quadratic formula calculator solves an equation of the form ax² + bx + c = 0 by substituting the three coefficients into the formula. It reports both roots, the discriminant that decides how many of them are real, and the sum and product of the roots. The discriminant is the part worth reading first: when it is positive the two roots are real and distinct, when it is exactly zero the two roots coincide, and when it is negative the solutions are a conjugate pair of complex numbers — the page prints those too, as 1 + 2i and 1 - 2i, rather than stopping at 'no real roots'. Roots come back in descending order, so the larger of the two is always in the first row; that is a convention this page fixes rather than something the formula decides, and it is what stops the two rows from trading places when you flip the sign of b. Exact answers are printed as exact answers: x² + 3x - 2 = 0 has the root 1/2 rather than 0.5, because 0.5 invites the reader to wonder whether it is rounded. Irrational roots have no such form and are printed to six decimals, so the golden ratio arrives as 1.618034. The sum and product of the roots are printed for a reason that outlasts the case where they are obvious: they hold even when the roots are complex, which is the clearest evidence that complex roots are solutions rather than a failure to find any. A quadratic equation with a equal to zero is refused rather than quietly solved as a linear equation, since bx + c = 0 has one root and the sum and product of roots stop meaning anything.
The three cases the discriminant separates
| Case | Discriminant |
|---|---|
| Two distinct real roots | Δ > 0 |
| One repeated real root | Δ = 0 |
| A conjugate pair of complex roots | Δ < 0 |
Three rows, one per shape the answer can take, and the second column is the condition rather than a range of numbers — the discriminant is not a score to be compared against a threshold, it is a sign, and the sign is the whole of the test. The first column names each case in the words the badge above the result uses, so the table and the badge cannot drift apart. This is the one table in the batch whose cells are grade references rather than computed numbers, which is why every cell has to exist in the grades block above it.
Formula
x = (−b ± √(b² − 4ac)) ÷ 2a Δ = b² − 4ac x₁ + x₂ = −b ÷ a x₁ · x₂ = c ÷ a
- a
- The coefficient of x². It cannot be zero: with a equal to zero the equation is a straight line in disguise, it has a single root rather than two, and the formulas for the sum and product both divide by a. The page refuses that input and says which of them is missing rather than answering a different question
- b
- The coefficient of x. Its sign is what the plus-or-minus in the formula reads, and it is also where the cancellation risk lives: when b is large and the two roots are far apart, subtracting one square root from another throws away digits. The page avoids that subtraction rather than hoping it does not matter
- c
- The constant term. It is the product of the two roots multiplied by a, which is the fastest sanity check available without the calculator: if the roots you were expecting do not multiply to c ÷ a, something is wrong further up. When c is zero one root is zero and the other is −b ÷ a, which falls out of the formula without a special case
- Δ = b² − 4ac
- The discriminant, the single number that decides the shape of the answer. Positive means two distinct real roots, zero means one repeated real root, negative means the roots are complex and come as a conjugate pair. The page uses it twice — once to pick which roots to compute, once to choose the badge above the result — and those two readings come from the same value, so they cannot disagree
- x = (−b ± √Δ) ÷ 2a
- The quadratic formula itself. The plus-or-minus produces the two roots from one expression, and the square root is the only step that can fail in the real numbers: a negative Δ has no real square root, which is exactly the case the page still answers, in complex numbers. The division by 2a is why a cannot be zero
- x₁ + x₂ = −b ÷ a
- The sum of the roots, known as one of Vieta's formulas. It is worth printing because it survives the complex case untouched: the roots of x² − 2x + 5 are 1 + 2i and 1 - 2i, and they still add to 2. Anyone who suspects the page is inventing answers when the discriminant is negative can check that column and find it consistent with the equation they typed
- x₁ · x₂ = c ÷ a
- The product of the roots, the second of Vieta's formulas, and the check that catches a sign error in the constant term. For a monic equation it is just c: x² − 3x + 2 factors as (x − 1)(x − 2), so the roots multiply to 2 and the sum is 3. Like the sum it is unchanged when the roots are complex
- b² − 4ac = 0
- The boundary case, where the two roots collapse into one and the page prints the same value in both rows. It is not a rare edge: it is the condition for a perfect square trinomial, so it turns up in every factoring exercise. The badge above the result changes to say so, which is the only place on the page where the count of roots is stated in words
Use it for any equation with an x² term that you want the roots of, which in practice means three situations: an exercise where factoring is not obvious, a physical model whose coefficients come from measurements so no factoring is available, and a case where the answer is known to be complex and the real-root-only treatment would leave you with nothing. It is also the tool for checking a factoring you have already done: the sum and product of the roots are printed, so (x − 1)(x − 2) can be confirmed without expanding it back out. Reach for the slope calculator when a turns out to be zero — that is a line, and the page that handles ax + by = c is the one that answers it. Reach for the root calculator when the operation you actually need is a square root, since the discriminant under the radical is a square root like any other and the rules for higher roots are there. Reach for the exponent calculator when x² is being computed rather than solved for, which is the difference between evaluating a quadratic and finding where it is zero.
Worked examples
x² − 3x + 2 = 0
- The discriminant: Δ = (−3)² − 4 × 1 × 2 = 9 − 8 = 1
- Δ is positive, so the two roots are real and distinct
- √Δ = 1, so the roots are (3 + 1) ÷ 2 = 2 and (3 − 1) ÷ 2 = 1
- Descending order puts 2 in the first row, and the checks agree: 2 + 1 = 3 and 2 × 1 = 2
The equation most readers arrive with, and the one that factors cleanly as (x − 1)(x − 2) — so every number on the panel can be confirmed by expanding the factors back out. It is also the case where the answer looks too easy to be worth a calculator, which is the point: the panel is showing its work on a problem you already know the answer to, and the same five rows come back for one you do not.
x² − x − 1 = 0
- The discriminant: Δ = (−1)² − 4 × 1 × (−1) = 1 + 4 = 5
- Δ is positive but not a perfect square, so the roots are irrational
- √5 = 2.2360679…, so the roots are (1 + 2.2360679…) ÷ 2 and (1 − 2.2360679…) ÷ 2
- Printed to six decimals: 1.618034 and −0.618034
The golden ratio, and the case that shows why the page prints fractions only when they are exact. There is no fraction equal to (1 + √5) ÷ 2, so the answer is a decimal — and a reader who sees 1.618034 knows it is rounded, whereas the same number written as a fraction would look exact. The two roots also multiply to exactly −1, which is the kind of coincidence that confirms the arithmetic rather than the input.
2x² + 3x − 2 = 0
- The discriminant: Δ = 3² − 4 × 2 × (−2) = 9 + 16 = 25
- √Δ = 5, so the roots are (−3 + 5) ÷ 4 = 1/2 and (−3 − 5) ÷ 4 = −2
- The first root is exact as a fraction, so it is printed as 1/2 rather than 0.5
- The checks: 1/2 + (−2) = −1.5 and 1/2 × (−2) = −1
The case that decides how the page prints roots. Both roots are exactly representable, and the smaller one is an integer while the larger is a fraction — so a reader who assumed 'roots are printed as decimals' would be wrong on the first row and right on the second. The sum and product are what make the fraction readable: −1.5 is not obviously the sum of 1/2 and −2 until you do it, and doing it takes one line.
x² − 2x + 5 = 0
- The discriminant: Δ = (−2)² − 4 × 1 × 5 = 4 − 20 = −16
- Δ is negative, so the roots are complex and come as a conjugate pair
- The real part is −b ÷ 2a = 1 and the imaginary part is √16 ÷ 2 = 2
- Both roots are printed, and Vieta's formulas still hold: they add to 2 and multiply to 5
Where this page parts company with the ones that print 'no real roots' and stop. The two roots are perfectly definite numbers, and the two check columns prove it: 2 and 5 are the sum and product the equation demands, and the same values would come back if the roots were real. A reader who has been told there is no answer should read the last two rows of this example before believing it.
x² − 4x + 4 = 0
- The discriminant: Δ = (−4)² − 4 × 1 × 4 = 16 − 16 = 0
- Δ is exactly zero, so the two roots coincide
- The repeated root is −b ÷ 2a = 4 ÷ 2 = 2
- The page prints 2 in both rows, and the sum is 4 because the root is counted twice
The boundary the badge exists for. The equation is (x − 2)², so both rows say 2 and nothing about the pair looks like a mistake — but a reader counting rows would conclude there are two roots when there is one. The badge above the result says one repeated real root, and the sum being 4 rather than 2 is the arithmetic agreeing with the verdict.
Limitations
This page solves quadratics and stops there. Cubics, quartics and equations with an x⁴ term have their own methods and their own pages elsewhere; nothing here extends to them. A leading coefficient of zero is refused rather than silently treated as a linear equation, so bx + c = 0 has to go to the slope calculator, which handles that shape. When the discriminant is negative the roots are printed as complex numbers in the a ± bi form, which is enough to read and check but is not a full complex-arithmetic tool — multiplying two of them by hand is on you. Roots are printed to six decimals when they are irrational, which is a display limit rather than a precision limit: the computation behind them is full double precision and the rounding happens only on the way out. The order of the two roots is fixed by convention rather than by the formula, so a page or a textbook that lists them the other way round is not contradicting this one, only ordering them differently. The coefficients are capped at a million in absolute value, which is a display range rather than a mathematical one. Finally, the sum and product of the roots are printed with the same six decimals as everything else, so an exact sum of one third would come back as 0.333333 rather than as a fraction — the root columns get the fraction treatment and these two do not.
Frequently asked questions
- What do I do when the discriminant is negative?
- Read the two roots the page prints anyway. A negative discriminant means the solutions are a conjugate pair of complex numbers rather than two real ones, and they are perfectly definite: x² − 2x + 5 has the roots 1 + 2i and 1 - 2i. Many textbooks stop at 'no real roots', which is true but incomplete — the equation still has two solutions, and the sum and product columns on this page confirm them.
- Which root is the first one?
- The larger of the two. The plus-or-minus in the formula does not order the roots, so the page has to choose, and it chooses descending order — which means root 1 is never smaller than root 2. This matters more than it sounds: without a fixed order, changing the sign of b would swap the two rows and a reader comparing two calculations would think the answers had changed.
- Why is a root sometimes printed as a fraction and sometimes as a decimal?
- Fractions are printed when they are exact and the denominator is small, decimals otherwise. 2x² + 3x − 2 has the roots 1/2 and −2, and 1/2 is both exact and short, so it is written as a fraction — printing 0.5 there would suggest a rounded value. The golden ratio is (1 + √5) ÷ 2, which is not a fraction at all, so it is written as 1.618034 and the decimal point tells you it is approximate.
- What happens if a is zero?
- The page refuses the input rather than solving it. With a equal to zero the equation is bx + c = 0, which is a straight line with a single root of −c ÷ b, and the formulas for the sum and product of the roots both divide by a and stop meaning anything. The slope calculator handles equations in that shape, so the refusal names it as the place to go.
- What is the discriminant used for?
- It is the single number that tells you which of the three cases you are in before you compute anything else: Δ = b² − 4ac. Positive means two distinct real roots, zero means one repeated real root, negative means a conjugate pair of complex roots. It sits under the square root in the formula, so its sign is exactly the question 'is there a real square root to take'.
- Can I use this to check a factorization?
- Yes, and the sum and product columns are there for it. If you think x² − 3x + 2 factors as (x − 1)(x − 2), the roots should be 1 and 2, their sum should be 3 and their product 2 — which is what the panel prints. A sign error in the constant term shows up immediately as a product of the wrong sign, which is faster than expanding the brackets back out.
References
- Quadratic Equation — the formula, the discriminant and the three cases it distinguishes, including the complex roots this page prints — Wolfram MathWorld (United States)
- Discriminant — how a single combination of the coefficients determines the number and nature of the roots — Wolfram MathWorld (United States)
- Vieta's Formulas — the relations between the coefficients of a polynomial and the sums and products of its roots, which this page prints as a check — Wolfram MathWorld (United States)