Variables and Expressions

Watch the video explainer

Learning goals

  • Use a letter for a number that is unknown or free to change
  • Distinguish expressions from equations and describe what it means to evaluate or solve
  • Translate phrases into algebra using the correct order and parentheses
  • Identify terms, coefficients, and constants, including their signs
  • Evaluate by substituting each value in parentheses

What a variable is

A variable is a letter that stands for a number that is unknown or free to change. For example, nn can stand for an unknown number of notebooks in a bag. It can also stand for the number you choose to buy, which may change from one purchase to another.

For the notebooks that cost 33 dollars each, choosing n=10n = 10 gives a cost of 3×10=303 \times 10 = 30 dollars. The number of notebooks changes, but the calculation still follows the same rule: multiply the count by 33. So one expression works for any number of notebooks you choose.

Choose a letter and state what it means. A letter such as nn for a count or tt for time can help you remember. Within one calculation, every use of the same letter stands for the same number. If n=4n = 4, then n+nn + n means 4+44 + 4, not two different numbers.

In algebra, 3n3n is shorthand for 3×n3 \times n. Leaving out the multiplication sign keeps the expression compact and avoids confusing ×\times with the letter xx. Likewise, abab means a×ba \times b, and 2(x+4)2(x + 4) means 2×(x+4)2 \times (x + 4). Placing bare digits together is different: 3434 means thirty-four, while 3(4)3(4) means 3×43 \times 4.

Check your understanding

Let nn be the number of notebooks in one pack. Each pack has 44 notebooks. What does n+nn + n mean?

Answer choices

Expressions versus equations

The notation x+5x + 5 describes a number plus five. It is an expression: a number, a variable, or numbers and variables combined with operations. Other examples are 77, 3n3n, y4\frac{y}{4}, and 5x25x^2. An expression has no equals sign.

Writing x+5=9x + 5 = 9 makes a claim that two amounts are equal. This is an equation: two expressions joined by an equals sign. It is true when x=4x = 4, since 4+5=94 + 5 = 9. It is false when x=2x = 2, since 2+5=72 + 5 = 7, not 99.

You do something different with an expression and with an equation. To evaluate an expression, work out its value using given values for its variables. For x+5x + 5 with x=2x = 2, you calculate 2+5=72 + 5 = 7. To solve an equation, find the value or values that make it true. For x+5=9x + 5 = 9, that value is 44. Later lessons teach methods for solving equations.

Expression versus equationThe left panel shows the expression x + 5 labeled as a phrase. The right panel shows the equation x + 5 = 9 labeled as a sentence, formed by joining two expressions with an equals sign.Expression (a phrase)x + 5no equals sign:names a valueEquation (a sentence)x + 5 = 9has an equals sign:can be true or false
An expression names a value. An equation states that two expressions have equal values.

Check your understanding

Which statement correctly describes 2n+52n + 5 and 2n+5=112n + 5 = 11?

Answer choices

Translating words into expressions

To write “seven more than a number,” let xx stand for the number and add seven: x+7x + 7. Name the number first, then decide what operations the words describe. The words in the table are clues to the operation. Read the whole phrase to decide which quantity to start with; the order of the words may differ from the order of the calculation.

WordsOperationExample phraseExpression
sum, more than, increased by, total++seven more than xxx+7x + 7
difference, less than, decreased by, fewer−-five less than xxx−5x - 5
product, times, twice, double×\timesthree times xx3x3x
quotient, divided by, per, split÷\divxx divided by 44x4\dfrac{x}{4}

“Five less than ten” means 10−510 - 5. In the same way, “five less than xx” means x−5x - 5, not 5−x5 - x: start with xx and take five away. “Five fewer than xx” and “five subtracted from xx” also mean x−5x - 5.

Worked example 1 Translate three phrases into expressions

Let xx stand for the number in each phrase.

“Eight more than twice a number.” Twice the number is 2x2x, and eight more than that adds 88:

2x+8.2x + 8.

“The product of 55 and a number, decreased by 33.” The product of 55 and the number is 5x5x, and decreased by 33 subtracts 33:

5x−3.5x - 3.

“A number divided by 22, then increased by 11.” Dividing by 22 gives x2\dfrac{x}{2}, and increasing by 11 adds 11:

x2+1.\frac{x}{2} + 1.

Use parentheses when an operation applies to a whole sum or difference.

Worked example 2 Translate 'twice the sum of a number and four'

With the number 33, “twice the sum of three and four” means 2(3+4)=142(3 + 4) = 14. You add first, then double the whole sum.

With xx standing for the number, the sum is x+4x + 4. Keep it together with parentheses:

2(x+4).2(x + 4).

Without parentheses, 2x+42x + 4 doubles only xx, then adds 44. At x=3x = 3, it gives 2(3)+4=102(3) + 4 = 10, rather than 1414.

Check your understanding

Which expression means "four less than a number nn"?

Answer choices

The parts of an expression

In the expression below, two products are added and then seven is subtracted:

5x+3y−7.5x + 3y - 7.

