Math calculator

Discriminant Calculator

Four different quantities go by this name. All four are here, each computed exactly.

Calculator

Find the discriminant

Exact fractions, so the sign is the true sign.

Δ = b² − 4ac

Cannot be zero

Include the sign

Zero is allowed

Discriminant Δ

1

Two rational roots

Two different real roots, both rational — so the quadratic factors over the rationals.

Real roots

2

A perfect square?

Yes — √Δ = 1

So it factors over the rationals.

Perfect square trinomial?

No

Δ = 0 is exactly that condition.

Working

  1. 1Identify a, b and ca = 1, b = −5, c = 6The sign belongs to the coefficient — in x² − 7x + 12, b is −7.
  2. 2Square b(−5)² = 25A negative b squares to a positive number.
  3. 3Multiply out 4ac4 × 1 × 6 = 24
  4. 4Subtract25 − 24 = 1
  5. 5Read the signTwo different real roots, both rational — so the quadratic factors over the rationals.

Every term evaluated in exact fractions — the sign above is the true sign, not a floating-point one.

What this tool covers

The number that tells you what the roots are like before you go to the trouble of finding them. Each of the four is labelled as itself rather than blended into the others, and every one is computed exactly — because the answer here is a sign, and a sign is the one thing floating point gets wrong.

  • b² − 4ac, with the root count and whether the quadratic factors over the rationals
  • The cubic discriminant, and the depressed form its sign comes from
  • The full sixteen-term quartic discriminant, with the two companions its sign needs
  • D = f_xx·f_yy − (f_xy)² — maximum, minimum, saddle or inconclusive
Quadratic, cubic and quartic The second-derivative test too Exact fractions — the sign is never rounded Free, no signup

Free, no signup — algebra only, no clinical indices.

Updated 6 September 2026 · Works in any browser, no installation

For a quadratic, the discriminant is b² − 4ac, and its sign is the answer: positive means two real roots, zero means one repeated root, negative means a complex conjugate pair. For x² − 5x + 6 it is 1, which is positive and a perfect square, so the roots are rational and it factors. For x² + 2x + 5 it is −16, and there are no real roots at all.

At a glance

Formula shown
Quadratic: Δ = b² − 4ac. Cubic: Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d². Second-derivative test: D = f_xx·f_yy − (f_xy)².
Scenario support
Coefficients of a degree-2, 3 or 4 polynomial, or the three second partials at a critical point.
Educational estimate
Planning support from the values you enter — not professional advice.

b² − 4ac: four outcomes, not three

Most courses teach three cases. There are really four, because a positive discriminant splits into two situations that behave completely differently when you try to factor:

  • Δ > 0 and a perfect square. Two rational roots, and the quadratic factors over the integers. x² − 5x + 6 has Δ = 1, and √1 = 1 exactly — so (x − 2)(x − 3) exists and can be found.
  • Δ > 0 but not a perfect square. Two real roots, both irrational, and no integer factorisation. x² + x − 1 has Δ = 5, which is not a square, so hunting for factors is time spent on something that does not exist. This is the case the three-outcome version of the rule leaves you unprepared for.
  • Δ = 0. One root, repeated, and the trinomial is a perfect square. 4x² − 12x + 9 has Δ = 0 and is (2x − 3)². The parabola touches the x-axis rather than crossing it, which is the graphical reading of “two roots that have met”.
  • Δ < 0. No real roots. x² + 2x + 5 has Δ = −16 and its solutions are a complex conjugate pair. The parabola sits entirely above or entirely below the axis.

The size of the discriminant carries no meaning at all — only its sign, and for the first case, whether it is a perfect square. A discriminant of 1,000,000 and one of 1 say exactly the same thing about the nature of the roots. What the size does track, loosely, is how far apart the two roots are: the gap between them is √Δ ÷ |a|, which is why a large discriminant on a small leading coefficient means widely separated roots.

Why this page refuses to use decimals

The entire output here is a sign, and a sign is precisely what floating-point arithmetic is worst at. Compute b² − 4ac in doubles for a quadratic whose discriminant is genuinely zero and you can get −1.4 × 10⁻¹⁶ instead — small, wrong, and negative. A calculator that then reports “two complex roots” for what is actually a perfect square has given the worst possible answer: confidently, precisely wrong.

