Polynomial Long Division Calculator

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.

Comma‑separated numbers, descending powers.
Example: 1, -2 → x - 2.
? (x³−3x²+2)/(x−2)
? (2x³+3x²−4x+5)/(x+1)
? (x⁴−5x²+4)/(x²−1)
⚙️ (6x⁵+5x⁴+4x³+3x²+2x+1)/(2x+1)
? (x³−27)/(x−3)
Privacy first: All calculations are performed locally. No data is sent to any server.

What is Polynomial Division?

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) \)

Historical Roots

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.

Why Use an Interactive Polynomial Division Calculator?

  • Step‑by‑Step Learning: See each intermediate subtraction, exactly like manual long division.
  • Error Checking: Verify homework or exam solutions quickly.
  • Partial Fractions: Essential for integration in calculus.
  • Root Approximation: Synthetic division helps evaluate polynomials (remainder theorem).

Algorithm & Implementation

Given coefficients [aₙ, aₙ₋₁, …, a₀] (dividend) and [bₖ, bₖ₋₁, …, b₀] (divisor, bₖ≠0). Long division proceeds:

  1. Leading term of quotient: (aₙ / bₖ) · xⁿ⁻ᵏ.
  2. Multiply divisor by this term, subtract from dividend → new dividend.
  3. Repeat until degree(new dividend) < degree(divisor).

The tool uses floating‑point arithmetic; for exact rational results we recommend using integer coefficients. The step display shows each subtraction in aligned columns.

Synthetic Division (Shortcut for Linear Divisors)

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.

Worked Examples

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
Real‑world application: Control Theory

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.

The Remainder Theorem & Factor Theorem

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.

Common Pitfalls & Tips

  • Missing terms: Always include zero coefficients for missing degrees (e.g., 1,0,-3 for x²−3).
  • Sign errors: Subtracting the product is a frequent mistake – our step display highlights subtraction.
  • Fractional coefficients: The algorithm works with fractions; results are shown as decimals to 4 places.
  • Divisor leading coefficient zero: Not allowed (would make degree undefined).

JavaScript Implementation (Long Division)

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 };
}
                    

Frequently Asked Questions

Then the quotient is zero (or empty) and the remainder is the entire dividend. The calculator will handle this case.

You must explicitly include zero coefficients. For example, x³+1 should be entered as 1,0,0,1. Otherwise the algorithm misaligns degrees.

The tool treats coefficients numerically; the variable is symbolic. Display uses "x" for clarity, but the math is independent of variable name.

Coefficients are displayed as decimals to 4 digits. For exact fractions we recommend using integer inputs and interpreting manually.

The algorithm is long division, which works for any divisor. For linear divisors, the steps are equivalent to synthetic division.

Visit Khan Academy, Wolfram MathWorld, or the textbook "College Algebra" by James Stewart.

Built on algebraic foundations – This tool follows the Euclidean algorithm for polynomials, referenced from standard textbooks (Dummit & Foote, "Abstract Algebra"). The implementation has been tested against numerous examples. Reviewed by the GetZenQuery mathematics team, last updated March 2025.

References: MathWorld Polynomial Division; Al‑Samaw'al, "Al‑Bāhir" (12th century); Wikipedia: Polynomial long division.