# How do I add or divide polynomials?

Adds, subtracts, multiplies and divides polynomials in exact fractions, and finds their real zeros.

- Page: https://www.acalculator.org/math/polynomial-calculator
- JSON spec: https://www.acalculator.org/math/polynomial-calculator.json
- Version: c0c4cb441a04

## Default answer

Example with the default inputs (Polynomial p 6x^3 + 11x^2 - 31x + 15, Operation p ÷ q, Polynomial q 3x - 2): The result is 2x^2 + 5x - 7.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| p | Polynomial p | A polynomial in one letter. |
| op | Operation | What to do with p and q. |
| q | Polynomial q | The second polynomial, in the same letter. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| result | Result | The sum, difference, product or quotient. |
| remainder | Remainder | What is left after division. |
| zeros | Real zeros | Exact fractions, or decimals marked ≈. |

## Method

Exact fractions throughout: terms are multiplied out and like terms added; division is polynomial long division.

## Assumptions

- Coefficients are exact fractions: 0.1 is 1/10.
- Zeros that are not fractions are decimals to 10 significant figures, marked ≈.

## Worked examples

1. p = 6x^3 + 11x^2 - 31x + 15, op = divide, q = 3x - 2 gives result = 2x^2 + 5x - 7, remainder = 1. Source: OpenStax College Algebra 2e, 5.4, Example 2. https://openstax.org/books/college-algebra-2e/pages/5-4-dividing-polynomials.
2. p = 2x + 1, op = multiply, q = 3x^2 - x + 4 gives result = 6x^3 + x^2 + 7x + 4. Source: OpenStax College Algebra 2e, 1.4, Example 4. https://openstax.org/books/college-algebra-2e/pages/1-4-polynomials.

## FAQ

### How do I divide polynomials?

Choose p ÷ q. The page does polynomial long division: it divides the leading term of p by the leading term of q, subtracts that multiple of q, and repeats until what is left has a lower degree than q. The result is the quotient, and what is left is the remainder, so p = q × quotient + remainder. For (6x³ + 11x² − 31x + 15) ÷ (3x − 2) the quotient is 2x² + 5x − 7 and the remainder is 1.

### How do I multiply polynomials?

Choose p × q. Every term of p is multiplied by every term of q and like terms are added: (2x + 1)(3x² − x + 4) = 6x³ − 2x² + 8x + 3x² − x + 4 = 6x³ + x² + 7x + 4.

### How are the zeros found?

The page finds the roots of p numerically and tries simple fractions next to each real one; a fraction counts only when dividing p by (x − fraction) leaves remainder exactly 0, so x = 10000001/10000000 means exactly that. After each fraction zero it divides it out and looks again, and the last zero of a linear factor is always a fraction. Real zeros that are not fractions, such as √2, show as decimals marked ≈, and only when the page can bound their error to 10 significant figures. The page also counts the distinct real zeros exactly (Sturm’s theorem) and answers only when it found that many. A repeated zero is listed once.

### Can I use fractions and decimals?

Yes. Coefficients are exact: 0.1 is 1/10 and x/3 is (1/3)x, and the answers use exact fractions such as 5x/6. A decimal such as 0.1 is never rounded along the way.

### Which polynomials can I type?

Any polynomial in one letter (x, t, or another letter except e) with whole-number powers, typed expanded or not: 2x^3 - 3x + 5, (x - 1)(x + 2)^2, x^2/4 + 1. p and q must use the same letter. Division by a letter, such as 1/x, is not a polynomial and gives a message.

### What is the degree of a polynomial?

The highest power of the letter with a nonzero coefficient. The degree of a product is the sum of the degrees; in a division the quotient has degree deg p − deg q, and the remainder has a lower degree than q.

## Sources

- OpenStax, College Algebra 2e, section 1.4 Polynomials: https://openstax.org/books/college-algebra-2e/pages/1-4-polynomials
- OpenStax, College Algebra 2e, section 5.4 Dividing Polynomials: https://openstax.org/books/college-algebra-2e/pages/5-4-dividing-polynomials
- OpenStax, College Algebra 2e, section 5.5 Zeros of Polynomial Functions: https://openstax.org/books/college-algebra-2e/pages/5-5-zeros-of-polynomial-functions
