Variables and expressions in algebra explained
Learn what variables and algebraic expressions are, how to write and simplify them, common beginner errors, and textbook examples in clear steps.
What are variables and expressions?
A variable is a symbol, usually a single letter, that stands for an unknown number. An expression is a combination of numbers, variables, and the basic arithmetic operations (+, –, ×, ÷). The expression produces a value when the variables are replaced by actual numbers. For example, 3x + 5 is an expression that contains the variable x. Until a number is given for x, the expression has no single numeric value.
How variables and expressions work
- Pick a variable – Choose a letter that is not already used for another quantity in the problem. Common choices are x, y, or n.
- Translate the words – Turn the wording of a problem into numbers, variables, and operations. Use parentheses to show the intended order when needed.
- Evaluate – Substitute a specific number for each variable and carry out the arithmetic.
- Simplify – Combine like terms (terms that have the same variable raised to the same power) and reduce fractions if possible.
Building an expression from a word problem
Problem: A garden has a rectangular flower bed that is 2 meters longer than it is wide. If the width is represented by w, write an expression for the perimeter.
Step 1 – Choose a variable: The width is w meters.
Step 2 – Write the length: Length = width + 2 = w + 2.
Step 3 – Write the perimeter formula: Perimeter = 2 × (length + width).
Step 4 – Substitute: P = 2 × [(w + 2) + w] = 2 × (2w + 2) = 4w + 4.
The expression 4w + 4 gives the perimeter for any width w.
Worked example with evaluation
Problem: A school sells notebooks for $2 each and pens for $1 each. A student buys n notebooks and 3 pens. Write an expression for the total cost and find the cost when n = 4.
Write the expression: Cost of notebooks = 2 × n, cost of pens = 1 × 3 = 3. Total cost C = 2n + 3.
Evaluate for n = 4: Replace n with 4.
C = 2·4 + 3 = 8 + 3 = 11.
The student pays $11.
Common beginner mistakes
| Mistake | Why it hurts |
|---|---|
| Mixing variables and constants | Treating a variable as a fixed number creates an incorrect expression. In the notebook problem, writing 2 + n + 3 ignores the multiplication of price by quantity. |
| Forgetting parentheses | The order of operations changes the result. 2n + 3 is not the same as 2(n + 3), which would give 2n + 6. |
| Adding unlike terms | Only terms with the same variable and exponent can be combined. 3x + 5y cannot become 8xy. |
| Wrong substitution | Replace the variable everywhere it appears, and apply powers correctly. If the expression contains x² and you set x = 2, you must compute 2² = 4, not just write 2. |
Simplifying and combining like terms
When an expression contains several terms, group those that share the same variable part. Example:
Expression: 7a + 3b – 4a + 2b + 5.
Group like terms: (7a – 4a) + (3b + 2b) + 5.
Combine: 3a + 5b + 5.
Notice the constant 5 stays separate because it has no variable.
Another example with powers
Expression: 2x² + 5x – 3x² + 4.
Group the x² terms: (2x² – 3x²) + 5x + 4 = -x² + 5x + 4.
Understanding this step is essential before solving equations or factoring.
Where variables and expressions appear in textbooks
- Linear equations – Problems such as 5x – 7 = 18 start with the expression 5x – 7. Forming the expression correctly is the first hurdle before isolating x.
- Area and perimeter formulas – The area of a rectangle is A = ℓ × w. If the length is ℓ = 2x and the width is w = x + 3, the expression becomes A = (2x)(x + 3), which simplifies to 2x² + 6x. This type of substitution and simplification recurs throughout geometry sections.
Both examples are standard in high-school algebra textbooks and rely on the same ideas of variables representing unknown quantities and expressions representing relationships.
Practice tips
- Read the problem twice – Identify every quantity that changes; those become variables.
- Write a rough draft – Jot down the numbers and symbols before polishing the expression.
- Check units – If the problem involves meters, dollars, or seconds, make sure each term uses the same unit before combining.
- Test with simple numbers – Substitute a small integer for the variable to see if the expression behaves as expected.
Check yourself
| Question | Answer |
|---|---|
| 1. Write an expression for the total distance traveled if a car moves v kilometers per hour for t hours. | d = vt |
| 2. Simplify 4a + 3b – 2a + 5b. | 2a + 8b |
| 3. If the expression 7y – 2 is evaluated at y = 3, what is the result? | 19 |
| 4. Combine like terms: 6x² – 3x + 2x² + 5x – 4. | 8x² + 2x – 4 |
| 5. A rectangle’s width is w and its length is w + 5. Write the expression for its perimeter. | P = 2(w + w + 5) = 4w + 10 |
Understanding variables and expressions is the foundation for every later topic in algebra, from solving equations to working with functions. Practice turning word problems into clear algebraic expressions, watch for the common pitfalls listed above, and you will find the rest of the subject much easier to navigate.
For a deeper, interactive experience, explore the Axiom course that walks through many more examples and offers guided practice.
- algebra
- variables
- expressions