Discriminant Calculator
Find b² − 4ac for any quadratic ax² + bx + c and see whether it has two real roots, one repeated root or a pair of complex roots, before solving it.
Discriminant Calculator
Background.
Before you solve a quadratic, it helps to know what kind of answer is waiting. Will the parabola cross the x-axis twice, graze it once, or miss it altogether? The discriminant, b² − 4ac, settles that from the three coefficients alone, with no square roots and no factoring.
It is the part of the quadratic formula that sits under the radical: x = (−b ± √(b² − 4ac)) ÷ 2a. A positive value has a real square root, so the ± produces two different real roots. Zero makes the square root vanish and both branches land on the same number, −b ÷ 2a. A negative value has no real square root, and the two roots become complex numbers, conjugates of each other. For x² − 7x + 10 = 0 the discriminant is 49 − 40 = 9, positive, so two real roots; they turn out to be 2 and 5.
The number carries more than its sign. Its square root, divided by |a|, is the distance between the two real roots. With whole-number coefficients, a perfect-square discriminant such as 9 means the roots are rational and the quadratic factors neatly over the integers, while a positive non-square such as 8 means the roots involve a surd. Divided by −4a, it gives the height of the parabola's vertex above or below the axis.
That is why it turns up in so many problems that never ask for the roots themselves: whether a thrown ball reaches a given height, what value of a parameter gives equal roots, whether a damped spring oscillates or settles. Enter a, b and c; you get the discriminant and a code for the kind of roots it implies. To find the roots, take the same coefficients to the quadratic formula calculator.
What is discriminant calculator?
For a quadratic equation ax² + bx + c = 0 with a ≠ 0, the discriminant is D = b² − 4ac. Its sign sorts the roots into three cases. D > 0: two distinct real roots. D = 0: one real root of multiplicity two, often called a repeated or double root, where the quadratic is a perfect square a(x − r)². D < 0: no real roots, but two complex conjugate roots of the form p ± qi.
The name says what it does: it discriminates between those three behaviours. The same idea extends to every polynomial. A polynomial's discriminant is an expression in its coefficients that equals zero exactly when the polynomial has a repeated root, and the quadratic's is the only one short enough to memorise. For the cubic ax³ + bx² + cx + d it is already b²c² − 4ac³ − 4b³d − 27a²d² + 18abcd.
The discriminant ignores the scale of the equation in one useful way. Multiply every coefficient by the same non-zero number k and D is multiplied by k², which can never change its sign, so 2x² − 14x + 20 = 0 has the same kind of roots as x² − 7x + 10 = 0.
How to use this calculator.
- Rearrange the equation so one side is zero and the terms run ax² + bx + c. For 3x² = 5x − 2, that means 3x² − 5x + 2 = 0, so a = 3, b = −5 and c = 2.
- Enter a, b and c, including their signs; a missing term has a coefficient of 0, and a bare x² has a = 1. Coefficient a cannot be zero, because then the equation is linear and has no discriminant.
- Read the discriminant, then the root-nature code beside it: 0 for two distinct real roots, 1 for one repeated real root, 2 for a pair of complex conjugate roots.
- If the coefficients are whole numbers and D is a perfect square, expect rational roots and try factoring; otherwise go straight to the quadratic formula, which needs √D.
The formula.
The formula comes from completing the square. Divide ax² + bx + c = 0 by a, move c/a across, and add (b/2a)² to both sides: (x + b/2a)² = (b² − 4ac) ÷ 4a². The left side is a square, so it can be zero or positive but never negative for real x. The right side has denominator 4a², which is always positive, so the sign of the whole right side is the sign of b² − 4ac. If it is positive, x + b/2a can be either of two square roots and there are two real solutions; if it is zero, only x = −b/2a works; if it is negative, no real x does.
The same rearrangement shows what the size of D means. The two roots are −b/2a ± √D/2a, so they sit symmetrically either side of x = −b/2a, at a distance √D/2|a| each way, and their difference is √D/|a|. Writing the quadratic in vertex form, a(x + b/2a)² − D/4a, shows that the vertex height is k = −D/4a. For an upward-opening parabola (a > 0), a positive D puts the vertex below the axis, so the curve must cross it twice.
A third route explains why D detects repeated roots in particular. A repeated root of f(x) = ax² + bx + c is also a root of its derivative, f′(x) = 2ax + b, which is zero only at x = −b/2a. Substituting that value gives f(−b/2a) = −D/4a, which is zero exactly when D is. The resultant of f and f′, the general algebraic test for a shared root, works out to −a(b² − 4ac).
When b is even, a shortcut saves arithmetic: writing b = 2h, D/4 = h² − ac. For x² − 6x + 5, h = −3 and h² − ac = 9 − 5 = 4, so D = 16.
Two points about the output. Decimal coefficients are handled as typed, so 0.1x² + 0.3x + 0.225 gives a discriminant of exactly 0 rather than a tiny binary-arithmetic leftover. And any discriminant whose size is below 10⁻⁹ is classified as a repeated root: x² + 1 × 10⁻¹⁰ has D = −4 × 10⁻¹⁰, strictly negative, yet is coded 1. For coefficients that small, rescale the equation first.
A worked example.
Take x² − 7x + 10 = 0, so a = 1, b = −7 and c = 10. Squaring b gives (−7)² = 49; the product 4ac is 4 × 1 × 10 = 40; and the discriminant is 49 − 40 = 9. Because 9 is greater than zero, the root-nature code is 0: two distinct real roots. The value says more. Nine is a perfect square and the coefficients are whole numbers, so the roots are rational and the quadratic should factor, and it does: (x − 2)(x − 5). The quadratic formula agrees, x = (7 ± √9) ÷ 2 = (7 ± 3) ÷ 2, giving 5 and 2. The gap between them is √9 ÷ 1 = 3, as the root-spacing rule predicts, and they sit either side of x = 7 ÷ 2 = 3.5, where the vertex is. The vertex height is −D/4a = −9 ÷ 4 = −2.25; checking directly, 3.5² − 7 × 3.5 + 10 = 12.25 − 24.5 + 10 = −2.25. So the parabola dips 2.25 units below the axis and comes back up. Raise c by 2.25 to 12.25 and the vertex rises exactly to the axis, the discriminant becomes 49 − 49 = 0, and the two roots merge at 3.5; any larger c lifts the whole curve clear of the axis.
Frequently asked questions.
Why is the root nature shown as 0, 1 or 2 instead of words?
Can I get the actual roots from the discriminant?
If the discriminant is negative, does the equation have no solution?
How do I find the value of k that gives equal roots?
How does the discriminant relate to the vertex of the parabola?
Why can't the leading coefficient a be zero?
Does multiplying the whole equation by a number change the discriminant?
How does the discriminant help with a quadratic inequality?
Where does the discriminant show up outside algebra class?
What does the discriminant say about a damped spring or circuit?
References& sources.
- [1]Stewart, J. (2015). Calculus: Early Transcendentals, 8th ed. Cengage Learning. ISBN 978-1285741550.
- [2]NIST Digital Library of Mathematical Functions (2024). "Elementary Algebra." §1.11. https://dlmf.nist.gov/1.11
- [3]Strang, G. (2016). Introduction to Linear Algebra, 5th ed. Wellesley-Cambridge Press. ISBN 978-0980232776.
- [4]Boyce, W.E. and DiPrima, R.C. (2017). Elementary Differential Equations and Boundary Value Problems, 11th ed. Wiley. ISBN 978-1119382874.
- [5]Dummit, D.S. and Foote, R.M. (2004). Abstract Algebra, 3rd ed. Wiley. ISBN 978-0471433347.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- Primary sources
- 5 cited below
- Method
- D = b² − 4ac
- Published
- Last verified
Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 1560 calculators remain free
- No billing is enabled