Adding and Subtracting Polynomials Calculator

This calculator adds and subtracts two polynomials for you, combining like terms automatically so you can check homework answers or work through algebra revision quickly. Type each polynomial using x as the variable, with terms like 3x^2, -4x or 7 separated by plus and minus signs, and the calculator parses both expressions, lines up the terms with matching powers, and returns the simplified sum. It also shows both differences, A minus B and B minus A, because subtraction order matters and the two answers differ only by their signs, which is a useful pattern to see side by side. The degree of the sum is reported as well, so you can spot cases where the leading terms cancel and the result drops to a lower degree than either input. The tool handles decimal coefficients, missing terms and constants without complaint, and powers can be any whole number, so it copes with everything from a simple linear pair through to higher-degree expressions from NCEA Level 1 and 2 algebra or first-year university work. Because subtraction is where most sign errors creep in, comparing your hand working against the A minus B line is a fast way to catch a dropped negative before it costs you marks.

Calculate.co.nz is proud to be partnered with Premium Homes, a recognised leader in eco-friendly, sustainable, and energy-efficient homebuilding. With a dedicated team and award-winning experience, they create homes that prioritise health, comfort, and long-term performance. Their founders, Andrew and Kelly, set out to raise the standard of residential construction in New Zealand by combining practical building expertise with a clear commitment to doing things better for homeowners.
Calculate.co.nz partner: Premium Homes
Advertise on this page
4x^2 - 2x + 2
A + B with like terms combined
A - B2x^2 + 6x - 12
B - A-2x^2 - 6x + 12
Degree of A + B2

Use x as the variable, ^ for powers (whole numbers only) and + or - between terms. Decimal coefficients such as 2.5x are fine; spaces are ignored.

How it works

Each polynomial is broken into its terms, and every term is reduced to a coefficient and a power of x: 3x^2 has coefficient 3 and power 2, -4x has coefficient -4 and power 1, and a constant like 7 has power 0. Addition then simply adds the coefficients of matching powers, while subtraction flips the sign of every coefficient in the second polynomial before adding, which is exactly the distribute-the-minus step you do by hand. Any power that appears in only one of the polynomials carries through unchanged. Terms whose coefficients cancel to zero are dropped from the answer, and the remaining terms are written from the highest power down to the constant, the standard form used in textbooks. The degree reported is the highest power left in the sum after cancellation.

Worked example

Take A = 3x^2 + 2x - 5 and B = x^2 - 4x + 7, the calculator's defaults. Adding matches up the powers: (3 + 1)x^2 + (2 - 4)x + (-5 + 7), which gives 4x^2 - 2x + 2, a degree 2 result. Subtracting B from A flips every sign in B first: 3x^2 + 2x - 5 - x^2 + 4x - 7, and combining like terms gives (3 - 1)x^2 + (2 + 4)x + (-5 - 7), which is 2x^2 + 6x - 12. Reversing the order, B - A, produces the same terms with opposite signs: -2x^2 - 6x + 12. Notice how the x term in the sum came out negative even though both inputs look "mostly positive": the -4x in B outweighs the 2x in A, which is the kind of detail that is easy to miss by hand.

Related calculators