See How Things Work

Evaluating multi-step expressions

Unit
Order of Operations
Part
1. Order of Operations
Lesson
1.4

Grouping symbols and the order of operations together give every expression one value. This lesson turns them into a complete step-by-step procedure for evaluating any whole-number expression, shows how to set out and check the work, explains what happens when a step has no whole-number result, and lists the common mistakes and how to catch them.

The procedure

To evaluate an expression is to carry out its operations in the agreed order;⁠[1] to simplify it is to do all the arithmetic possible.⁠[2] Lessons 1.2 and 1.3 give the order: the inside of grouping symbols first, innermost first (lesson 1.2), and in each part multiplications and divisions before additions and subtractions, each from left to right (lesson 1.3).⁠[3][4] Put together, they make a procedure that can be followed mechanically.

Definition (Evaluating step by step).
  1. If the expression is a single number, that number is its value. Stop.
  2. Find the part to work on: reading from the left, the first closing grouping symbol and the opening symbol that is its partner enclose an innermost group. If there are no grouping symbols, the part is the whole expression.
  3. In that part, take the leftmost × or ÷; if there is none, the leftmost + or −. Carry out that one operation.
  4. If the result is not a whole number (a subtraction of a larger number, a division that does not come out exactly, or a division by 0), stop: the expression has no whole-number value.
  5. Write the expression again on the next line, with the result in place of the operation and its two numbers. If a group now holds a single number, drop its grouping symbols. Return to step 1.
Theorem .

For an expression with k operation signs, the procedure stops after at most k steps. If it does not stop at step 4, it ends after exactly k steps with the value that the order of operations gives the expression.

Proof.

Each step removes one operation sign (lesson 1.1, “Expressions with several operations”), so after k steps none is left. Every step is the one that the order of operations names: step 2 chooses an innermost group, and step 3 chooses inside it as the convention does. By the Theorem of lesson 1.3, the expression has exactly one value under the convention, and the procedure computes it. Working on the first innermost group from the left, rather than another innermost group, does not change the value, by the Theorem of lesson 1.2.

The work is best set out down the page, each step written below the previous one,⁠[5] with one equal sign per line.⁠[6] Each line is then equal to the line above it, and a mistake can be found by comparing two neighboring lines.

  1. 60 ÷ [2 × (8 − 3)] + 48 − 3 = 5: inside the innermost group
  2. =60 ÷ [2 × 5] + 42 × 5 = 10: inside the innermost group
  3. =60 ÷ 10 + 460 ÷ 10 = 6: × and ÷ before + and −
  4. =6 + 46 + 4 = 10: + and −, last
  5. =10the value
Figure. The evaluation of 60 ÷ [2 × (8 − 3)] + 4, one step per line. On each line the shaded part is the step done next; the note beside it says what it gives and why it comes next. Each line is equal to the line above it, so the whole column is a chain of equal expressions ending in the value.

Worked examples

Example (A group and a multiplication).

Evaluate 5 + 4 × (9 − 6).

  1. The group first: 9 − 6 = 3. Line: 5 + 4 × 3.
  2. No groups left. Multiplication before addition: 4 × 3 = 12. Line: 5 + 12.
  3. 5 + 12 = 17.

Answer: 17. Three operation signs, three steps.

Example (Nested groups (the Figure)).

Evaluate 60 ÷ [2 × (8 − 3)] + 4.

  1. Innermost group: (8 − 3) = 5. Line: 60 ÷ [2 × 5] + 4.
  2. The bracket is now innermost: 2 × 5 = 10. Line: 60 ÷ 10 + 4.
  3. Division before addition: 60 ÷ 10 = 6. Line: 6 + 4.
  4. 6 + 4 = 10.

Answer: 10.

Example (Three levels, all rules).

Evaluate 2 × {45 − [3 + (16 − 4) ÷ 3] × 5}.

  1. Innermost: (16 − 4) = 12. Line: 2 × {45 − [3 + 12 ÷ 3] × 5}.
  2. Inside the bracket, division before addition: 12 ÷ 3 = 4. Line: 2 × {45 − [3 + 4] × 5}.
  3. Then 3 + 4 = 7, and the bracket is dropped. Line: 2 × {45 − 7 × 5}.
  4. Inside the braces, multiplication before subtraction: 7 × 5 = 35. Line: 2 × {45 − 35}.
  5. 45 − 35 = 10. Line: 2 × 10.
  6. 2 × 10 = 20.

