Sub topic 8
Collecting Variables When They Appear on Both Sides
Assume you know how to simplify expressions, use inverse operations, and solve two-step equations. In this chapter, you will solve linear equations where the variable appears on both sides of the equals sign.
Move Variable Terms to One Side
An equation stays equivalent when you perform the same operation on both sides. To collect variable terms, use addition or subtraction to move all variable terms to one side.
Consider:
5x - 4 = 2x + 8Subtract 2x from both sides:
5x - 2x - 4 = 2x - 2x + 8
3x - 4 = 8Then add 4 to both sides:
3x = 12Finally, divide both sides by 3:
x = 4The variable terms are now collected on the left, while the constant terms are on the right.
A Repeatable Method
Use these steps:
- Simplify each side. Distribute parentheses and combine like terms.
- Move all variable terms to one side by adding or subtracting a variable term.
- Move all constant terms to the other side.
- Divide by the coefficient of the variable.
- Check the answer in the original equation.
The coefficient is the number multiplied by the variable. In 3x, the coefficient is 3.
Example with a Negative Coefficient
Solve:
3x + 7 = 5x - 9Subtract 3x from both sides:
7 = 2x - 9Add 9 to both sides:
16 = 2xDivide by 2:
x = 8Check:
3(8) + 7 = 31
5(8) - 9 = 31Both sides equal 31, so x = 8 is correct.
Simplify Before Collecting
Parentheses may hide variable terms. Distribute first.
Solve:
3(x - 2) + 4 = 2x + 5Distribute 3:
3x - 6 + 4 = 2x + 5Combine like terms:
3x - 2 = 2x + 5Now collect variables:
x - 2 = 5
x = 7Substitution confirms the result:
3(7 - 2) + 4 = 19
2(7) + 5 = 19Common Errors
- Changing the sign incorrectly when subtracting a term.
- Distributing to only one term inside parentheses.
- Combining unlike terms, such as
3x + 4into7x. - Checking a simplified equation instead of the original equation.
- Dividing by a coefficient before simplifying all terms.
A useful habit is to write every operation on both sides. This makes sign changes easier to track.
Practice with Python
This function uses the same collection method for equations of the form a1x + b1 = a2x + b2.
from fractions import Fraction
def solve_both_sides(a1, b1, a2, b2):
"""Solve a1*x + b1 = a2*x + b2."""
coefficient = Fraction(a1) - Fraction(a2)
constant = Fraction(b2) - Fraction(b1)
if coefficient == 0:
return "infinitely many solutions" if constant == 0 else "no solution"
return constant / coefficient
x = solve_both_sides(5, -4, 2, 8)
print(x)
print(5 * x - 4 == 2 * x + 8)The function subtracts the right-side variable coefficient from the left-side coefficient. It then subtracts the left constant from the right constant and divides.
Exercise
Solve 4(x + 3) - 2x = 2x + 18, and check your answer.
Show answer
Distribute and combine: 4x + 12 - 2x = 2x + 18, so 2x + 12 = 2x + 18. Subtracting 2x gives 12 = 18, which is false. Therefore, the equation has no solution.