Sub topic 12
Checking that two expressions are equivalent
This chapter assumes you can substitute numbers into an expression, combine like terms, and use the distributive property. It covers how to test whether a simplified expression still means the same thing as the original, and how to tell a real check from a lucky one.
What "equivalent" means
Two algebraic expressions are equivalent if they give the same value for every allowed choice of the variables. The expressions 3x + 2y + 5x - y and 8x + y look different, but they are equivalent. Whatever numbers you put in for x and y, both produce the same result.
Equivalence is a different claim from an equation. An equation such as 2x = 10 is true only for some values (here x = 5). Equivalence says two expressions agree for all values. When you simplify, you want the result to be equivalent to the original. Otherwise you have changed the problem.
You can check this in two ways:
- Numerically, by substituting values into both expressions and comparing. This is fast, and it can disprove equivalence for certain.
- Algebraically, by rewriting one expression until it matches the other. This is slower, and it can prove equivalence.
The rest of the chapter explains what each method can and cannot tell you.
Checking by substitution
Pick values for the variables, evaluate both expressions with the same values, and compare the results. Use the original, unsimplified expression on one side and your answer on the other.
For 3x + 2y + 5x - y and 8x + y, try x = 2 and y = 1:
- Original:
3(2) + 2(1) + 5(2) - 1 = 6 + 2 + 10 - 1 = 17. - Simplified:
8(2) + 1 = 17.
The values match, so this test passes. Now try a second pair, x = -3 and y = 4:
- Original:
3(-3) + 2(4) + 5(-3) - 4 = -9 + 8 - 15 - 4 = -20. - Simplified:
8(-3) + 4 = -24 + 4 = -20.
They match again. Each passing test makes you more confident, but it does not prove anything yet. The next section explains why.
One match is not proof
A mismatch is conclusive. If the two expressions give different values for even one choice of variables, they are not equivalent, and that choice is a counterexample. A match is weaker evidence, because unequal expressions can agree at particular values.
Compare 2x and x^2. They are not equivalent, but they agree at some inputs:
| x | 2x | x^2 | Agree? |
|---|---|---|---|
| 0 | 0 | 0 | yes |
| 1 | 2 | 1 | no |
| 2 | 4 | 4 | yes |
| 3 | 6 | 9 | no |
A learner who tested only x = 2 would wrongly conclude that 2x and x^2 are the same. One failing row, such as x = 1, settles the question.
The same trap appears with a dropped sign. Suppose you simplify 3x + 2y + 5x - y and write 8x + 3y, because you treated - y as + y... or ignored it. If you test with y = 0, both expressions give 8x, and the error stays hidden.
Choosing good test values
Some values hide mistakes. Prefer values that make each term contribute something different:
- Avoid 0. Multiplying by 0 erases terms, so errors in those terms disappear.
- Avoid 1. Every power of 1 equals 1, so
x,x^2, andx^3look identical, and coefficients are never scaled. - Use different values for different variables. If
x = y = 2, thenx + yand2xagree even though they are different expressions. - Include a negative value. Sign errors are among the most common mistakes, and negatives expose them.
- Keep the numbers small. You want to check the result by hand without making new arithmetic errors.
Values such as x = 2, y = 5 or x = -3, y = 4 work well for most checks. If an expression contains division, also avoid values that make a denominator zero, because the expression has no value there.
How many tests are enough?
For expressions in one variable built from sums of terms like 3x, x^2, and constants, there is a precise answer. An expression is a polynomial, and its degree is its highest exponent. If two such expressions have degree at most n and agree at n + 1 different values of the variable, they are equivalent.
This works because the difference of the two expressions has degree at most n. A non-zero polynomial of degree at most n can equal zero at no more than n values. If the difference is zero at n + 1 values, it must be zero everywhere.
For example, 2x and x^2 have degree at most 2, so three different matching values would be needed to prove equivalence. They match only at x = 0 and x = 2, which is two values, so the test fails to prove it, correctly.
With several variables the count is less simple, and a handful of tests no longer proves equivalence. In practice, test three or four varied points, then confirm algebraically if the result matters.
Checking by algebra
The algebraic route proves equivalence. There are two standard ways.
Reduce both sides to the same form. Simplify each expression fully, then compare term by term. To check 2(x + 3) + 3x against 5x + 6:
- Distribute:
2x + 6 + 3x. - Combine like terms:
5x + 6.
The left side now matches the right side exactly, so they are equivalent.
Subtract and look for zero. If A and B are equivalent, then A - B simplifies to 0. This is useful when the two forms are hard to compare directly. For 8x + 3y compared with 3x + 2y + 5x - y:
- Write the difference:
(3x + 2y + 5x - y) - (8x + 3y). - Distribute the minus sign:
3x + 2y + 5x - y - 8x - 3y. - Combine like terms:
(3 + 5 - 8)x + (2 - 1 - 3)y = -2y.
The result is -2y, not 0. The expressions are not equivalent, and the leftover -2y tells you where the error is.
Checking with code
SymPy can do the algebraic check for you. Its expand function distributes and combines like terms, and a difference that expands to 0 means the expressions are equivalent.
from sympy import symbols, expand
x, y = symbols('x y')
original = 3*x + 2*y + 5*x - y
simplified = 8*x + y
wrong = 8*x + 3*y
print(expand(original - simplified)) # 0
print(expand(original - wrong)) # -2*yA difference of 0 confirms equivalence, and the -2*y result for the wrong answer shows exactly what is missing.
SymPy has a gotcha for substitution checks. It combines like terms automatically when it builds an expression, so 3*x + 2*y + 5*x - y is stored as 8*x + y the moment you create it. Substituting into that object tests the simplified form against itself, which proves nothing. To test your own unsimplified expression, write it as a plain Python function:
original = lambda x, y: 3*x + 2*y + 5*x - y
good = lambda x, y: 8*x + y
bad = lambda x, y: 8*x + 3*y
points = [(2, 1), (-3, 4), (5, -2)]
for name, candidate in [("good", good), ("bad", bad)]:
same = all(original(x, y) == candidate(x, y) for x, y in points)
print(name, same)
# A weak test point hides the error in "bad":
print(original(3, 0) == bad(3, 0)) # True, because y = 0 erases the faulty termThe output is good True, bad False, and then True for the weak point. The last line shows the point from earlier: with y = 0, the faulty 3y term contributes nothing, so the mistake goes unnoticed.
Worked example with parentheses
Parentheses are a frequent source of errors, so check them carefully. A learner simplifies 2(x + 3) + 3x and writes 5x + 3, forgetting to multiply the 3 by 2.
Test with x = 0:
- Original:
2(0 + 3) + 0 = 6. - Candidate
5x + 3:3.
The values differ, so 5x + 3 is wrong. Now test the correct answer 5x + 6 at x = 0: it gives 6, which matches. At x = 2, the original is 2(5) + 6 = 16 and 5(2) + 6 = 16, so they match again. Degree 1 needs two matching values to prove equivalence, and the algebraic work above confirms it.
Notice that x = 0 caught this error because the mistake was in the constant term. It would not have caught a mistake in the coefficient of x. This is why you vary the values.
Summary of the two approaches
| Method | Can prove equivalence? | Can prove non-equivalence? | Main risk |
|---|---|---|---|
| One substitution test | No | Yes, if values differ | A lucky match hides an error |
| Several varied tests | Only in limited cases (one variable, enough points) | Yes | Poor choices such as 0 and 1 |
| Algebraic simplification | Yes | Yes (leftover difference) | Making a new mistake while checking |
Use substitution to find errors quickly, and use algebra when you need certainty.
Exercise
A student simplifies 4x + 3y - x + 2y and gets 3x + y. Show with a substitution that the answer is wrong, then find the correct simplification.
Show answer
Use x = 2 and y = 1. The original gives 4(2) + 3(1) - 2 + 2(1) = 8 + 3 - 2 + 2 = 11. The student's answer gives 3(2) + 1 = 7. The values differ, so the answer is wrong. Combining correctly: x terms 4x - x = 3x, and y terms 3y + 2y = 5y. The correct result is 3x + 5y, which gives 6 + 5 = 11 at x = 2, y = 1.
Exercise
Explain why testing x = 1 is a poor way to check whether x^2 + x is equivalent to 2x.
Show answer
At x = 1, x^2 + x = 1 + 1 = 2 and 2x = 2, so the values match even though the expressions are not equivalent. Since 1 raised to any power is 1, x = 1 hides the difference between x^2 and x. A value such as x = 3 exposes it: x^2 + x = 12 while 2x = 6.
Exercise
Use the "subtract and look for zero" method to decide whether 3(x - 2) + 2x is equivalent to 5x - 6.
Show answer
Compute (3(x - 2) + 2x) - (5x - 6). Distribute: 3x - 6 + 2x - 5x + 6. Combine like terms: (3 + 2 - 5)x + (-6 + 6) = 0x + 0 = 0. The difference is 0, so the expressions are equivalent.