Skip to content
Tutorials Center
My learning

Topics

Lesson 15 of 38 ยท Variables and Simple Equations

Variables and Algebraic Expressions

Learn what variables, terms, coefficients and constants are, how to write algebraic expressions from words, and how to evaluate them by substitution.

Now the big step: using letters for numbers. A variable is a symbol, usually a letter such as x, n or t, that stands for a number that can change or is not yet known. An algebraic expression combines numbers, variables and operations, for example 3x + 5.

Why bother? Because one expression describes infinitely many situations. A taxi charges 5 dollars plus 3 dollars per kilometre. For x kilometres the fare is 3x + 5. Whether the trip is 2 km or 20 km, the same expression applies.

The parts of an expression

In 3x + 5:

  • 3x and 5 are terms. Terms are separated by + or โˆ’ signs.
  • 3 is the coefficient of x: the number multiplying the variable.
  • x is the variable.
  • 5 is a constant: a term with no variable.

Writing conventions: 3x means 3 ร— x; we leave out the multiplication sign. A coefficient of 1 is not written: 1x = x. Also xยฒ means x ร— x, and xy means x ร— y.

Expression Terms Coefficients Constant
4a + 7 4a, 7 4 7
x โˆ’ 9 x, โˆ’9 1 โˆ’9
2m + 3n โˆ’ 1 2m, 3n, โˆ’1 2, 3 โˆ’1

Writing expressions from words

Words Expression
a number plus 7 n + 7
5 less than a number n โˆ’ 5
three times a number 3n
a number divided by 4 n/4
twice a number, increased by 1 2n + 1
the sum of a number and 6, then doubled 2(n + 6)

Pay attention to order ("5 less than a number" is n โˆ’ 5, never 5 โˆ’ n) and to grouping.

Evaluating an expression

To evaluate an expression, substitute a number for each variable, then compute using the order of operations.

Evaluate 3x + 5 when x = 4: 3(4) + 5 = 12 + 5 = 17.

Evaluate 2aยฒ โˆ’ b when a = 3 and b = 5: 2(3)ยฒ โˆ’ 5 = 2 ร— 9 โˆ’ 5 = 18 โˆ’ 5 = 13.

Evaluate xยฒ + 2x when x = โˆ’3: (โˆ’3)ยฒ + 2(โˆ’3) = 9 โˆ’ 6 = 3. Use parentheses when you substitute a negative number, or the signs will go wrong.

Expressions behave exactly like functions in code: give the input, get the output.

Python Evaluate expressions for different values

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Always substitute inside parentheses. If x = โˆ’3, then xยฒ is (โˆ’3)ยฒ= 9. If you write โˆ’3ยฒ you get โˆ’9, which is wrong.

A table of values

A table shows how the output changes as the variable changes. For 3x + 5:

x 0 1 2 3 4
3x + 5 5 8 11 14 17

Each time x rises by 1, the expression rises by 3, the coefficient. That regular change is the first hint of the patterns you will study later.

Python Build a table of values

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Formulas are expressions

A formula is an equation that relates quantities using variables. The perimeter of a rectangle is P = 2l + 2w. For l = 7 and w = 3 (in cm), P = 2(7) + 2(3) = 14 + 6 = 20 cm. The area of a square with side s is A = sยฒ, so s = 9 m gives 81 mยฒ. Converting Celsius to Fahrenheit: F = 1.8C + 32. For C = 25, F = 1.8 ร— 25 + 32 = 77.

Python Use a formula

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. In the expression 7y โˆ’ 4, what is the coefficient of y?

    The coefficient is the number multiplying the variable: 7. The constant term is โˆ’4.
  2. 2. Which expression means '3 less than twice a number n'?

    Twice the number is 2n, and 3 less than that is 2n โˆ’ 3.
  3. 3. Evaluate 4x โˆ’ 7 when x = 5.

    4(5) โˆ’ 7 = 20 โˆ’ 7 = 13.
  4. 4. Evaluate xยฒ โˆ’ x when x = โˆ’2.

    (โˆ’2)ยฒ โˆ’ (โˆ’2) = 4 + 2 = 6.

Summary

  • A variable is a letter standing for a number; an algebraic expression combines variables, numbers and operations.
  • Terms are separated by plus and minus signs; a coefficient multiplies a variable; a constant has no variable.
  • To evaluate, substitute numbers (in parentheses) and follow the order of operations.
  • Formulas are expressions that relate real quantities.

Next: Like Terms and Simplifying Expressions