Its terms are the parts added or subtracted at the main level: 5x5x, 3y3y, and −7-7. Subtracting 77 is the same as adding −7-7, so you can write 5x+3y+(−7)5x + 3y + (-7). Each term carries its sign, so the last term is −7-7, not 77.

A plus or minus inside parentheses does not split the surrounding expression into terms. For example, 2(x+4)−72(x + 4) - 7 has two terms as written: 2(x+4)2(x + 4) and −7-7. The grouped sum stays inside the first term.

In 5x5x, the number 55 is the coefficient, the number multiplying the variable. The coefficient of 3y3y is 33. Plain xx has coefficient 11, because x=1xx = 1x; likewise, −x=−1x-x = -1x has coefficient −1-1.

The term −7-7 is a constant, a number term with no variable. It stays −7-7 regardless of the values of xx and yy.

The parts of an expression 5x + 3y - 7The expression 5x + 3y minus 7 with each term boxed. The 5 and 3 are labeled coefficients, x and y are variables, and the minus 7 is labeled the constant term.5x+3y−7termtermtermcoefficientcoefficientconstantvariables: x and y
The terms are 5x, 3y, and -7. The coefficients are 5 and 3; the constant is -7.

Check your understanding

Which statement about −k+2-k + 2 is correct?

Answer choices

Evaluating an expression by substitution

If x=7x = 7, then 5x5x means 5×7=355 \times 7 = 35. Replacing a variable with its given value is called substitution.

Put the substituted number in parentheses to keep the operations clear: 5x5x becomes 5(7)5(7), not 5757. Then follow the order of operations to evaluate the expression.

Worked example 3 Evaluate 3x+43x + 4 when x=5x = 5

Substitute 55 for xx, writing it in parentheses so the multiplication stays clear:

3x+4=3(5)+4.3x + 4 = 3(5) + 4.

Now follow the order of operations: multiply before you add.

3(5)+4=15+4=19.3(5) + 4 = 15 + 4 = 19.

Why the same expression gives different values for different inputs#

Changing the input can change the value of an expression. For 2x+12x + 1, compare two inputs:

x=3:2(3)+1=7,x=5:2(5)+1=11.\begin{aligned} x = 3 &: \quad 2(3) + 1 = 7, \\ x = 5 &: \quad 2(5) + 1 = 11. \end{aligned}

Both calculations follow the same rule: multiply the input by two and add one.

The rectangle below uses ww for width and hh for height. Its area counts the unit squares inside: hh rows of ww squares give w×hw \times h. Its perimeter is the distance around all four sides. For a width of 44 and height of 22, going around adds 4+24 + 2 twice: 2(4+2)=122(4 + 2) = 12. With letters, the two pairs of sides give (w+h)+(w+h)=2(w+h)(w + h) + (w + h) = 2(w + h).

Set w=4w = 4 and change hh from 11 to 55. Watch the area change through 44, 88, 1212, 1616, and 2020. You are evaluating 4h4h at five different inputs. Then try w=5w = 5 and h=3h = 3. Calculate w×hw \times h and 2(w+h)2(w + h), then check the readout.

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. A rectangle drawn on a grid of unit squares, inside a dashed boundary showing how large it can grow. Use the controls below the figure to change either dimension and watch both expressions take new values. 4 2
Width Height

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.

Change the width and height to evaluate w times h and 2(w + h). At width 4 and height 2, the values are 8 and 12.

Worked example 4 Evaluate 2a2−b2a^2 - b when a=3a = 3 and b=5b = 5

Replace aa with (3)(3) and bb with (5)(5):

2a2−b=2(3)2−(5).2a^2 - b = 2(3)^2 - (5).

Square 33 first, then multiply by 22:

2(3)2=2×9=18.2(3)^2 = 2 \times 9 = 18.

Then subtract the value of bb:

18−5=13.18 - 5 = 13.

The exponent applies to aa, so square 33, not the whole product 2×32 \times 3.

For a negative input, parentheses keep the number and its minus sign together.

Worked example 5 Evaluate 3x+13x + 1 when x=−2x = -2

Substitute (−2)(-2) for xx:

3x+1=3(−2)+1.3x + 1 = 3(-2) + 1.

Writing 3−23 - 2 instead would change multiplication into subtraction.

Now follow the order of operations, multiplying before adding:

3(−2)+1=−6+1=−5.3(-2) + 1 = -6 + 1 = -5.

Check your understanding

Evaluate 4n−34n - 3 when n=2n = 2.

Answer choices

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)

Other explanations of this lesson, if you want a second take.

A bit of history (optional)

François Viète made his living as a lawyer and royal adviser in France. Mathematics was something he pursued alongside that work. When political enemies drove him from the royal court, he spent five years away from public duties.

In 15911591, he published a book that used letters for both known and unknown quantities. His choice was different from today’s familiar xx: vowels stood for unknowns, and consonants stood for known quantities. That let him describe a whole family of problems without choosing particular numbers at the start.

Viète’s years away from court became a period of major mathematical work. During those years he developed the ideas he is remembered for.

Your progress

See all your progress →