Sub topic 9
Simplifying with parentheses
What this chapter assumes
You should already be comfortable with these ideas from earlier chapters:
- Terms, coefficients, and constants.
- Like terms and how to combine them.
- The distributive property,
a(b + c) = ab + ac. - Arithmetic with negative numbers.
This chapter puts those pieces together. The goal is to take an expression with parentheses and rewrite it as a short list of combined terms.
Why parentheses block simplification
Parentheses group several terms into one unit. In 4(x + 2), the factor 4 applies to the whole group. You cannot combine 4 with x or with 2 while they are inside or outside the group in this form.
The usual way to simplify is to remove the parentheses first. Then you combine like terms. The distributive property is what makes removing them valid.
The procedure has two stages:
- Distribute every factor (including a minus sign) over its group.
- Combine like terms in the result.
Distributing a positive factor
Multiply the factor by every term inside the group, not only the first one.
Simplify 2(x + 3) + 3x:
- Distribute:
2(x + 3) = 2x + 6. - Rewrite:
2x + 6 + 3x. - Combine like terms:
2x + 3x = 5x, so the result is5x + 6.
SymPy agrees:
from sympy import symbols, expand
x = symbols('x')
print(expand(2*(x + 3) + 3*x)) # 5*x + 6The factor can also sit on the right: (x + 3)2 means the same thing as 2(x + 3). Multiplication is commutative, so the position of the factor does not change the result.
Distributing a negative sign
Most errors in this topic come from a minus sign in front of a group. A minus sign in front of parentheses means "multiply by -1". Every term inside changes sign.
| Expression | Distribute | Result |
|---|---|---|
| `+(b + c)` | multiply by +1 | `b + c` |
| `-(b + c)` | multiply by -1 | `-b - c` |
| `-(b - c)` | multiply by -1 | `-b + c` |
| `-3(b - c)` | multiply by -3 | `-3b + 3c` |
The second row is a common trap: the minus sign must reach c as well as b.
Simplify 5 - (x + 2):
- The group is multiplied by -1:
-(x + 2) = -x - 2. - Rewrite:
5 - x - 2. - Combine the constants:
5 - 2 = 3, so the result is3 - x.
from sympy import symbols, expand
x = symbols('x')
print(expand(5 - (x + 2))) # 3 - xSubtracting a group whose first term is negative
Consider -(2x - 5) + 3x.
- Multiply each term inside by -1:
-(2x) = -2xand-(-5) = +5. - Rewrite:
-2x + 5 + 3x. - Combine:
-2x + 3x = x, so the result isx + 5.
When you subtract a negative term, the signs cancel and you add. That is why -(-5) becomes +5.
from sympy import symbols, expand
x = symbols('x')
print(expand(-(2*x - 5) + 3*x)) # x + 5Several groups in one expression
When an expression has more than one group, distribute each group separately. Then combine everything at the end.
Simplify 4(x + 2) - 3(x - 1):
- First group:
4(x + 2) = 4x + 8. - Second group:
-3(x - 1) = -3x + 3. The second sign flips because-3 × -1 = +3. - Rewrite:
4x + 8 - 3x + 3. - Combine the x terms:
4x - 3x = x. - Combine the constants:
8 + 3 = 11. - Result:
x + 11.
A good habit is to write the distributed form on its own line before combining. Doing both steps in your head is where signs get lost.
from sympy import symbols, expand
x = symbols('x')
original = 4*(x + 2) - 3*(x - 1)
simplified = x + 11
print(expand(original)) # x + 11
print(original.subs(x, 5), simplified.subs(x, 5)) # 16 16Expressions with more than one variable
The same steps apply when there are several variables. Only like terms combine: the a terms with each other and the b terms with each other.
Simplify 2(a + 3b) - (a - b):
- Distribute 2:
2a + 6b. - Distribute -1:
-a + b. - Rewrite:
2a + 6b - a + b. - Combine:
2a - a = aand6b + b = 7b. - Result:
a + 7b.
from sympy import symbols, expand
a, b = symbols('a b')
print(expand(2*(a + 3*b) - (a - b))) # a + 7*bA term with no visible coefficient, like -a or b, has a coefficient of -1 or 1. Writing those coefficients out (-1a, 1b) while you work can prevent a dropped term.
Nested parentheses
Sometimes one group sits inside another. Work from the innermost group outward. This keeps each step small and each sign visible.
Simplify 3(2(x + 1) - (x - 4)):
- Innermost groups first:
2(x + 1) = 2x + 2and-(x - 4) = -x + 4. - The expression becomes
3(2x + 2 - x + 4). - Combine inside the outer group:
2x - x = xand2 + 4 = 6, giving3(x + 6). - Distribute the 3:
3x + 18.
You could also distribute the outer 3 first, but that creates more terms and more chances for a sign error. Simplifying inside the group first is usually shorter.
from sympy import symbols, expand
x = symbols('x')
original = 3*(2*(x + 1) - (x - 4))
print(expand(original)) # 3*x + 18
print(original.subs(x, 2), (3*x + 18).subs(x, 2)) # 24 24A group divided by a number
Division by a number is multiplication by its reciprocal, so it distributes the same way: (6x + 9)/3 = 6x/3 + 9/3 = 2x + 3.
This works only when the division applies to the entire numerator. The expression (6x + 9)/3 can be split term by term. A denominator that contains a sum, such as 6/(x + 3), cannot be split like this. Distribution applies to multiplication over a sum, not to division by a sum.
from sympy import symbols, expand
x = symbols('x')
print(expand((6*x + 9)/3)) # 2*x + 3Common errors and how to catch them
| Mistake | Wrong result | Correct result |
|---|---|---|
| Distributing to only the first term | `3(x + 4) = 3x + 4` | `3x + 12` |
| Not flipping every sign after a minus | `5 - (x + 2) = 5 - x + 2` | `3 - x` |
| Mishandling a double negative | `-(−5) = -5` | `+5` |
| Combining unlike terms | `2x + 6 = 8x` | `2x + 6` stays as is |
| Splitting division by a sum | `6/(x + 3) = 6/x + 6/3` | cannot be split |
The substitution check from the previous chapter catches most of these. Pick a value for the variable, evaluate the original and your answer, and compare. Here is the first mistake in the table, caught at x = 1:
from sympy import symbols
x = symbols('x')
original = 3*(x + 4)
wrong = 3*x + 4
right = 3*x + 12
print(original.subs(x, 1), wrong.subs(x, 1), right.subs(x, 1)) # 15 7 15The wrong answer gives 7 while the original gives 15, so the answer is rejected immediately.
Putting it together
When you meet an expression with parentheses, follow this order:
- Locate the innermost group.
- Multiply the factor in front of it, sign included, by every term inside.
- Repeat until no parentheses remain.
- Group like terms, keeping each term's sign attached to it.
- Combine coefficients.
- Check with one or two substitutions.
Each step is small, and each one uses only the distributive property or combining like terms.
Exercise
Simplify 7 - 2(x - 4) + 3x.
Show answer
Distribute -2: -2(x - 4) = -2x + 8. The expression becomes 7 - 2x + 8 + 3x. Combine the constants, 7 + 8 = 15, and the x terms, -2x + 3x = x. The result is x + 15.
Exercise
A student writes -(3y - 2) + 4y = -3y - 2 + 4y = y - 2. Find the error and give the correct answer.
Show answer
The minus sign was applied to 3y but not to -2. The term -(-2) is +2, so the expression is -3y + 2 + 4y, which simplifies to y + 2. Check at y = 1: the original is -(3 - 2) + 4 = 3, and y + 2 = 3, while y - 2 = -1.
Exercise
Simplify 2[3(x + 1) - (x - 5)] and check your answer at x = 2.
Show answer
Inside the brackets, 3(x + 1) = 3x + 3 and -(x - 5) = -x + 5, so the bracket is 3x + 3 - x + 5 = 2x + 8. Multiplying by 2 gives 4x + 16. At x = 2, the original is 2[9 - (-3)] = 2 × 12 = 24, and 4(2) + 16 = 24.
Exercise
Simplify 5(a - 2b) - 3(2a - b).
Show answer
Distribute: 5a - 10b - 6a + 3b. Combine the a terms: 5a - 6a = -a. Combine the b terms: -10b + 3b = -7b. The result is -a - 7b.