Every coefficient on this page is held as a fraction of two arbitrary-precision integers. Before the sign is tested, the equation is multiplied through by the lowest common denominator and divided by the greatest common factor, so the comparison is between whole numbers. There is no tolerance, no epsilon, and no case where the answer depends on how the number was typed. Entering 0.1, 1/10 and 0.100 gives identical results, which is not true of a decimal implementation.

The same care is what makes the perfect-square test meaningful. “Is √Δ an integer” is only a well-posed question about an exact integer; asked of 48.99999999999999 it has no honest answer. The square root here is computed by integer Newton iteration and checked by squaring it back, so a “yes” is a proof rather than a comparison against a threshold.

The cubic discriminant, and the case it names

For ax³ + bx² + cx + d the discriminant is 18abcd − 4b³d + b²c² − 4ac³ − 27a²d². It reads as an arbitrary pile of terms, and it is not — it is the product of the squared differences of the three roots, multiplied by a⁴, which is why it vanishes exactly when two roots coincide.

  • Δ > 0 — three distinct real roots. (x − 1)(x − 2)(x − 3), expanded, has Δ = 4.
  • Δ = 0 — at least two roots coincide. (x − 1)³ has Δ = 0, as it must.
  • Δ < 0 — one real root and a complex conjugate pair. x³ − 1 has Δ = −27. Every real cubic has at least one real root, because an odd-degree polynomial runs from −∞ to +∞ and has to cross somewhere.

The positive case has a name and a genuine curiosity attached to it. When a cubic has three distinct real roots and does not factor over the rationals, Cardano’s formula cannot reach those three real numbers without passing through complex arithmetic on the way. That is the casus irreducibilis, and it is not a defect in the formula — it was proved in the nineteenth century that no formula in real radicals can do it. The practical route in that case is the trigonometric solution — the three roots written with cosines of a third of an angle — which stays inside the real numbers throughout.

The calculator above also reports p and q, the coefficients of the depressed cubic t³ + pt + q that you get by substituting x = t − b/3a. That substitution removes the squared term, and the sign of the discriminant is much easier to see from −4p³ − 27q² than from the five-term version.

The quartic, where the sign alone is not enough

The degree-4 discriminant has sixteen terms and no shorter honest form. Anything advertised as a “simplified quartic discriminant” is almost always the discriminant of the resolvent cubic instead, which is a different number.

More importantly, its sign does not settle the root pattern the way a quadratic’s or a cubic’s does. A negative discriminant does mean exactly two real roots and one complex pair. But a positive discriminant means either four real roots or none at all, and telling those apart needs two further quantities: P = 8ac − 3b², and the longer D built from all five coefficients. Both are negative precisely when all four roots are real. The calculator above reports both alongside the discriminant, because giving only the sign would be giving half an answer — and that half looks complete.

A zero quartic discriminant means at least two roots coincide, and which ones, with what multiplicities, needs the resolvent cubic to pin down. The tool says that plainly rather than guessing.

The other discriminant: f_xx·f_yy − (f_xy)²

In multivariable calculus, “the discriminant” means something else entirely. At a critical point of a surface z = f(x, y) — a point where both first partials vanish — the quantity D = fxx·fyy − (fxy)² classifies what kind of point it is. It shares the name and nothing else: it is not b² − 4ac, it is not about polynomial roots, and applying one rule to the other’s inputs produces a plausible number and a meaningless conclusion.

The trap in this one is the positive case, and it catches people constantly:

  • D < 0 — a saddle point. The surface rises in one direction and falls in another, so the point is neither a maximum nor a minimum. fxx = 2, fyy = −2, fxy = 0 gives D = −4.
  • D > 0 — an extremum, and fxx says which. D > 0 alone does not mean a minimum. With fxx = 2, fyy = 2, fxy = 0, D = 4 and fxx is positive: a local minimum. Flip both signs and D is still 4, but fxx is negative: a local maximum. Reporting “minimum” for D > 0 without checking fxx is wrong exactly half the time.
  • D = 0 — the test says nothing. Not “neither”, not “a saddle”: nothing. The point may be any of the three, and deciding needs higher derivatives or a direct look at the surface nearby. A calculator that returns a verdict here is inventing one.

