Xerobit

Polynomial Calculator: Add, Multiply, Divide and Factor

Enter two polynomials to add, subtract, multiply or divide them, or enter one to factor it over the integers. This polynomial calculator handles integer coefficients up to degree 10 and runs entirely in your browser so nothing is uploaded.

Result

x^2 + 6x + 8

How to use the polynomial calculator

  1. Type your first polynomial in the top field using x as the variable and ^ for exponents, like 2x^2 + 3x - 1.
  2. Select the operation: add, subtract, multiply, divide or factor.
  3. If you chose anything other than factor, type the second polynomial.
  4. The result updates automatically as you type.

How polynomial arithmetic works

Addition and subtraction combine terms that share the same power of x. For example, adding 3x^2 + 2x + 1 and x^2 - 4x + 5 groups the squared terms, the linear terms and the constants separately: (3+1)x^2 + (2-4)x + (1+5), which gives 4x^2 - 2x + 6.

Multiplication distributes every term of the first polynomial across every term of the second, then collects like powers. Dividing uses long division: the leading term of the dividend is divided by the leading term of the divisor to build the quotient step by step until the remaining polynomial has a lower degree than the divisor.

Factoring over the integers

When you choose factor, this polynomial calculator searches for integer roots using the rational root theorem. Any rational root of a polynomial with integer coefficients must be a divisor of the constant term divided by a divisor of the leading coefficient. The tool tests each candidate; when one works, it divides the polynomial by the corresponding linear factor and repeats on the quotient.

For example, x^2 + 5x + 6 has constant 6 and leading coefficient 1, so candidates are ±1, ±2, ±3, ±6. Testing reveals that -2 and -3 are roots, giving (x + 2)(x + 3). If no integer roots exist, the original expression is returned unchanged.

Input format reference

The parser accepts standard algebraic notation. Here are the rules it follows:

You typeMeaning
xThe single variable (lowercase only)
x^3 or x**3x raised to the third power
2xCoefficient 2 times x (the asterisk is optional)
-x^2Negative one times x squared
5A constant term (degree zero)
x^2+xSpaces around + or - are optional

Fractional coefficients, decimals and multiple variables are not supported. Keep all coefficients as whole numbers.

Common mistakes to avoid

A frequent error is omitting the caret for exponents. Typing x2 is read as an unrecognized token rather than x^2. Always use ^ or **.

Another issue arises with implicit multiplication. While 2x works, writing 2x3 without an operator between x and 3 will fail. Write 2x^3 or 2*x^3 instead.

Finally, remember that factoring only works cleanly when the polynomial has integer roots. A polynomial like x^2 - 2 has irrational roots and will not be broken down further by this tool.

Worked examples

Each result below was produced by the same code the tool runs, so you can check your own numbers against them.

ExampleInputResult
Add two quadraticsFirst polynomial: 3x^2 + 2x + 1; Operation: add; Second polynomial: x^2 - 4x + 54x^2 - 2x + 6
Multiply binomialsFirst polynomial: x + 3; Operation: multiply; Second polynomial: x - 3x^2 - 9
Divide with remainderFirst polynomial: x^3 - 2x^2 - 5x + 6; Operation: divide; Second polynomial: x - 1x^2 - x - 6
Factor a quadraticFirst polynomial: x^2 + 5x + 6; Operation: factor(x + 2)(x + 3)

FAQ

What format should I use to type a polynomial?

Use lowercase x as the variable, ^ for exponents and integer coefficients. For example, type 3x^2 - 2x + 7. Spaces around operators are optional.

Can this polynomial calculator handle more than one variable?

No. It supports only single-variable polynomials in x. Expressions with y, z or other letters will produce an error.

Why did factoring return the original expression?

The factoring algorithm finds integer roots only. If the polynomial has no integer roots, such as x^2 + 1, it cannot be factored over the integers and is returned as-is.

Does polynomial division always give a clean answer?

Not always. When the dividend is not perfectly divisible by the divisor, the tool shows both the quotient and the remainder, just like long division with numbers.

Are decimal or fractional coefficients supported?

No. All coefficients must be integers. Decimal points and fractions will cause a parsing error.

Is my data sent to a server?

No. Every calculation happens locally in your browser. Nothing you type is uploaded anywhere.