Polynomial root finder
List the real roots of a polynomial with their multiplicities: x³ − 6x² + 11x − 6 has the roots 1, 2 and 3, each appearing once. A double root is reported once with multiplicity 2. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Coefficients
- 1, -6, 11, -6
- Degree
- 3
- Polynomial
- x^3 - 6x^2 + 11x - 6
- Roots
- 1, 2, 3
- Multiplicities
- 1, 1, 1
Finding every real number where a polynomial equals zero is a core skill in algebra, calculus, engineering, and scientific computing. Given the coefficient list of a univariate polynomial—highest degree first—this capability returns every distinct real root together with its multiplicity. Integer and rational roots are discovered with the classical rational root theorem and peeled off by synthetic division; any residual quadratic is solved in closed form; higher residual factors are isolated with derivative critical points, a Cauchy magnitude bound, bisection, and Newton polishing. A zero leading coefficient is rejected as invalid input rather than silently lowering the degree.
Coefficients, degree, and what “all real roots” means
The degree is one less than the length of a well-formed array. A real root is any real number r such that p(r) equals zero; complex non-real conjugate pairs are intentionally omitted because many classroom and pipeline tasks only care about real crossings of the x-axis. Multiplicity counts how many times (x minus r) divides p: a double root of (x minus 1) squared appears once in the roots list with multiplicity two, which is more useful for graphing and partial fractions than listing the same value twice.
Constant non-zero polynomials have degree zero and an empty root list.
How the solver combines the rational root theorem with numeric refinement
When every coefficient is near an integer, the rational root theorem supplies a finite candidate set: every rational root in lowest terms p over q has p dividing the constant term and q dividing the leading coefficient, including sign variants and zero when the constant term vanishes. Each candidate is evaluated with Horner’s method; hits are removed by synthetic division and the process repeats so multiplicities are captured.
After rational deflation, a linear residual yields one root by division, and a quadratic residual uses the discriminant formula, returning zero, one, or two real roots. Higher residual degrees are handled without external libraries: the formal derivative is solved recursively to locate critical points, a Cauchy bound guarantees all real roots lie inside a known interval, and each sub-interval with a sign change is refined by bisection then Newton iteration until residual and step size fall below tight epsilon thresholds.
Near-integer noise is cleaned for readable goldens while ordinary irrationals such as plus or minus square root of two keep twelve significant digits of precision.
What you can do with it
Homework and tutoring verification
Students and graders confirm every real root and multiplicity for cubics and quartics without a local computer-algebra install, including clear errors for a zero leading coefficient.
Curriculum and assessment generators
Automated problem banks generate random integer-root polynomials and verify solver output against this deterministic oracle before publishing exercises.
FAQ
What happens if the leading coefficient is zero?
The degree is not silently reduced, and the failed call is not charged.
Does it return complex roots?
No. Only real roots are returned. Non-real complex conjugate pairs are omitted by design so the output matches x-axis intercepts and most classroom real-root tasks.
Is the polynomial root finder free?
The browser tool runs free on your device.
How are multiple roots reported?
For example (x − 1)² yields roots [1] with multiplicities [2].
How accurate are irrational roots?
Roots that are not whole numbers or fractions, such as plus or minus the square root of 2, are refined until they are kept to twelve significant digits. Integer and rational roots are found exactly first.
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/polynomial-roots \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"coefficients":[1,-6,11,-6]}'const res = await fetch("https://api.kit.forhosting.com/algebra/polynomial-roots", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"coefficients": [
1,
-6,
11,
-6
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/polynomial-roots",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"coefficients": [
1,
-6,
11,
-6
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/polynomial-roots", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"coefficients":[1,-6,11,-6]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"coefficients":[1,-6,11,-6]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/polynomial-roots", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"coefficients": [
1,
-6,
11,
-6
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.polynomial_roots",
"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.
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
Coefficients, degree, and what “all real roots” means
Write a monic or non-monic univariate polynomial as a_n x to the n plus a_{n-1} x to the n-1 down to a_0. The input array is exactly those numbers in that order: the first entry is the leading coefficient a_n and the last is the constant term. If the leading coefficient is zero the request fails with invalid_input—the engine does not quietly drop leading zeros, so callers remain responsible for declaring the intended degree.
How the solver combines the rational root theorem with numeric refinement
The entire path is pure floating-point arithmetic—no network, no random seeds, no wall-clock time—so the same coefficients always produce the same JSON. Failed validation, including a missing coefficients array or a zero leading term, raises invalid_input and is not charged.
Calling the API, reading the response, pricing, and practical limits
Use the free in-browser tool for one-off homework checks, lecture demos, and quick sanity tests without installing Maxima, Mathematica, or a local NumPy stack. Degree is capped for isolate safety; extremely large coefficient magnitudes can suffer cancellation like any double-precision scheme, so prefer well-scaled classroom and engineering inputs. Send a JSON body with the required coefficients array of finite numbers, highest degree first; the alias coeffs is accepted for convenience. On success the response echoes the cleaned coefficients, the degree, a human-readable polynomial string, the sorted distinct real roots, a parallel multiplicities array, structured root_details objects, the distinct real_root_count, and a method label documenting the rational-plus-numeric strategy. Use the API when a tutoring platform, coding-assessment sandbox, curriculum generator, or data pipeline needs a stable contract under prepaid KIT balance at $0.002 per successful item. Source inputs follow the same retention rules as other KIT parse items, and validation failures never consume balance after the engine rejects the request.
Integration use cases
Lightweight numeric pipelines
Scripts that need real roots of low-degree residual polynomials call a stable JSON endpoint instead of reimplementing rational-root search and Newton polish in every language.
Technical questions
How do I find polynomial roots with this API?
Send JSON with coefficients as an array highest degree first (for example [1, -6, 11, -6] for x³ − 6x² + 11x − 6). The response lists every distinct real root with multiplicity.