The tool asks for fxy once rather than for both mixed partials, because Clairaut’s theorem makes fxy and fyx equal wherever they are continuous, which covers every function this test is normally applied to.

Not this: Maddrey’s discriminant function

Searches for “discriminant function calculator” include a substantial number of people looking for Maddrey’s discriminant function, a severity score used in alcoholic hepatitis that is computed from prothrombin time and bilirubin. It shares the word and nothing else.

It is not published here, and that is a decision rather than an omission. It is a clinical index whose output guides treatment, this site does not publish medical calculators, and a page that quietly served it beside b² − 4ac would be inviting exactly the wrong kind of use. If that is what you came for, a clinician or a medical reference is the right place, not a maths page.

Related calculators

Where the discriminant leads next:

Quadratic FormulaSolve any quadratic with exact roots — surds stay surds and a negative discriminant gives the complex pair — plus the vertex, the factored form and every step of the working.
Completing the SquareRewrite ax² + bx + c as a(x − h)² + k with every step shown, solve by the method, or find the constant that completes a square — all in exact fractions.
Factoring TrinomialsFactor a trinomial by the AC method with every factor pair of ac listed, the common factor taken out first, and the answer multiplied back out to check it.
ScientificTrigonometry, logarithms, powers, roots, and factorials with correct order of operations, memory registers, history, and keyboard entry.
Standard DeviationSample and population standard deviation, plus variance, mean, median, quartiles, z-scores, outliers, and confidence intervals.
PercentageSolve X% of Y, what percent X is of Y, reverse percentage, increase/decrease, discounts, and tax, tip, or commission.

More in Math, or browse all calculators.

Read the guide

The four quantities on this page are only useful once they change what you do next. Factoring, Completing the Square, or the Quadratic Formula — Which to Use turns the quadratic discriminant into exactly that: a decision rule that picks the method before any of the work starts, because a perfect square means factor, a non-square positive means reach for the formula, and a zero means the trinomial is already a square. It is the practical half of what b² − 4ac is for.

Sources and methodology

The discriminant formulas are definitions with derivations, not figures from a document, so they are written out above rather than asserted on someone’s authority. What is cited is the standard reference statement of each, which is what makes the sixteen-term quartic checkable rather than something you have to take on trust.

Method. Every figure on this page comes from one engine, src/lib/discriminant.ts, built on the exact-rational core in src/lib/algebra/. Coefficients are BigInt fractions; the equation is cleared to integers before any sign is tested; and the perfect-square check is an integer square root verified by squaring it back, not a comparison against a tolerance. That engine is verified on every change against 51 hand-written assertions, including that the discriminant of a cube of a linear factor is exactly zero, that the quartic’s companions P and D separate four real roots from none, and that D > 0 with a negative fxx is reported as a maximum rather than a minimum. The count and the per-case breakdown are published on the formula verification page.

Educational use disclaimer

This calculator evaluates the algebraic discriminant of a polynomial of degree 2, 3 or 4, and the second-derivative test used to classify a critical point of a surface. All four are computed in exact rational arithmetic, so the reported sign is the true sign rather than a floating-point approximation of it. It does not calculate any clinical or medical index that shares the name — Maddrey’s discriminant function, used in assessing alcoholic hepatitis, is a different quantity entirely and is not published here. Nothing on this page is medical, engineering, or professional advice.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (3 updates)

Published 6 September 2026

  1. Published the discriminant calculator covering all four quantities that carry the name: the quadratic, cubic and quartic discriminants, and the second-derivative test D = f_xx·f_yy − (f_xy)² from multivariable calculus.
  2. Every sign is decided in exact rational arithmetic after clearing denominators, so a genuinely zero discriminant is never reported as a small negative one.
  3. Maddrey’s discriminant function, a clinical index that shares the name, is explicitly named as out of scope rather than silently omitted.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.