Variables and Expressions
Learning goals
- Use a letter for a number that is unknown or free to change
- Tell an expression from an equation, and say what you do to each
- Translate a phrase into algebra, minding the reversal in less than
- Name the terms, coefficient and constant of an expression
- Evaluate by substituting each value in parentheses
What a variable is
A variable is a letter that stands for a number. The letter does not have a fixed value of its own; it is a placeholder, exactly the way a blank box would be. Writing
says “three times whatever number is.” If is , the phrase is worth ; if is , it is worth . The same letter can take different values on different occasions, which is precisely why it is called variable: its value can vary.
There are two everyday reasons to reach for a letter instead of a number.
The first is that the number is unknown. You may be trying to find it, the way you will in the next few lessons when you solve for . Until you pin it down, a letter holds its place so you can still write down everything you do know about it.
The second is that the number is changing, or you want a single statement to cover many cases at once. The cost of notebooks is for every possible ; you do not want to rewrite the rule for each separate purchase. One expression with a variable replaces an endless list of arithmetic examples.
Any letter will do, and the choice is up to you. People lean on and out of long habit. Even so, a letter that hints at its meaning often reads better: for time, for distance, for a count of things. The letter is just a name; what matters is that you state clearly what it stands for.
Expressions versus equations
These two words name different things, and keeping them apart will save you constant confusion later.
An algebraic expression is a combination of numbers, variables, and operations (, , , , exponents). Such a combination stands for a single value once you know the variables. It is a phrase, the algebraic version of a number. Each of these is an expression:
An expression has no equals sign. On its own it makes no claim; it simply names an amount, the way names an amount before you work it out.
An equation is two expressions joined by an equals sign, stating that they have the same value. It is a complete sentence, and like any sentence it can be true or false. Each of these is an equation:
The difference is exactly the difference between a phrase and a sentence. “Three more than ” is a phrase; it points at a quantity but asserts nothing. “Three more than equals nine” is a sentence; it makes a claim you could check. You evaluate an expression (work out its value), but you solve an equation (find the variable value that makes the sentence true). Solving is the work of the coming lessons; this lesson is about reading and evaluating expressions.
Check your understanding
Which of these is an equation (not just an expression)?
An equation must contain an equals sign joining two expressions; an expression alone has none.
The other three are expressions: they name a value but assert nothing, because no equals sign is present.
Translating words into expressions
Most of the time a problem arrives in words, and the first real skill of algebra is turning those words into an expression. The reliable method is to name the unknown with a letter, then replace each piece of the sentence with its arithmetic operation. A small vocabulary covers almost everything:
| Words | Operation | Example phrase | Expression |
|---|---|---|---|
| sum, more than, increased by, total | seven more than | ||
| difference, less than, decreased by, fewer | five less than | ||
| product, times, of, twice, double | three times | ||
| quotient, divided by, per, split | divided by |
Two of these phrases hide a trap worth pausing on. “Five less than ” is , not . The phrase tells you to start with and take five away, so the comes first even though is spoken first. The same flip happens with “fewer than” and “subtracted from.” Read these by their meaning, not by the left-to-right order of the words.
When several operations combine, build the expression one phrase at a time, and use parentheses whenever a whole group must be operated on together.
Worked example 1 Translate three phrases into expressions
Name the unknown number in each, then convert phrase by phrase.
“Eight more than twice a number.” Twice the number is , and eight more than that adds :
“The product of and a number, decreased by .” The product of and the number is , and decreased by subtracts :
“A number divided by , then increased by .” Dividing by gives , and increasing by adds :
In each case the unknown is held by the letter , and every word maps to one operation.
The trickiest translations are the ones where a sum or difference must be operated on as a whole. Here parentheses do the grouping, exactly as they did in the order-of-operations chapter.
Worked example 2 Translate 'twice the sum of a number and four'
The phrase has two layers. The inner phrase, “the sum of a number and four,” is . The outer word “twice” then doubles that entire sum, not just the .
To double the whole sum, wrap it in parentheses before multiplying:
Without the parentheses, would double only the and leave the alone, a different expression. Compare the two by trying : the correct , but would give . The parentheses are what keep “twice the sum” honest.
Check your understanding
Which expression means "four less than a number "?
"Four less than " means start at and take four away, so comes first.
The order is the common trap: the words say four less than , not less than four.
The parts of an expression
To work with an expression you need names for its pieces. Consider
The expression is built from parts that are added or subtracted together; each such part is a term. This expression has three terms: , , and . Terms are the chunks separated by the and signs. By convention a term carries the sign written in front of it, so the subtracted piece is the term , not a bare .
Inside a term like , the number is the coefficient: the number multiplied by the variable. The coefficient of is . A variable written with no visible number, such as plain , has a coefficient of , because means , one copy of . Likewise means , so its coefficient is .
A term that is just a number, with no variable at all, is a constant. In the constant is . It is called constant because it never changes: whatever the variables do, that term contributes the same fixed amount.
Check your understanding
In the expression , what is the coefficient of the variable term?
The coefficient is the number multiplied by the variable. The variable term is , which means .
The is the constant term, not a coefficient.
Evaluating an expression by substitution
To evaluate an expression you replace each variable with a given number, then do the arithmetic. Replacing a letter with a number is called substitution, and it is the single most useful thing you can do with an expression. Substitution turns an algebraic phrase back into an ordinary calculation.
There is one habit that prevents nearly every mistake. When you substitute, put the number inside parentheses where the variable used to be. The parentheses keep the original operations intact, especially multiplication and signs, so nothing gets accidentally merged or dropped.
Why parentheses matter so much is easiest to see with a coefficient. In the variable is being multiplied by . If and you simply write the next to the , you get the meaningless "". Written with parentheses, the same substitution gives , which is what actually means.
Why the same expression gives different values for different inputs#
An expression containing a variable is not a single number; it is a rule that produces a number once the variable is chosen. The rule is fixed, but its output depends on the input.
Take . Substituting replaces the variable by throughout, giving . Substituting instead gives . The operations, multiply by two and add one, never changed; only the number fed in changed, so the result changed with it.
This is exactly the behaviour the word variable promises. Because the letter can be any number, the expression stands for a family of values at once, one for each choice of the variable. Substitution is how you pick out the single member of that family you currently want. The value you get depends on the input, so changing the input can change the output, as it did here from to . Getting a different answer when you change the input is a feature, not an error.
You can carry out a substitution by hand below instead of reading about one. The rectangle takes a width and a height , both yours to set, and reports two expressions in those two letters at once. Those two are the area, which is the value of , and the perimeter, which is the value of . Choosing the two numbers is the substitution; the readout is the evaluation.
Hold the width at and step the height up from to . The area runs , , , , , which is the single expression evaluated at : one rule, five inputs, five values. Then set the width to and the height to , work out and on paper, and compare. The figure will not do the substitution for you, but it will tell you whether yours was right.
One rule, many inputs, many values
A rectangle 4 units wide and 2 units tall. With w = 4 and h = 2, the expression w times h is 8. The expression 2(w + h) is 12.
Worked example 3 Evaluate when
Substitute for , writing it in parentheses so the multiplication stays clear:
Now follow the order of operations: multiply before you add.
So when , the expression is worth .
Worked example 4 Evaluate when and
Replace each variable by its value, every one in parentheses:
By the order of operations the exponent goes first, then the multiplication, then the subtraction. Square the :
Then subtract the value of :
So the expression equals . Notice the exponent applied only to the , the value of , because means is squared, not the whole term.
Substitution works just as smoothly when the value is negative, a fraction, or a decimal. The parentheses matter most in those cases, because they keep the whole value together, sign and all.
Worked example 5 Evaluate when
Substitute for , keeping it in parentheses so the sign travels with it:
Subtracting from moves four further down the number line, into the negatives:
So when , the expression is worth . Writing the input as rather than a bare is what keeps the leading minus sign from being misread.
Check your understanding
Evaluate when .
Substitute for , in parentheses, then multiply before subtracting.
The multiplication comes before the subtraction, so the value is , not .