Sub topic 2
Evaluating an Expression and Combining Like Terms
This chapter assumes you can work with integers and fractions, including negative numbers, apply order of operations, and read exponents such as 3^2.
Evaluating an expression
To evaluate an expression, replace each variable with a number and compute the result using order of operations.
For 3x + 2y + 5x - y with x = 2 and y = 1:
3(2) + 2(1) + 5(2) - 1 = 6 + 2 + 10 - 1 = 17
x = 2
y = 1
print(3*x + 2*y + 5*x - y) # 17Recognizing like terms
Terms are the pieces separated by plus or minus signs. Like terms have the same variable part, including the same exponents. Their coefficients, the numbers in front, can differ.
- 3x and 5x are like terms.
- 2y and -y are like terms.
- 3x^2 and x are not like terms, because the exponents differ.
- 4xy and 4x are not like terms, because the variable parts differ.
The distributive property
The distributive property says a(b + c) = ab + ac. Multiplying the outside factor by each term inside the parentheses keeps the value the same.
The property also explains why combining works. Since 3x + 5x = (3 + 5)x, adding like terms means adding their coefficients.
Combining like terms step by step
- Distribute to remove any parentheses.
- Group the like terms.
- Add or subtract their coefficients.
- Write the simplified expression.
For 2(x + 3) + 3x, distribute to get 2x + 6 + 3x, group to get (2x + 3x) + 6, and combine to get 5x + 6.
x = 2
print(2*(x + 3) + 3*x) # 16
print(5*x + 6) # 16Both lines print 16, so the simplified form is equivalent.
Exercise
Simplify 4x + 3 - x + 7.
Show answer
3x + 10. Here 4x - x = 3x, and 3 + 7 = 10.