What This Calculator Does
This tool adds or subtracts two polynomials in a single variable and returns the simplified result, with all like terms combined and the answer arranged in standard form (highest exponent first). It works for any whole-number exponents and positive, negative, integer or decimal coefficients.
How to Use It
Type your first polynomial using x as the variable and ^ for exponents, for example 3x^2 + 2x - 5. Choose whether you want to add or subtract, then enter the second polynomial such as x^2 - 4x + 7. Spaces and * signs are optional and are ignored. Implicit coefficients are understood, so x means 1x and -x^2 means -1x^2.
The Formula Explained
A polynomial is a sum of terms of the form coefficient times a power of x. To add or subtract two polynomials you only combine like terms — terms that share the same exponent. For each exponent i you compute \((a_i \pm b_i)x^i\), where \(a_i\) and \(b_i\) are the matching coefficients from the two polynomials. Terms whose combined coefficient is zero disappear from the answer.
$$\left(\sum a_i x^i\right) \pm \left(\sum b_i x^i\right) = \sum (a_i \pm b_i)\, x^i$$
Worked Example
Add \((3x^2 + 2x - 5) + (x^2 - 4x + 7)\). Group by power: \(x^2\) gives \(3 + 1 = 4\), \(x\) gives \(2 + (-4) = -2\), and the constants give \(-5 + 7 = 2\). The result is \(4x^2 - 2x + 2\). If you subtract instead, you negate the second polynomial first:
$$(3x^2 + 2x - 5) - (x^2 - 4x + 7) = 2x^2 + 6x - 12$$
Key Terms Defined
- Polynomial
- An expression built from variables and constants using only addition, subtraction, and multiplication, with whole-number exponents on the variables — for example \(3x^2 + 2x - 5\).
- Term
- A single piece of a polynomial separated by \(+\) or \(-\) signs. In \(3x^2 + 2x - 5\) the terms are \(3x^2\), \(2x\), and \(-5\).
- Coefficient
- The numerical factor multiplying the variable part of a term. In \(3x^2\) the coefficient is \(3\).
- Exponent (power)
- The whole number indicating how many times the variable is multiplied by itself. In \(x^2\) the exponent is \(2\).
- Like terms
- Terms with the same variable raised to the same exponent, such as \(5x^2\) and \(-2x^2\). Only like terms can be combined when adding or subtracting.
- Constant term
- A term with no variable, equivalently the term with exponent \(0\) (since \(x^0 = 1\)). In \(3x^2 + 2x - 5\) the constant term is \(-5\).
- Degree
- The highest exponent that appears in the polynomial. The degree of \(3x^2 + 2x - 5\) is \(2\).
- Leading coefficient
- The coefficient of the term with the highest exponent. For \(3x^2 + 2x - 5\) it is \(3\).
- Standard form
- A polynomial written with its terms ordered from the highest exponent to the lowest, ending with the constant term — the conventional way to present the simplified result.
FAQ
Can I use a variable other than x? Use x for the variable; other letters are not parsed.
What if a term cancels out? If the combined coefficient is zero, that term is dropped. If every term cancels, the result is simply 0.
Are decimal coefficients allowed? Yes — coefficients such as 1.5x^2 are supported and combined exactly.