Cubic discriminant calculator
x³ − 6x² + 11x − 6 has discriminant 4, so it has three distinct real roots: enter the four coefficients and get the discriminant, its sign and how many different real solutions to expect. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- A
- 1
- B
- -6
- C
- 11
- D
- -6
- Discriminant
- 4
- Sign
- positive
- Classification
- three_distinct_real_roots
- Distinct real roots
- 3
A cubic discriminant condenses four polynomial coefficients into one value that reveals the equation’s real-root structure without requiring you to solve for every root. Enter the coefficients of ax³ + bx² + cx + d, with a nonzero, and this calculator returns the discriminant, its sign, a plain-English classification, and the number of distinct real roots. It distinguishes three separate real roots, one real root with a complex conjugate pair, a repeated-root case, and the special triple-root case.
What the cubic discriminant tells you
For a real cubic polynomial ax³ + bx² + cx + d, the discriminant is 18abcd − 4b³d + b²c² − 4ac³ − 27a²d². Its sign summarizes how the graph meets the horizontal axis. A positive discriminant means the polynomial has three distinct real roots, so its graph crosses the axis three times.
A negative discriminant means it has exactly one real root and two non-real roots that form a complex conjugate pair. A zero discriminant means at least two roots coincide. In that final case, the calculator checks additional coefficient identities to distinguish one triple real root from two distinct real roots where one has multiplicity two.
This distinction matters because saying that a cubic has three roots while counting multiplicity is different from saying how many distinct real values solve it.
How to enter coefficients and read the result
Supply a, b, c, and d in the same order they appear in ax³ + bx² + cx + d. Every coefficient is required, including zeros for missing terms. The leading coefficient a cannot equal zero, because that would reduce the expression to a quadratic or lower-degree polynomial and the cubic classification would no longer apply.
The returned formula makes the convention explicit, which helps avoid confusion with Cardano’s depressed-cubic quantity. Some textbooks use a related expression with the opposite sign when discussing the depressed cubic; this capability always reports the standard polynomial discriminant written in the response. Numeric strings are accepted when they contain only a valid finite number.
Accuracy, repeated roots, and practical use
Repeated roots are numerically delicate because a theoretically zero discriminant can acquire a tiny floating-point residue after several products and sums. The algorithm compares that residue with a tolerance scaled to the magnitudes of the five terms in the discriminant formula. This avoids classifying ordinary rounding noise as a genuinely positive or negative result while keeping the behavior deterministic for identical inputs.
Use the calculator when checking algebra exercises, analyzing turning-point behavior, screening characteristic polynomials, or deciding which root-solving method should run next. A positive value can route work to a three-real-root method; a negative value signals that complex arithmetic is required for the full solution; and zero warns downstream code that multiplicity may make generic numerical routines less stable. This is a classifier, not a symbolic factorizer or a complete cubic solver: it does not return root values, factors, derivatives, or plots.
What you can do with it
Check algebra exercises
Confirm the discriminant and distinct-real-root count before solving a cubic by factoring or Cardano’s method.
Route a numerical workflow
Choose a real-only or complex-capable root solver from the discriminant sign before performing more expensive calculations.
Detect repeated eigenvalues
Flag a cubic characteristic polynomial whose zero discriminant indicates at least one repeated root.
FAQ
What formula does the calculator use?
It uses Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d² for ax³ + bx² + cx + d.
What does a negative discriminant mean?
The cubic has one real root and two non-real complex conjugate roots.
What does a zero discriminant mean?
At least two roots coincide. The result further distinguishes a triple root from a double root plus another real root.
Does this calculator return the roots?
No. It returns the discriminant and root structure; use a cubic equation solver when you need the root values.
How do I enter a cubic with missing terms, such as x³ − x?
Type a zero for every missing term: x³ − x is entered as 1, 0, −1 and 0. All four coefficients are required, and the first one cannot be zero, or the equation would no longer be a cubic.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/algebra/cubic-discriminant \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a":1,"b":-6,"c":11,"d":-6}'const res = await fetch("https://api.kit.forhosting.com/algebra/cubic-discriminant", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a": 1,
"b": -6,
"c": 11,
"d": -6
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/cubic-discriminant",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a": 1,
"b": -6,
"c": 11,
"d": -6
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/cubic-discriminant", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a":1,"b":-6,"c":11,"d":-6}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a":1,"b":-6,"c":11,"d":-6}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/cubic-discriminant", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"a": 1,
"b": -6,
"c": 11,
"d": -6
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.cubic_discriminant",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_abs_coefficient | 1000000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The calculation is deterministic and available both in the browser and through the API.
What the cubic discriminant tells you
The response therefore includes both a descriptive classification and an explicit distinct_real_roots count. It does not approximate the roots themselves; its purpose is the faster structural test supplied by the discriminant.
How to enter coefficients and read the result
For example, x³ − x is entered as a = 1, b = 0, c = −1, and d = 0. On success, discriminant contains the computed numeric value and sign is positive, negative, or zero. classification names the corresponding root pattern, while distinct_real_roots gives the number of different real solutions: three for a positive result, one for a negative result, and either one or two for a zero result.
Accuracy, repeated roots, and practical use
Browser use is free, while successful automated API requests use the published base price of $0.002 per item.
Technical questions
What does a positive discriminant mean?
The cubic has three distinct real roots.
What does an API calculation cost?
A successful API request uses the published base price of $0.002 per item; the browser calculator is free.