### Evaluating Expressions using the Order of Operations

Take a look at this expression: \begin{align*}2+4 \times 7 - 1\end{align*}

How many different ways can this expression be simplified?

The simplest (but *incorrect*) way to evaluate the expression is simply to start at the left and work your way across:

\begin{align} & \quad 2 + 4 \times 7 - 1\\ &= 6 \times 7 - 1\\ &= 42 - 1\\ &= 41 \end{align}

This is the answer you would get if you entered the expression into an ordinary calculator, performing all of the operations from left to right. If you entered the expression into a scientific calculator or a graphing calculator you would probably (and correctly) get 29 as the answer.

In mathematics, the order in which we perform the various operations such as adding, subtracting, multiplying, and dividing, is important. In the expression above, the operation of multiplication takes precedence over addition, so it is evaluated first.

Reconsider the expression from above, but this time evaluate the multiplication first. It may help to clarify things by grouping the multiplied numbers with parentheses.

\begin{align*}2 + (4 \times 7) - 1\end{align*}

Now evaluate the expression inside the parentheses: \begin{align*}4 \times 7 = 28\end{align*}, the expression becomes:

\begin{align*} 2 + (28) - 1\end{align*}

Now you have only addition and subtraction. Start at the left and work across:

\begin{align} & \quad 2 + 28 - 1\\ & = 30 - 1\\ & = 29\\ \end{align}

Many people use the word **“PEMDAS”** to help remember the priority order of the mathematical operations: **P**arentheses, **E**xponents, **M**ultiplication and **D**ivision, **A**ddition and **S**ubtraction. Just remember that multiplication and division have the same priority, and so do addition and subtraction, so those operations should be completed left to right.

**Order of Operations**

- First evaluate expressions within Parentheses, including brackets [ ] and braces { }.
- Next evaluate all Exponents (terms such as \begin{align*}3^2\end{align*} or \begin{align*}x^3\end{align*}).
- Then Multiplication
*and*Division - work from left to right completing both multiplication and division in the order that they appear. - Finally, evaluate Addition
*and*Subtraction - work from left to right completing both addition and subtraction in the order that they appear.

#### Evaluating Expressions

Each of these expressions has the same numbers and the same mathematical operations in the same order. The placement of the various grouping symbols means that we must evaluate everything in a different order each time. Consider the effect of the parentheses in each example.

a) \begin{align*}4 - 7 - 11 + 2\end{align*}

This expression doesn't have parentheses, exponents, multiplication, or division. Treat addition and subtraction as they appear, starting at the left and working right (NOT completing all of the addition *then* all of the subtraction).

\begin{align} & \quad 4 - 7 - 11 + 2\\ & = \text{-}3 - 11 + 2\\ & = \text{-}14 + 2\\ & = \text{-}12 \end{align}

b) \begin{align*}4 - (7 - 11) + 2\end{align*}

This expression has parentheses, so first evaluate \begin{align*}7 - 11= \text{-}4\end{align*}. Remember that subtracting a negative is equivalent to adding a positive:

\begin{align} & \quad 4 - (7 - 11) + 2\\ & = 4 - \text{-}4 + 2\\ & = 8 + 2\\ & = 10\\ \end{align}

c) \begin{align*}4 - [7 - (11 + 2)]\end{align*}

An expression can contain any number of sets of parentheses. Sometimes expressions will have sets of parentheses *inside* other sets of parentheses. When faced with these **nested parentheses**, start at the innermost parentheses and work outward.

Brackets are commonly used to group expressions already containing parentheses. This expression has both brackets and parentheses. Start with the innermost group: \begin{align*}11 + 2 = 13\end{align*}. Then complete the resulting operation in the brackets.

\begin{align} & \quad 4 - [7 - (11 + 2)]\\ & = 4 - [7 - 13]\\ & = 4 - \text{-}6\\ & = 10\\ \end{align}

#### Evaluating more Complex Expressions

Evaluate the following:

a) \begin{align*}3 \times 5 - 7 \div 2\end{align*}

There are no grouping symbols. The order of operations dictates multiplication and division first (working from left to right), then subtraction:

\begin{align} & \quad 3 \times 5 - 7 \div 2\\ & = 15 - 3.5\\ & = 11.5\\ \end{align}

b) \begin{align*}3 \times (5 - 7) \div 2\end{align*}

First evaluate the expression inside the parentheses: \begin{align*}5 - 7 = \text{-}2\end{align*}, then work from left to right:

