Skip to content
Tutorials Center
My learning

Topics

Lesson 2 of 37 · Getting Started

Order of Operations in Algebra

Master the order of operations with brackets, exponents and negative numbers, and learn to evaluate algebraic expressions without sign errors.

If you type 2 + 3 × 4 into a calculator, do you get 20 or 14? Mathematicians agreed on a single set of rules so that every expression has exactly one value. These rules are the order of operations. In algebra they matter even more, because expressions combine variables, exponents and brackets.

This lesson shows the rules, explains where students usually slip, and lets you check your work with code.

The rules

Work through an expression in this order:

  1. Brackets (parentheses), innermost first. Fraction bars and roots also act as brackets.
  2. Exponents (powers and roots).
  3. Multiplication and division, from left to right.
  4. Addition and subtraction, from left to right.

You may know this as PEMDAS (US) or BODMAS/BIDMAS (UK and many other countries). The letters differ, the order is identical.

Multiplication and division share one level, and so do addition and subtraction. Go left to right within a level. 12 ÷ 3 × 2 is 4 × 2 = 8, not 12 ÷ 6 = 2.

Worked examples

Example 1. 2 + 3 × 4. Multiply first: 3 × 4 = 12. Then add: 2 + 12 = 14.

Example 2. (2 + 3) × 4. Brackets first: 5 × 4 = 20.

Example 3. 18 - 2 × 3². Exponent first: 3² = 9. Multiply: 2 × 9 = 18. Subtract: 18 - 18 = 0.

Example 4 (with a variable). Evaluate 5(x - 2)² + 3 when x = 6.

  • Substitute: 5(6 - 2)² + 3
  • Brackets: 5(4)² + 3
  • Exponent: 5(16) + 3
  • Multiply: 80 + 3
  • Add: 83

Example 5 (fraction bar). Evaluate (a + 7) / (b - 1) when a = 5 and b = 4. The bar groups the top and the bottom: 12 / 3 = 4.

Negative numbers and exponents

The exponent applies only to what is directly in front of it.

Expression Meaning Value
(-3)² (-3) × (-3) 9
-3² the negative of 3² -9
-(3²) same as above -9
2·3² 2 × 9 18
(2·3)² 6² 36

When you substitute a negative number for a variable, always put it in brackets: x² + x at x = -3 becomes (-3)² + (-3) = 9 - 3 = 6.

Python Check the order of operations

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.

Python Evaluate at a negative number

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.

Stepwise habits that prevent mistakes

  1. Write each step on a new line. Change only one thing per line.
  2. Underline or circle the part you are working on.
  3. Rewrite the rest of the expression unchanged.
  4. Check: if you can, evaluate on a calculator or in code.

Nested brackets

When brackets sit inside other brackets, work from the inside out. Evaluate 3[2 + (7 - 4)²]:

  • Innermost brackets: 7 - 4 = 3, giving 3[2 + 3²]
  • Exponent: 3²= 9, giving 3[2 + 9]
  • Bracket: 3[11]
  • Multiply: 33

Square and curly brackets are only visual aids. They mean the same as round ones.

Common mistakes

  • Adding before multiplying: 2 + 3x at x = 4 is 2 + 12 = 14, not 5 × 4 = 20.
  • Squaring a coefficient by accident: 3x² at x = 2 is 3 × 4 = 12, not 6² = 36.
  • Forgetting that a minus sign in front of a bracket applies to everything inside (you will use this in the distributive property).

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is 7 + 2 × 5?

    Multiplication comes before addition: 2 × 5 = 10, then 7 + 10 = 17.
  2. 2. Evaluate 3x² when x = 4.

    Exponent first: 4² = 16, then multiply by 3 to get 48. The 3 is not squared.
  3. 3. What is 20 ÷ 4 × 5?

    Multiplication and division share a level, so go left to right: 20 ÷ 4 = 5, then 5 × 5 = 25.
  4. 4. What is -4² ?

    The exponent applies to 4 only, then the negative sign is applied: -(4²) = -16.

Summary

  • Order: brackets, exponents, multiplication and division (left to right), addition and subtraction (left to right).
  • A fraction bar groups its top and bottom like brackets.
  • (-3)² is 9, but -3² is -9.
  • Substitute negatives inside brackets and work one step per line.

Next: Like Terms and Simplifying