Answer: 20. Six operation signs, six steps.

Example (From a description).

A class has 4 boxes of 12 pencils and 3 loose pencils. All the pencils are shared equally among 3 tables. Write the number of pencils per table as one expression and evaluate it.

  1. The pencils: 4 × 12 + 3, which needs no parentheses, since the multiplication comes first anyway.
  2. All of them are shared, so the whole sum is divided: (4 × 12 + 3) ÷ 3. Here the parentheses are needed: without them, only the 3 loose pencils would be divided.
  3. Evaluate: 4 × 12 = 48, then 48 + 3 = 51, then 51 ÷ 3 = 17.

Answer: 17 pencils per table. Check: 17 × 3 = 51 = 48 + 3.

Game

Evaluate it

Round
1
Score
0
Streak
0

Evaluate this expression by the order of operations. Work it out on paper, then type the value.

(6 + 9) × (44 ÷ 11)

When a step has no whole-number result

The procedure stops at step 4 when a step has no whole-number result: a subtraction of a larger number from a smaller one (Subtraction 1.4), a division that does not come out exactly (Division 1.2), or a division by zero, which is undefined.⁠[7] Since the order of the steps is fixed by the convention, the expression as written then has no whole-number value, even if a different expression with the same numbers has one.

Example (A subtraction that is not defined).

Evaluate 10 − 4 × 3 + 5.

  1. Multiplication first: 4 × 3 = 12. Line: 10 − 12 + 5.
  2. From the left: 10 − 12. Since 12 is greater than 10, it has no whole-number value.

Answer: the expression has no whole-number value. The different expression 10 + 5 − 4 × 3 = 15 − 12 = 3 does have one.

Example (A division that does not come out exactly).

Evaluate 7 ÷ 2 × 4.

  1. ÷ and × have equal priority, so from the left: 7 ÷ 2. No whole number times 2 is 7, so there is no whole-number quotient.

Answer: no whole-number value, although the different expression 7 × 4 ÷ 2 = 28 ÷ 2 = 14 has one.

Looking ahead.

Later units give such steps a result. In the unit Integers, 10 − 12 has a value, and 10 − 4 × 3 + 5 then has the value 3; in the unit Fractions, 7 ÷ 2 has a value, and 7 ÷ 2 × 4 then has the value 14. The order of the steps does not change: only the steps that had no result get one. Division by zero stays undefined.

Example (Division by zero).

Evaluate 6 ÷ (3 − 3) + 1.

  1. The group first: 3 − 3 = 0. Line: 6 ÷ 0 + 1.
  2. Division before addition: 6 ÷ 0 is undefined (Division 1.3).

Answer: the expression has no value, because division by zero is undefined. Here the grouping symbols made the divisor 0.

Checking, shortcuts and common mistakes

The convention fixes the value, not the way it must be computed. Any calculation that is proved to give the same number may be used to find it or to check it. In a product of several factors the factors may be taken in any order and grouping (lesson 1.1 and Multiplication 1.6), since changing the order of the factors or their grouping does not change the product.⁠[8][9] And multiplication distributes over addition (Multiplication 1.7).⁠[10]

Example (Two shortcuts, each checked).

Evaluate 25 × 7 × 4 and 99 × 6 + 1 × 6.

  1. 25 × 7 × 4 by the convention: 25 × 7 = 175, then 175 × 4 = 700. Shortcut: (25 × 4) × 7 = 100 × 7 = 700, by the commutative and associative properties (Multiplication 1.5, 1.6).
  2. 99 × 6 + 1 × 6 by the convention: 99 × 6 = 594, 1 × 6 = 6, 594 + 6 = 600. Shortcut: by the distributive property, it is (99 + 1) × 6 = 100 × 6 = 600.

Answer: 700 and 600. Each shortcut gives the same value as the convention, which also checks the work.