\begin{align} & \quad 3 \times (5 - 7) \div 2\\ & = 3 \times \text{-} 2 \div 2\\ & = \text{-}6 \div 2\\ & = \text{-}3\\ \end{align}

The order of operations also applies to expressions with variables, consider the example, below.

#### Evaluating Expressions with Variables

Use the order of operations to evaluate the following:

a) \begin{align*}2 - (3x + 2)\end{align*} when \begin{align*}x = 2\end{align*}

The first step is to substitute the value for \begin{align*}x\end{align*} into the expression. It may help to put the substituted value in parentheses to clarify the resulting expression.

\begin{align*}2 - [3(2) + 2]\end{align*}

(Note: \begin{align*}3(2)\end{align*} is the same as \begin{align*}3 \times 2\end{align*}.)

Follow **PEMDAS:** parentheses are first. Inside the parentheses, follow **PEMDAS** again.

\begin{align} & \quad 2 - ( 3 \times 2 + 2) \qquad \text{Inside the parentheses, multiply first.}\\ & = 2 - (6 + 2) \qquad \quad \ \ \ \text{Next, add inside the parentheses.}\\ & = 2 - 8 \qquad \qquad \qquad \text{Finally, subtract.}\\ & = \text{-}6 \end{align}

b) \begin{align*}3y^2 + 2y + 1\end{align*} when \begin{align*}y = \text{-}3\end{align*}

The first step is to substitute the value for \begin{align*}y\end{align*} into the expression. Leave the parentheses around the negative numbers to clarify the problem. Since there are no operations within the parentheses they will not affect the order of operations, but will help avoid confusion when multiplying the negative numbers.

\begin{align*}3 \times (\text{-}3)^2 + 2 \times (\text{-}3)+1\end{align*}

Follow **PEMDAS**: we cannot simplify the expressions in parentheses, so exponents come next.

\begin{align} & \ \ \ \ 3 \times (\text{-}3)^2 +2 \times \text{-}3+1 \quad \ \ \ \text{Evaluate exponents: } \ (-3)^2 =9\\ & = 3 \times 9 +2 \times \text{-}3 +1 \qquad \quad \text{ Evaluate multiplication: } 3 \times 9 = 27; 2\times \text{-}3 = \text{-}6 \\ & = 27 + \text{-}6 +1 \qquad \qquad \quad \ \ \ \text{ Add and subtract from left to right}\\ & = 27-6+1 \\ & = 22 \end{align}

**Technology Note: Graphing Calculators**

A graphing calculator is a very useful tool when evaluating algebraic expressions. Like a scientific calculator, a graphing calculator follows **PEMDAS**.

*Evaluate \begin{align*}\left [ 3(x^2 - 1)^2 - x^4 + 12 \right ] + 5x^3 - 1\end{align*} when \begin{align*}x = \text{-}3\end{align*}.*

**Method 1:** Substitute for the variable first. Then evaluate the numerical expression with the calculator.

*Substitute the value \begin{align*}x = \text{-}3\end{align*} into the expression.*

\begin{align*}\left [3((\text{-}3)^2 - 1)^2 - (\text{-}3)^4 + 12 \right ] + 5(\text{-}3)^3 - 1\end{align*}

*Type this into the calculator just as it is and press* **[ENTER]**. *(Note: use \begin{align*}\land\end{align*} to enter exponents)*

*The answer is* -13.

**Method 2:** Type the original expression into the calculator first and then evaluate.

*First, store the value \begin{align*}x = -3\end{align*} in the calculator. Type -3* **[STO]** \begin{align*}x\end{align*} *(The letter \begin{align*}x\end{align*} can be entered using the \begin{align*}x-\end{align*}***[VAR]** *button or* **[ALPHA] + [STO]**). *Then type the original expression in the calculator and press* **[ENTER]**.

*The answer is* -13.

The second method is better because you can easily evaluate the same expression for any value you want. For example, evaluate the same expression using the values \begin{align*}x = 2\end{align*} and \begin{align*}x = \frac { 2 } { 3 }:\end{align*}

For \begin{align*}x = 2\end{align*}, store the value of \begin{align*}x\end{align*} in the calculator: \begin{align*}2\end{align*} **[STO]** \begin{align*}x\end{align*}. Press **[2nd] [ENTER]** twice to get the previous expression you typed in on the screen without having to enter it again. Press **[ENTER]** to evaluate the expression.

The answer is 62.

