Divide two polynomials using the long division algorithm. Enter coefficients in descending order (comma separated). Get the quotient, remainder, and a detailed walkthrough of each subtraction step.
Polynomial division (or long division of polynomials) is an algorithm similar to arithmetic long division. Given two polynomials (dividend and divisor), it finds a quotient and a remainder such that
dividend = divisor × quotient + remainder, where the degree of the remainder is less than that of the divisor. It is fundamental in algebra, calculus (partial fractions), root finding, and signal processing.
If \( P(x) \) and \( D(x) \) are polynomials, there exist unique \( Q(x) \) and \( R(x) \) with deg \( R \) < deg \( D \) such that:
\( P(x) = D(x) \cdot Q(x) + R(x) \)
The process dates back to ancient Chinese and Islamic mathematics. Al‑Samaw'al (12th century) described polynomial division in *Al‑Bāhir*. In Europe, it was formalised by François Viète and later by René Descartes. The modern symbolic notation emerged in the 17th century. Today it is a cornerstone of computer algebra systems.
Given coefficients [aₙ, aₙ₋₁, …, a₀] (dividend) and [bₖ, bₖ₋₁, …, b₀] (divisor, bₖ≠0). Long division proceeds:
The tool uses floating‑point arithmetic; for exact rational results we recommend using integer coefficients. The step display shows each subtraction in aligned columns.
When divisor is linear (x − c), synthetic division offers a faster method. Our calculator handles any degree, but the steps illustrate the classic long division.
Try the example buttons – each has been verified.
| Dividend | Divisor | Quotient | Remainder |
|---|---|---|---|
| x³−3x²+2 | x−2 | x²−x−2 | −2 |
| 2x³+3x²−4x+5 | x+1 | 2x²+x−5 | 10 |
| x⁴−5x²+4 | x²−1 | x²−4 | 0 |
| 6x⁵+5x⁴+4x³+3x²+2x+1 | 2x+1 | 3x⁴+x³+1.5x²+0.75x+0.625 | 0.375 |
In electrical engineering, the transfer function of a system is a rational polynomial. Polynomial division is used to separate proper and improper parts, enabling stability analysis via partial fraction expansion. For example, dividing \( \frac{s^3 + 2s^2 + 3s + 4}{s^2 + s + 1} \) yields a quotient (s+1) and remainder (s+3) — this informs the system's response decomposition.
For a polynomial P(x) divided by (x − c), the remainder is P(c). If the remainder is zero, (x − c) is a factor. Our calculator uses this principle implicitly.
function polyDivide(dividend, divisor) {
let quot = [];
let rem = dividend.slice();
while (rem.length >= divisor.length && rem.some(x => Math.abs(x) > 1e-12)) {
let factor = rem[0] / divisor[0];
quot.push(factor);
let subtractor = divisor.map(c => c * factor);
// Pad subtractor to match rem length
while (subtractor.length < rem.length) subtractor.push(0);
// subtract elementwise
rem = rem.map((val, idx) => val - subtractor[idx]);
// remove leading zeros
while (rem.length > 0 && Math.abs(rem[0]) < 1e-12) rem.shift();
}
if (rem.length === 0) rem = [0];
return { quotient: quot, remainder: rem };
}