The common mistakes each break one rule of the procedure:

  • Working strictly from left to right. 6 + 3 × 4 becomes 9 × 4 = 36 instead of 6 + 12 = 18.
  • Multiplying before dividing, or adding before subtracting, because of the order of the letters in PEMDAS. The letters M-D and A-S may seem to say so, but each pair has the same precedence.⁠[11]
  • Ignoring grouping symbols, or working on a number inside a group before the group is finished: 3 × (4 + 5) is 27, not 3 × 4 + 5 = 17.
  • Changing the expression, for example writing 10 − 12 + 5 as 10 + 5 − 12 to avoid a step without a value. That is a different expression.
Example (A common mistake: subtracting before multiplying).

Someone writes 20 − 2 × (3 + 4) = 18 × (3 + 4) = 18 × 7 = 126. Find the first wrong line and correct it.

  1. The first line is wrong: it works out 20 − 2 while the group (3 + 4) is unfinished, and before the multiplication.
  2. Correct work: the group first, 3 + 4 = 7, giving 20 − 2 × 7; then 2 × 7 = 14, giving 20 − 14; then 20 − 14 = 6.

Answer: 20 − 2 × (3 + 4) = 6, not 126.

Game

Find the wrong step

Round
1
Score
0
Streak
0

Someone evaluated this expression one step per line. Tap the first line with a step that breaks the order of operations, or choose “Every step is right”.

42 ÷ (4 + 16 ÷ 8) − 3

Exercises

Exercise .

Evaluate 3 + 5 × (10 − 4).

▸ Show solution

3 + 5 × (10 − 4) = 3 + 5 × 6 = 3 + 30 = 33.

Exercise .

Evaluate 100 ÷ [5 × (6 − 2)].

▸ Show solution

100 ÷ [5 × (6 − 2)] = 100 ÷ [5 × 4] = 100 ÷ 20 = 5.

Exercise .

Evaluate (18 + 6) ÷ 4 × 3 − 2.

▸ Show solution

(18 + 6) ÷ 4 × 3 − 2 = 24 ÷ 4 × 3 − 2 = 6 × 3 − 2 = 18 − 2 = 16. Division and multiplication from the left, then the subtraction.

Exercise .

Does 9 − 3 × 4 + 6 have a whole-number value?

▸ Show solution

Multiplication first: 3 × 4 = 12, giving 9 − 12 + 6. From the left, 9 − 12 has no whole-number value, so the expression has none. (The different expression 9 + 6 − 3 × 4 = 15 − 12 = 3 does.)

Exercise .

A theater has 12 rows of 15 seats and a balcony with 40 seats; 3 seats are broken. Write the number of usable seats as one expression and evaluate it.

▸ Show solution

12 × 15 + 40 − 3 = 180 + 40 − 3 = 220 − 3 = 217 seats. No parentheses are needed: the product comes first, then the addition and subtraction from the left.

Exercise .

Someone evaluates 48 ÷ 4 × 2 + 6 as 48 ÷ 8 + 6 = 6 + 6 = 12. Find the mistake and the correct value.

▸ Show solution

The mistake is multiplying 4 × 2 before dividing: ÷ and × have equal priority, so 48 ÷ 4 comes first. Correct: 48 ÷ 4 × 2 + 6 = 12 × 2 + 6 = 24 + 6 = 30, not 48 ÷ 8 + 6 = 12.

Exercise .

Evaluate 2 × {3 + [4 × (5 − 1)]}.

▸ Show solution

(5 − 1) = 4; [4 × 4] = 16; {3 + 16} = 19; 2 × 19 = 38.

Exercise .

Explain why, in 6 × 7 + 8 × 9, working out 8 × 9 before 6 × 7 gives the same value, although step 3 of the procedure takes the leftmost multiplication first.

▸ Show solution

The convention reads 6 × 7 + 8 × 9 as (6 × 7) + (8 × 9): a fully grouped expression whose last operation is +. Its two parts are separate groups, and by the Theorem of lesson 1.2 they may be worked out in either order: 42 + 72 = 114 both ways. The procedure takes the leftmost product first only to have one fixed routine.