For \begin{align*}x = \frac { 2 } { 3 }\end{align*}, store the value of \begin{align*}x\end{align*} in the calculator: \begin{align*} \frac { 2 } { 3 }\end{align*} **[STO]** \begin{align*}x\end{align*}. Press **[2nd] [ENTER]** twice to get the expression on the screen without having to enter it again. Press **[ENTER]** to evaluate.

The answer is 13.21, or \begin{align*} \frac { 1070 } { 81 }\end{align*} in fraction form.

**Note:** On graphing calculators there is a difference between the minus sign and the negative sign. When you stored the value 'negative three', you needed to use the negative sign, which is to the left of the **[ENTER]** button on the calculator. On the other hand, to perform the subtraction operation in the expression you use the minus sign. The minus sign is directly above the plus sign on the right.

### Examples

Use the order of operations to evaluate the following:

#### Example 1

\begin{align*}(3 \times 5) - (7 \div 2)\end{align*}

First evaluate the expressions inside parentheses: \begin{align*}3 \times 5 = 15\end{align*} and \begin{align*}7 \div 2 = 3.5\end{align*}. Then work from left to right:

\begin{align} & \quad \ (3 \times 5) - (7 \div 2)\\ & = 15 - 3.5\\ & = 11.5\\ \end{align}

Note that adding parentheses didn’t change the expression in part c, but did make it easier to read. Parentheses can be used to change the order of operations in an expression, but they can also be used simply to make it easier to understand.

#### Example 2

\begin{align*} 2 - (t - 7)^2 \times (u^3 - v)\end{align*} when \begin{align*}t = 19, \ u = 4, \end{align*} and \begin{align*}v = 2\end{align*}

The first step is to substitute the values for \begin{align*}t, \ u,\end{align*} and \begin{align*}v\end{align*} into the expression.

\begin{align*}2 - (19 - 7)^2 \times (4^3 - 2)\end{align*}

Follow **PEMDAS**:

\begin{align} \quad \ 2 - (19 - 7)^2 \times (4^3 - 2) \qquad & \text{First follow PEMDAS within parentheses:} \\ & (19 - 7) = 12 \text{ and } (4^3 - 2) = (64 - 2) = 62\\ = 2 - 12^2 \times 62 \qquad & \text{Evaluate exponents:} \ 12^2 = 144\\ = 2 - 144 \times 62 \qquad & \text{Multiply:} \ 144 \times 62 = 8928\\ = 2 - 8928 \qquad & \text{Subtract.}\\ = \text{-}8926 \qquad & \end{align}

Notice that even when an expression is inside parentheses, the order of operations still applies.

### Review

- Evaluate the following expressions involving variables.
- \begin{align*}2y^2\end{align*} when \begin{align*}x = 1\end{align*} and \begin{align*}y = 5\end{align*}
- \begin{align*}3x^2 + 2x + 1\end{align*} when \begin{align*}x = 5\end{align*}

- Use the order of operations to evaluate the expression.
- \begin{align*}2 + 7 \times 11 - 12 \div 3\end{align*}

- Evaluate the expression by substituting for the variables.
- \begin{align*}(y^2 - x)^2\end{align*} when \begin{align*}x = 2\end{align*} and \begin{align*}y = 1\end{align*}

For 4-6, use the order of operations to evaluate the expressions.

- \begin{align*}8 - (19 - (2 + 5) - 7)\end{align*}
- \begin{align*}(3 + 7) \div (7 - 12) \end{align*}
- \begin{align*}(4 - 1)^2 + 3^2 \cdot 2\end{align*}

For 7-10, insert parentheses in each expression to make a true equation.

- \begin{align*}5 - 2 \times 6 - 5 + 2 = 5\end{align*}
- \begin{align*}12 \div 4 + 10 - 3 \times 3 + 7 = 31\end{align*}
- \begin{align*}22 - 32 - 5 \times 3 - 5 = 30\end{align*}
- \begin{align*}12 - 8 - 4 \times 5 = \text{-}8\end{align*}

For 11-12, evaluate each expression using a graphing calculator.

- \begin{align*}x^2 + 2x - xy\end{align*} when \begin{align*}x = 250\end{align*} and \begin{align*}y = \text{-}120\end{align*}
- \begin{align*}(xy - y^4)^2\end{align*} when \begin{align*}x = 0.02\end{align*} and \begin{align*}y = \text{-}0.025\end{align*}

### Review (Answers)

To view the Review answers, open this PDF file and look for section 1.4.