Sub topic 6
Subtracting Polynomials and Distributing the Negative
This chapter assumes you can add polynomials by combining like terms, work with negative integers, and apply the distributive property. Subtraction is addition with one extra step. That step is where most errors happen, so the chapter covers it in detail.
The core idea
Subtracting a polynomial means adding its opposite. The opposite of a polynomial is the polynomial with every coefficient's sign flipped. In symbols:
A − B = A + (−B)
The expression −B is the same as (−1)·B. The distributive property then multiplies −1 by every term inside B, not just the first one.
Here is a first example:
(5x² + 3x − 7) − (2x² − 4x + 1)
- Rewrite the subtraction as adding the opposite: (5x² + 3x − 7) + (−1)(2x² − 4x + 1).
- Distribute −1 across all three terms: −2x² + 4x − 1.
- Combine like terms:
- x² terms: 5x² − 2x² = 3x²
- x terms: 3x + 4x = 7x
- constants: −7 − 1 = −8
The result is 3x² + 7x − 8.
Two ways to organize the work
You can subtract in a horizontal layout (as above) or a vertical layout. Both give the same answer. Choose the one that helps you avoid sign errors.
Horizontal method
Write the whole expression on one line, distribute the negative, then group like terms. This works well for short polynomials.
(4x³ − x + 6) − (x³ + 2x² − 3x − 5)
After distributing: 4x³ − x + 6 − x³ − 2x² + 3x + 5
Group by degree:
- x³: 4x³ − x³ = 3x³
- x²: only −2x²
- x: −x + 3x = 2x
- constants: 6 + 5 = 11
Result: 3x³ − 2x² + 2x + 11.
Notice that the first polynomial has no x² term. Its x² coefficient is 0, so 0 − 2 = −2.
Vertical method
Line up like terms in columns, using 0 as a placeholder for missing terms. Then flip the signs of the bottom row and add each column.
| Term | x³ | x² | x | constant |
|---|---|---|---|---|
| First polynomial | 4 | 0 | −1 | 6 |
| Second polynomial | 1 | 2 | −3 | −5 |
| Opposite of second | −1 | −2 | 3 | 5 |
| Sum (the answer) | 3 | −2 | 2 | 11 |
The table reads the same result off each column: 3x³ − 2x² + 2x + 11.
Why the sign flip is correct
You can see why distributing the negative works by checking a number. Take 10 − (3 + 2). The parentheses evaluate to 5, so the answer is 5. If you flipped only the first sign, you would compute 10 − 3 + 2 = 9, which is wrong. Flipping both signs gives 10 − 3 − 2 = 5, which is right.
Polynomials behave the same way, because each term is a number once you substitute a value for x. The rule is not special to algebra. It is the ordinary distributive property with a factor of −1.
Sign patterns to memorize
When you distribute the negative, each term follows one of these patterns:
| Original term in second polynomial | After distributing the negative |
|---|---|
| +3x | −3x |
| −3x | +3x |
| +7 | −7 |
| −7 | +7 |
| x² (coefficient 1) | −x² (coefficient −1) |
| −x² | +x² |
Subtracting a negative term adds it. That is the case students miss most often, so watch for it whenever the second polynomial has negative coefficients.
A longer worked example with two variables
The same rule applies when terms contain more than one variable. Like terms must have identical variable parts.
(3a²b + 2ab − 5b²) − (a²b − 4ab + b² − 2)
Distribute the negative: 3a²b + 2ab − 5b² − a²b + 4ab − b² + 2
Combine like terms:
- a²b: 3a²b − a²b = 2a²b
- ab: 2ab + 4ab = 6ab
- b²: −5b² − b² = −6b²
- constant: +2
Result: 2a²b + 6ab − 6b² + 2.
The constant 2 has no partner in the first polynomial, so it carries through unchanged. Terms with no match are not an error. They simply stay in the answer.
Subtracting more than two polynomials
When an expression has several subtractions, each negative sign applies only to the polynomial directly after it.
(x² + 5x) − (2x − 3) − (x² − 1)
Distribute each negative separately:
x² + 5x − 2x + 3 − x² + 1
Combine:
- x²: x² − x² = 0
- x: 5x − 2x = 3x
- constants: 3 + 1 = 4
Result: 3x + 4. The x² terms cancel, so the result has a lower degree than the inputs. This happens whenever the leading terms of the two polynomials are equal. When you predict a degree before computing, remember that subtraction can reduce it.
Edge cases
- Result of zero. Subtracting a polynomial from itself gives 0. For example, (x² + 2x) − (x² + 2x) = 0. The zero polynomial has no terms, and its degree is usually left undefined.
- Missing terms. Treat a missing power as having coefficient 0. This matters most in the vertical method.
- Subtraction is not commutative. A − B is the opposite of B − A. Swapping the order flips every sign in the answer.
- Parentheses around the first polynomial. They do not change the result. Only the parentheses after the minus sign require distribution.
Checking by substitution
You can verify a subtraction by evaluating both sides at the same value of x. Choose a simple value such as x = 2, and avoid 0 or 1 because they hide errors in some terms.
For the first example, (5x² + 3x − 7) − (2x² − 4x + 1) = 3x² + 7x − 8:
- Left side at x = 2: (20 + 6 − 7) − (8 − 8 + 1) = 19 − 1 = 18
- Right side at x = 2: 12 + 14 − 8 = 18
Both sides equal 18, so the answer passes. A match does not prove the answer is right, because a wrong answer can agree at one value by chance. A mismatch does prove an error.
Subtraction in code
Using the coefficient-list representation, where the list [1, 2, 3] means 1 + 2x + 3x², subtraction negates every coefficient of the second list and then adds. This code mirrors the hand method exactly.
def add(p, q):
# Coefficients are listed from the constant term upward.
n = max(len(p), len(q))
p = p + [0] * (n - len(p))
q = q + [0] * (n - len(q))
return [a + b for a, b in zip(p, q)]
def subtract(p, q):
# Distribute the negative: flip every coefficient of q, then add.
return add(p, [-c for c in q])
p = [-7, 3, 5] # 5x^2 + 3x - 7
q = [1, -4, 2] # 2x^2 - 4x + 1
print(subtract(p, q)) # [-8, 7, 3] -> 3x^2 + 7x - 8The list comprehension [-c for c in q] is the distribution step. A bug that negates only q[0] would reproduce the first-term-only mistake from the warning above. The padding with zeros inside add is the code version of the placeholder zeros in the vertical method.
Common errors
| Error | Example | Fix |
|---|---|---|
| Flip only the first sign | (x² + 2x) − (x² + 3x) written as x² + 2x − x² + 3x | Flip every term: x² + 2x − x² − 3x |
| Treat a minus as a plain sign | (x + 1) − (−x + 2) written as x + 1 − x − 2 | Subtracting a negative adds it: x + 1 + x − 2 |
| Combine unlike terms | 3x² − x written as 2x | x² and x are different powers, so leave them separate |
| Drop a zero coefficient | Missing x² treated as absent in the vertical layout | Insert 0 as a placeholder |
| Reverse the order | Computing B − A | Keep A − B, with A first |
Summary of the method
- Write the problem so each polynomial sits in its own parentheses.
- Replace the subtraction with addition of the opposite.
- Distribute −1 to every term in the second polynomial.
- Group like terms and add their coefficients.
- Write the answer in standard form, highest degree first.
- Check with one substitution if the stakes are high.
Exercise
Subtract (6x³ − 2x² + x − 9) − (4x³ + x² − 5x − 3). Then check your answer at x = 2.
Show answer
Distribute the negative: 6x³ − 2x² + x − 9 − 4x³ − x² + 5x + 3. Combine like terms: x³: 6 − 4 = 2; x²: −2 − 1 = −3; x: 1 + 5 = 6; constants: −9 + 3 = −6. The result is 2x³ − 3x² + 6x − 6. Check at x = 2: the left side is (48 − 8 + 2 − 9) − (32 + 4 − 10 − 3) = 33 − 23 = 10. The right side is 16 − 12 + 12 − 6 = 10. The values match.
Exercise
Subtract (x² + 4x) − (x² − 3x + 2). What is the degree of the result, and why is it lower than the degree of either input?
Show answer
Distribute the negative: x² + 4x − x² + 3x − 2. The x² terms cancel, leaving 7x − 2. The degree is 1. Both inputs have degree 2, but their leading terms are equal, so subtraction removes them.
Exercise
In the call subtract([2, 0, 3], [1, 5]), what list is returned and what polynomial does it represent?
Show answer
The second list is padded to [1, 5, 0] and negated to [−1, −5, 0]. Adding gives [1, −5, 3], which represents 3x² − 5x + 1.