Summary

  1. To evaluate an expression: work on an innermost group (or the whole expression if there is none); inside it, do the leftmost × or ÷, otherwise the leftmost + or −; repeat.
  2. An expression with k operation signs that has a whole-number value takes exactly k steps; write one step per line, each line equal to the one above.
  3. If a step has no whole-number result (a larger number subtracted, an inexact division, or division by 0), the expression has no whole-number value.
  4. Properties of the operations give shortcuts and checks: any calculation proved to give the same number may be used.
  5. Common mistakes: working strictly left to right, × before ÷ or + before − because of PEMDAS, and ignoring or leaving grouping symbols too early.

Sources

  1. 1.
    David Arnold, “Prealgebra, 1.5 “Order of Operations””, Mathematics LibreTexts (College of the Redwoods, CC BY-NC-SA).
    “When evaluating expressions, proceed in the following order.”
    Used for: evaluating an expression means carrying out its operations in the agreed order.
  2. 2.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 2, “The Language of Algebra”, section 2.1, “Use the Language of Algebra” (“Simplify Expressions with Exponents”), p. 103 (the whole topic: pp. 103–105).
    “To simplify a numerical expression means to do all the math possible.”
    Used for: to simplify an expression is to do all the arithmetic possible.
  3. 3.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 2, “The Language of Algebra”, section 2.1, “Use the Language of Algebra” (“Simplify Expressions Using the Order of Operations”), p. 105 (the whole topic: pp. 105–108).
    “Simplify all expressions inside the parentheses or other grouping symbols, working on the innermost parentheses first.”
    Used for: the inside of grouping symbols comes first, innermost first.
  4. 4.
    David Arnold, “Prealgebra, 1.5 “Order of Operations””, Mathematics LibreTexts (College of the Redwoods, CC BY-NC-SA).
    “Perform all multiplications and divisions in the order that they appear in the expression, moving left to right.”
    Used for: multiplications and divisions are done before additions and subtractions, in the order they appear from left to right.
  5. 5.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 2, “The Language of Algebra”, section 2.1, “Use the Language of Algebra” (“Simplify Expressions with Exponents”), p. 103 (the whole topic: pp. 103–105).
    “A good habit to develop is to work down the page, writing each step of the process below the previous step.”
    Used for: the work is set out down the page, each step written below the previous one.
  6. 6.
    David Arnold, “Prealgebra, 1.2 “Adding and Subtracting Whole Numbers””, Mathematics LibreTexts (College of the Redwoods, CC BY-NC-SA).
    “When writing mathematical statements, follow the mantra: One equal sign per line.”
    Used for: one equal sign per line.
  7. 7.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 1, “Whole Numbers”, section 1.5, “Divide Whole Numbers” (“Divide Whole Numbers”), “Division Properties of Zero”, p. 72 (the whole topic: pp. 71–72).
    “Division by zero is said to be undefined.”
    Used for: division by zero is undefined.
  8. 8.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 1, “Whole Numbers”, section 1.4, “Multiply Whole Numbers” (“Multiply Whole Numbers”), “Commutative Property of Multiplication”, p. 55 (the whole topic: pp. 55–56).
    “When the order of the factors is reversed, the product does not change. This is called the Commutative Property of Multiplication.”
    Used for: changing the order of the factors does not change the product (the commutative property of multiplication).
  9. 9.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 7, “The Properties of Real Numbers”, section 7.2, “Commutative and Associative Properties” (“Use the Commutative and Associative Properties”), p. 548 (the whole topic: pp. 547–548).
    “When multiplying three numbers, changing the grouping of the numbers does not change the result. This is known as the Associative Property of Multiplication.”
    Used for: changing the grouping of the factors does not change the product (the associative property of multiplication).
  10. 10.
    Michelle Manes, “Properties of Operations”, Mathematics for Elementary Teachers, University of Hawaiʻi (Pressbooks) (2018).
    “Multiplication distributes over addition.”
    Used for: multiplication distributes over addition, so 99 × 6 + 1 × 6 = (99 + 1) × 6.
  11. 11.
    Christopher Stover, “PEMDAS”, MathWorld, A Wolfram Web Resource.
    “In addition, the ordering M-D (respectively, A-S) may appear to indicate that multiplication (respectively, addition) happens before division (respectively, subtraction), though multiplication (respectively, addition) receives the same precedence as division (respectively, subtraction).”
    Used for: the letters M-D and A-S of PEMDAS may suggest multiplication before division and addition before subtraction, though each pair has the same precedence.