Polynomial division calculator
Divide one polynomial by another and get the quotient and the remainder: x² − 3x + 2 divided by x − 1 gives x − 2 with a remainder of 0. The divisor can be of any degree, not only x − r. 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.
Polynomial division is the Euclidean algorithm on univariate polynomials: given a dividend p(x) and a non-zero divisor d(x), there exist unique polynomials q(x) and r(x) such that p equals d times q plus r, and either r is the zero polynomial or the degree of r is strictly less than the degree of d. Students meet this identity when they first divide x-squared minus three x plus two by x minus one and recover the linear quotient x minus two. Engineers meet it when they cancel a factor, reduce a transfer function, or compute a remainder for later evaluation. This polynomial division calculator accepts both polynomials as dense coefficient arrays in descending degree order, rejects the zero polynomial as a divisor, and returns the quotient and remainder arrays together with degrees and compact polynomial strings.
What polynomial division means and how the quotient and remainder appear
Univariate polynomial division is the exact analogue of integer long division. For integers, dividing 17 by 5 yields quotient 3 and remainder 2 because 17 equals 5 times 3 plus 2 and the remainder is smaller than the divisor.
For polynomials the same Euclidean statement holds: given a dividend p(x) and a non-zero divisor d(x), there is a unique pair of polynomials q(x) and r(x) such that p(x) equals d(x) times q(x) plus r(x), and either r is identically zero or the degree of r is strictly less than the degree of d. Search intent clusters around phrases such as polynomial division, divide two polynomials, polynomial quotient and remainder, and Euclidean algorithm for polynomials.
Classroom problems usually send highest-degree-first lists such as one, negative three, two for x-squared minus three x plus two, and one, negative one for x minus one, and they expect the linear quotient one, negative two with a zero remainder. Control theory and signal-processing notes use the same identity to cancel a pole against a zero or to reduce the degree of a numerator before evaluating a remainder.
Unlike synthetic division, which only handles a linear monic factor of the form x minus r, full polynomial division accepts a divisor of any positive degree, including quadratics and higher, so it is the general tool when the denominator is not a simple linear factor.
What to enter and in which order
Each array is a dense list of finite coefficients in descending degree order, so the first entry is the leading coefficient and the last entry is the constant term. Example: send dividend one, negative three, two and divisor one, negative one to divide x-squared minus three x plus two by x minus one. Leading zeros are stripped before the degree is computed, so zero, zero, one, negative three, two is treated as the same quadratic.
Numeric strings that parse as ordinary decimals are accepted so form posts and spreadsheet exports stay convenient. Coefficients whose absolute value exceeds the declared magnitude ceiling, or arrays whose degree exceeds the declared maximum, are also rejected. On success the body echoes the trimmed dividend and divisor, returns quotient and remainder as highest-first arrays rounded to the requested precision (default ten decimal places), reports the four public degrees, sets exact to true when the remainder is the zero polynomial, and includes compact polynomial strings plus the identity formula.
When the degree of the dividend is already smaller than the degree of the divisor, the quotient is the zero polynomial and the remainder is the dividend itself. Failed validation is not billed.
Where polynomial division helps, and its limits
Classrooms and tutoring platforms use a polynomial division calculator so learners can check both the quotient and the remainder for arbitrary coefficient lists without losing a sign while lining up long-division columns by hand. Exam-prep generators and LMS auto-graders need a deterministic oracle that rejects a zero divisor instead of silently inventing a quotient, and that returns arrays a grader can compare element by element. Invalid input does not consume balance.
Limits are intentional: this is univariate dense division only, not multivariate division, not factorization into irreducibles, and not a root finder. If you need the greatest common divisor of two polynomials, the roots of a single polynomial, or synthetic division by x minus r, choose those dedicated capabilities instead of stretching this contract. Keep requests inside the published degree and magnitude limits, pin the rounded coefficients in tests, and you get reproducible quotient and remainder pairs without standing up symbolic math infrastructure of your own.
What you can do with it
Classroom and homework polynomial division checks
Let students submit two highest-first coefficient arrays and verify the quotient and remainder against textbook long division, including exact and inexact cases.
Exam and LMS auto-grading
Mark polynomial division items with a deterministic oracle that rejects the zero polynomial as divisor and never invents extra remainder terms.
Notebooks and rational-function reduction
Cancel or reduce dense univariate polynomials in control and signal scripts without importing a full computer-algebra library.
FAQ
How do I divide two polynomials with this calculator?
Send dividend and divisor as coefficient arrays, highest degree first. Example: [1, -3, 2] divided by [1, -1] returns quotient [1, -2] and remainder [0], which is (x² − 3x + 2) / (x − 1) = x − 2.
In what order should I send coefficients?
Descending degree: the first number is the leading coefficient and the last number is the constant term. Leading zeros are stripped before degrees are computed.
When is the remainder zero?
When the divisor divides the dividend exactly. The response then sets exact to true and remainder to [0]. Otherwise deg(remainder) is strictly less than deg(divisor).
How is this different from synthetic division?
Synthetic division only works when the divisor is a simple linear factor of the form x − r. Here the divisor can have any positive degree, including quadratics and higher, so it covers the cases where the denominator is not a single linear factor.
How can I check a polynomial division by hand?
Multiply the divisor by the quotient and add the remainder: you must get the dividend back, and the remainder must have a lower degree than the divisor. For x² − 3x + 2 divided by x − 1, (x − 1)(x − 2) + 0 rebuilds the original.
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/math/polynomial-division \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"dividend":[1,-3,2],"divisor":[1,-1]}'const res = await fetch("https://api.kit.forhosting.com/math/polynomial-division", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"dividend": [
1,
-3,
2
],
"divisor": [
1,
-1
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/polynomial-division",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"dividend": [
1,
-3,
2
],
"divisor": [
1,
-1
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/polynomial-division", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"dividend":[1,-3,2],"divisor":[1,-1]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"dividend":[1,-3,2],"divisor":[1,-1]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/polynomial-division", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"dividend": [
1,
-3,
2
],
"divisor": [
1,
-1
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.polynomial_division",
"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_degree | 64 |
max_abs_coeff | 1000000000000000 |
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
What polynomial division means and how the quotient and remainder appear
That uniqueness is what makes an API contract possible: the same coefficient arrays always produce the same quotient and remainder, with no branching on a computer-algebra heuristic. This endpoint implements that general algorithm and reports both the dense coefficient arrays and compact display strings so a human and a machine can read the same answer.
Input contract, coefficient order, validation, and response shape
POST a JSON body with two required arrays: dividend and divisor. Empty arrays, missing fields, non-arrays, Infinity, and NaN fail with invalid_input naming the field. If every coefficient of the divisor is zero after trimming, the request fails with a message that the divisor must not be the zero polynomial, because division by zero is undefined in the polynomial ring. Optional aliases such as num, numerator, and p for the dividend, and den, denominator, d, and by for the divisor, are accepted so classroom templates do not need a rewrite.
Where a polynomial division API earns its keep, and what it does not do
Engineering notebooks reduce rational expressions, cancel common factors after a separate GCD step, or apply the remainder theorem by first dividing by a linear factor; calling a tiny parse API avoids pulling a full computer-algebra system for a pair of dense arrays.
Technical questions
What happens if the divisor is the zero polynomial?
The task fails with invalid_input. Division by the zero polynomial is undefined, so the request is rejected and is not billed.
What does the polynomial division calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.