Remainder theorem calculator
Dividing 2 - 3x + x^2 by x − 2 leaves a remainder of 0, so 2 is a root. The calculator gets that remainder as p(r) with Horner's method, skips long division and shows every step. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Runs in your browser. Free, unlimited — your data never leaves this page.
A remainder theorem calculator finds the remainder when a univariate polynomial p(x) is divided by a linear factor of the form x minus r without performing long division. By the polynomial remainder theorem that remainder equals the single value p(r), and this tool computes p(r) with Horner's nested multiplication so intermediate powers never explode and every step stays auditable.
Why the remainder equals p(r)
Any polynomial p(x) can be written as (x − r) times a quotient plus a constant remainder. Put r in place of x and the first part becomes zero, so the remainder is simply p(r). That is the remainder theorem, and it means you never have to build the quotient to know what is left over. Horner's method then evaluates p(r) by starting from the highest coefficient, multiplying by r and adding the next coefficient, again and again down to the constant term. For 2 - 3x + x^2 divided by x − 2, the running values are 1, then -1, then 0.
When it helps and what to watch
The remainder theorem is a quick filter when you try candidate roots before factoring or graphing: a remainder of zero tells you that x − r divides the polynomial exactly. Teachers use it to check worked answers, and students use it to confirm a calculation done by hand. Watch the order of the coefficients: here the constant term comes first, so 2 - 3x + x^2 is entered as 2, -3, 1. An empty list is not treated as zero; it is rejected, so a missing polynomial never passes as a result.
What the remainder theorem states and how Horner evaluates p(r)
The polynomial remainder theorem says that when any univariate polynomial p(x) with real (or rational) coefficients is divided by the monic linear factor x minus r, the unique remainder is the constant p(r). Algebraically that is the identity p(x) equals (x minus r) times some quotient polynomial q(x) plus the constant p(r). Evaluating the right-hand side at x equals r immediately recovers the remainder without constructing q(x) at all.
Horner's method rewrites p in nested form so evaluation uses only multiplications by r and additions of successive coefficients, working from the highest degree term down to the constant. Formal degree is the highest index whose absolute value exceeds a tiny epsilon so trailing numerical dust does not inflate degree, and the zero polynomial—every coefficient zero after rounding—is allowed with degree minus one.
What you can do with it
Quick root checks before factoring
Tutors and solvers try rational candidates for r and use remainder zero as a fast filter before investing in full factorization or graphing.
FAQ
How are coefficients ordered?
Constant term first: [a0, a1, a2] means a0 + a1·x + a2·x². Horner walks from the highest-degree coefficient down to a0.
What happens if coefficients are missing or empty?
A missing field or empty array is not a zero polynomial; coefficients are required.
Do you return the quotient polynomial?
No. This capability returns only the remainder p(r) and Horner steps. Full synthetic division for q(x) is out of scope.
Is the remainder theorem calculator free?
The browser tool is free and runs locally.
What does a remainder of 0 mean?
It means x − r divides the polynomial exactly, so r is a root. For 2 - 3x + x^2 divided by x − 2 the remainder is 0, which confirms that 2 is a root.
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/remainder-theorem \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"coeffs":[2,-3,1],"r":2}'const res = await fetch("https://api.kit.forhosting.com/algebra/remainder-theorem", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"coeffs": [
2,
-3,
1
],
"r": 2
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/remainder-theorem",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"coeffs": [
2,
-3,
1
],
"r": 2
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/remainder-theorem", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"coeffs":[2,-3,1],"r":2}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"coeffs":[2,-3,1],"r":2}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/remainder-theorem", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"coeffs": [
2,
-3,
1
],
"r": 2
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.remainder_theorem",
"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_coeffs | 256 |
max_abs | 1000000000000 |
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
Missing or empty coefficient lists are rejected with invalid_input instead of silently inventing a zero polynomial.
What the remainder theorem states and how Horner evaluates p(r)
With the constant-term-first convention used by this API, the array [a0, a1, …, an] means a0 plus a1 times x up through an times x to the n; Horner starts at an, multiplies by r, adds a_{n−1}, multiplies by r again, and continues until a0 is added. That final accumulator is exactly p(r) and therefore the remainder. What is never allowed is a missing field or an empty coefficient array: empty is not a zero polynomial; it is missing data, and the API returns invalid_input so homework scripts and grading pipelines fail loudly instead of treating silence as zero.
How to call the API and what comes back
Send a JSON body with two required fields: coeffs (aliases coefficients, p, poly), a non-empty array of finite numbers with the constant term first, and r (aliases value, at, root), the finite number appearing in the divisor x minus r. Each coefficient array may hold at most two hundred fifty-six entries, and every absolute coefficient value and the absolute value of r must stay within one trillion so intermediate Horner products remain finite in IEEE double precision on the Worker and in the browser. String numbers are accepted when they match a strict finite numeric pattern; JSON-encoded array strings are also accepted for clients that only send text fields. On success the response echoes rounded coeffs and r, sets remainder and p_of_r to the same evaluated value, is_root to true when the remainder is numerically zero within epsilon, degree to the formal degree of p, p_str and divisor_str to compact human-readable polynomials, formula to a short English statement of the remainder theorem with Horner, message to a one-line remainder or root summary, and steps to an ordered array of Horner accumulation lines you can assert in tests. Failed validation—missing coeffs or r, empty coefficient arrays, non-arrays, non-finite entries, lists longer than the published maximum, values outside absolute limits, or non-finite Horner accumulation—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.
Practical tips, limits, and related searches
Keep coefficient magnitudes and r inside the published absolute range so successive products cannot overflow into a non-finite accumulator that the solver must reject. Classic classroom checks include p(x) equals x squared minus three x plus two at r equals two, which yields remainder zero because two is a root, and the same polynomial at r equals one, which yields remainder zero as well, or a cubic like two minus three x plus x squared at r equals two with a nonzero remainder you can verify by hand. Prefer this capability when you already have coefficients and a candidate r and only need the remainder or a root check; if you need the full quotient coefficients, use synthetic division elsewhere. Prefer sending genuine JSON arrays rather than pre-formatted strings when you control the client. Pair those successes with a missing coeffs field or an empty coefficient array to document the hard invalid_input path. This landing targets people searching for a remainder theorem calculator, polynomial remainder of division by x minus r, or evaluate p(r) by Horner's method online; it is not synthetic division that returns the full quotient, not a root finder that searches for r, and not a multivariate evaluator. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately omit coefficients.
Integration use cases
Homework checks for remainder and root questions
Students enter textbook coefficients and a candidate r, then compare the remainder and is_root flag against hand Horner work before submitting algebra homework.
Unit tests for student polynomial evaluators
Generate known-good p(r) cases plus deliberate missing or empty coefficient rejections for coding kata expected values and continuous integration fixtures.
Technical questions
Does a zero remainder mean r is a root?
Yes. When remainder is numerically zero within epsilon, is_root is true and (x − r) divides p(x) exactly.