ForHosting KIT · Math

Polynomial long division calculator

Check a polynomial long division in seconds: x² − 3x + 2 divided by x − 1 gives the quotient x − 2 with remainder 0, so x − 1 is a factor. Coefficients go highest power first. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon

Runs in your browser. Free, unlimited — your data never leaves this page.

This polynomial long division calculator divides one polynomial by another and returns the quotient and remainder as coefficient arrays and readable polynomial strings. Long division over the polynomials is the Euclidean algorithm step that underpins factoring checks, synthetic division special cases, partial fractions, and remainder theorems: dividend equals divisor times quotient plus remainder, with the degree of the remainder strictly less than the degree of the divisor (or remainder zero when the division is exact). Small checks you may already know include x squared minus three x plus two divided by x minus one yielding quotient x minus two with remainder zero, and x cubed minus one divided by x minus one yielding x squared plus x plus one. The engine uses only deterministic floating-point arithmetic on dense coefficient vectors: no network calls, no sampling, and no date-dependent shortcuts.

What polynomial long division returns and how degrees work

Polynomial long division solves dividend equals divisor times quotient plus remainder for polynomials written as dense coefficient arrays with the highest degree first. For example the array one, negative three, two means x squared minus three x plus two, and one, negative one means x minus one. When the degree of the dividend is strictly less than the degree of the divisor, the quotient is zero and the remainder equals the dividend, which is the correct Euclidean base case and not an error.

There is no symbolic CAS path and no random sampling of roots: the engine either finishes the long-division loop inside the supported degree and magnitude limits or rejects the input.

Where polynomial long division fits in study, code, and teaching

Students meet polynomial long division when a textbook introduces the division algorithm, when they check whether a linear factor divides a cubic before applying the factor theorem, or when partial-fraction setup requires a proper rational function with remainder degree less than the denominator. Teachers can pre-generate answer keys for modest degrees without trusting opaque calculator apps that hide intermediate coefficients or silently switch to synthetic division without showing the full quotient polynomial.

Developers call the same contract from scripts to seed deterministic test vectors for computer-algebra modules, to normalize user-entered rational expressions before further processing, or to satisfy programming-challenge statements that demand both quotient and remainder arrays rather than a hand-waved factor list. Contest practice often needs a fast, offline source of long-division results so solutions can be checked without graphing calculators under time pressure.

Homework and Euclidean checks

Divide textbook polynomials and verify quotient and remainder before applying the factor or remainder theorem.

Tutoring and CAS front-ends

Normalize user-entered dividend and divisor into quotient plus remainder for step helpers and interactive lessons.

What does the polynomial long division calculator cost?

It is free in your browser on this page.

How should I encode polynomials?

Pass dense coefficient arrays highest degree first, e.g. [1, -3, 2] for x² − 3x + 2 and [1, -1] for x − 1.

What if the dividend has lower degree than the divisor?

The quotient is zero and the remainder equals the dividend. That is the correct Euclidean base case, not an error.

How do I check whether x − 1 is a factor of a polynomial?

Divide the polynomial by x − 1 and look at the remainder. For x² − 3x + 2 the remainder is 0, so the division is exact and x − 1 is a factor; the quotient x − 2 is the other one.

Can I divide x³ − 1 by x − 1?

Yes. Enter 1, 0, 0, −1 for the dividend and 1, −1 for the divisor. The quotient is x² + x + 1 with remainder 0, the classic difference-of-cubes factorisation.

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.

POSThttps://api.kit.forhosting.com/algebra/polynomial-divide

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.

curl -X POST https://api.kit.forhosting.com/algebra/polynomial-divide \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"dividend":[1,-3,2],"divisor":[1,-1]}'
{
  "dividend": [
    1,
    -3,
    2
  ],
  "divisor": [
    1,
    -1
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.polynomial_divide",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_degree64
max_abs_coeff1000000000000000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

What polynomial long division returns and how degrees work

The response echoes the normalized dividend and divisor after stripping leading zeros, returns the quotient and remainder as coefficient arrays rounded to the requested precision, reports the degrees of all four polynomials, sets an exact flag when the remainder is the zero polynomial, and builds human-readable strings such as x^2 - 3x + 2 for display in worksheets and UIs. Degree of a non-zero polynomial is one less than the length of its trimmed coefficient array; the zero polynomial is reported with degree zero and the single coefficient zero so JSON consumers never have to special-case empty arrays. The divisor must not be the zero polynomial: division by the zero polynomial is undefined and is rejected with invalid_input, matching the arithmetic rule that you cannot divide by zero.

How coefficients are read and how the algorithm stays reproducible

String coefficients that parse as finite decimals, including optional scientific notation, are allowed; embedded spaces, hex prefixes, and non-numeric tokens are rejected with a clear message so a bad cell does not become a wrong quotient. Leading zero coefficients are trimmed before division so that zero, one, two and one, two represent the same linear polynomial. The algorithm repeatedly multiplies the current leading term of the working remainder by the reciprocal of the leading coefficient of the divisor, records that term in the quotient, and subtracts the aligned product from the remainder until the remainder degree drops below the divisor degree. All steps use ordinary JavaScript floating-point arithmetic with a small epsilon when stripping near-zero leading terms, so exact rational examples with integer coefficients typically return clean integers after rounding. The preferred fields are dividend and divisor, each a non-empty array of finite numbers from highest degree down to the constant term. Aliases num, numerator, and p for the dividend and den, denominator, d, and by for the divisor are accepted so spreadsheets, query strings, and typed forms can reuse the same contract. An optional precision field, with aliases decimals and dp, chooses how many decimal places to expose for every coefficient in the response, defaulting to ten and capped at fifteen so JSON goldens stay stable across runs. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline.

Where polynomial long division fits in study, code, and teaching

Education products use the rewrite when a learner types two coefficient lists and the UI must show dividend_poly, divisor_poly, quotient_poly, and remainder_poly together with the Euclidean identity string. On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result. Pair it with complete-the-square or linear-system tools when you need related algebra steps, and with other math endpoints when you are building a small lab of free, deterministic algebra helpers for homework and software tests.

Deterministic test fixtures

Generate reproducible coefficient arrays and poly strings for unit tests, property checks, and CI assertions.

How are the quotient and remainder defined?

They satisfy dividend = divisor × quotient + remainder with deg(remainder) < deg(divisor), or remainder zero when the division is exact.

What happens if the divisor is the zero polynomial?

The input is rejected with invalid_input. Division by the zero polynomial is undefined.

Read the full KIT documentation →