Section 1.5 Order of Operations
Mathematical symbols are a means of communication, and it's important that when you write something, everyone else knows exactly what you intended. For example, if we say in English, “two times three squared,” do we mean that:
\(2\) is multiplied by \(3\text{,}\) and then the result is squared?
or that \(2\) is multiplied by the result of squaring \(3\text{?}\)
English is allowed to have ambiguities like this. But mathematical language needs to be precise and mean the same thing to everyone reading it. For this reason, a standard order of operations has been adopted, which we review here.
Subsection 1.5.1 Grouping Symbols
Consider the math expression \(2\cdot3^2\text{.}\) There are two mathematical operations here: a multiplication and an exponentiation. The result of this expression will change depending on which operation you decide to execute first: the multiplication or the exponentiation. If you multiply \(2\cdot3\text{,}\) and then square the result, you have \(36\text{.}\) If you square \(3\text{,}\) and then multiply \(2\) by the result, you have \(18\text{.}\) If we want all people everywhere to interpret \(2\cdot3^2\) in the same way, then only one of these can be correct.
The first tools that we have to tell readers what operations to execute first are grouping symbols, like parentheses and brackets. If you intend to execute the multiplication first, then writing
clearly tells your reader to do that. And if you intend to execute the power first, then writing
clearly tells your reader to do that.
To visualize the difference between \(2\cdot \left(3^2\right)\) or \((2\cdot 3)^2\text{,}\) consider these garden plots:
If we calculate \(3^2\text{,}\) we have the area of one of the small square garden plots on the left. If we then double that, we have \(2\cdot\left(3^2\right)\text{,}\) the area of the left garden plot.
But if we calculate \((2\cdot3)^2\text{,}\) then first we are doubling \(3\text{.}\) So we are calculating the area of a square garden plot whose sides are twice as long. We end up with the area of the garden plot on the right.
The point is that these amounts are different.
Checkpoint 1.5.3.
Subsection 1.5.2 Beyond Grouping Symbols
If all math expressions used grouping symbols for each and every arithmetic operation, we wouldn't need to say anything more here. In fact, some computer systems work that way, requiring the use of grouping symbols all the time. But it is much more common to permit math expressions with no grouping symbols at all, like \(5+3\cdot2\text{.}\) Should the addition \(5+3\) be executed first, or should the multiplication \(3\cdot2\text{?}\) We need what's known formally as the order of operations to tell us what to do.
The order of operations is nothing more than an agreement that we all have made to prioritize the arithmetic operations in a certain order.
A common acronym to help you remember this order of operations is PEMDAS. There are a handful of mnemonic devices for remembering this ordering (such as Please Excuse My Dear Aunt Sally, People Eat More Donuts After School, etc.).
We'll start with a few examples that only invoke a few operations each.
Example 1.5.5.
Use the order of operations to simplify the following expressions.
-
\(10+2\cdot 3\text{.}\) With this expression, we have the operations of addition and multiplication. The order of operations says the multiplication has higher priority, so execute that first:
\begin{align*} 10+2\cdot 3\amp =10+\nextoperation{2\cdot 3}\\ \amp=10+\highlight{6}\\ \amp=\highlight{16} \end{align*} -
\(4+10\div 2 - 1\text{.}\) With this expression, we have addition, division, and subtraction. According to the order of operations, the first thing we need to do is divide. After that, we'll apply the addition and subtraction, working left to right:
\begin{align*} 4+10\div2-1\amp=4+\nextoperation{10\div2}-1\\ \amp=\nextoperation{4+\highlight{5}}-1\\ \amp=\highlight{9}-1\\ \amp=\highlight{8} \end{align*} -
\(7-10+4\text{.}\) This example only has subtraction and addition. While the acronym PEMDAS may mislead you to do addition before subtraction, remember that these operations have the same priority, and so we work left to right when executing them:
\begin{align*} 7-10+4\amp=\nextoperation{7-10}+4\\ \amp=\highlight{-3}+4\\ \amp=1 \end{align*} -
\(20\div 4\cdot 7\text{.}\) This expression has only division and multiplication. Again, remember that although PEMDAS shows “MD,” the operations of multiplication and division have the same priority, so we'll apply them left to right:
\begin{align*} 20\div 4\cdot 5\amp=\nextoperation{20\div 4} \cdot 5\\ \amp=\highlight{5}\cdot5\\ \amp=\highlight{25} \end{align*} -
\((6+7)^2\text{.}\) With this expression, we have addition inside a set of parentheses, and an exponent of \(2\) outside of that. We must compute the operation inside the parentheses first, and after that we'll apply the exponent:
\begin{align*} (6+7)^2\amp= (\nextoperation{6+7})^2\\ \amp= \highlight{13}^2\\ \amp= \highlight{169} \end{align*} -
\(4(2)^3\text{.}\) This expression has multiplication and an exponent. There are parentheses too, but no operation inside them. Parentheses used in this manner make it clear that the \(4\) and \(2\) are separate numbers, not to be confused with \(42\text{.}\) In other words, \(4(2)^3\) and \(42^3\) mean very different things. Exponentiation has the higher priority, so we'll apply the exponent first, and then we'll multiply:
\begin{align*} 4(2)^3 \amp= 4\nextoperation{(2)^3}\\ \amp= 4(\highlight{8})\\ \amp= \highlight{32} \end{align*}
Remark 1.5.6.
There are many different ways that we write multiplication. We can use the symbols \(\cdot\text{,}\) \(\times\text{,}\) and \(*\) to denote multiplication. We can also use parentheses to denote multiplication, as we've seen in Example 1.5.5, Item f. Once we start working with variables, there is even another way. No matter how multiplication is written, it does not change the priority that multiplication has in the order of operations.
Checkpoint 1.5.7. Practice with order of operations.
Subsection 1.5.3 Absolute Value Bars, Radicals, and Fraction Bars are Grouping Symbols
When we first discussed grouping symbols, we only mentioned parentheses and brackets. Each of the following operations has an implied grouping symbol aside from parentheses and brackets.
- Absolute Value Bars
The absolute value bars, as in \(\abs{2-5}\text{,}\) group the expression inside it just like a set of parentheses would.
- Radicals
The same is true of the radical symbol — everything inside the radical is grouped, as with \(\sqrt{12-3}\text{.}\)
- Fraction Bars
With a horizontal division bar, the numerator is treated as one group and the denominator as another, as with \(\frac{2+3}{5-2}\text{.}\)
We don't need parentheses for these three things since the absolute value bars, radical, and horizontal division bar each denote this grouping on their own. As far as priority in the order of operations goes, it's important to remember that these work just like our most familiar grouping symbols, parentheses.
With absolute value bars and radicals, these grouping symbols also do something to what's inside (but only after the operations inside have been executed). For example, \(\abs{-2}=2\text{,}\) and \(\sqrt{9}=3\text{.}\)
Example 1.5.8.
Use the order of operations to simplify the following expressions.
-
\(4-3\abs{5-7}\text{.}\) For this expression, we'll treat the absolute value bars just like we treat parentheses. This implies we'll simplify what's inside the bars first, and then compute the absolute value. After that, we'll multiply and then finally subtract:
\begin{align*} 4-3\abs{5-7} \amp= 4-3\abs{\nextoperation{5-7}}\\ \amp= 4-3\nextoperation{\abs{\highlight{-2}}}\\ \amp= 4-\nextoperation{3(\highlight{2})}\\ \amp= 4-\highlight{6}\\ \amp= \highlight{-2} \end{align*}We may not do \(4-3=1\) first, because \(3\) is connected to the absolute value bars by multiplication (although implicitly), which has a higher order than subtraction.
-
\(8-\sqrt{5^2-8\cdot 2}\text{.}\) This expression has an expression inside the radical of \(5^2-8\cdot 2\text{.}\) We'll treat this radical like we would a set of parentheses, and simplify that internal expression first. We'll then apply the square root, and then our last step will be to subtract that expression from \(8\text{:}\)
\begin{align*} 8-\sqrt{5^2-8\cdot 2} \amp= 8-\sqrt{\nextoperation{5^2}-8\cdot 2}\\ \amp= 8-\sqrt{\highlight{25}-\nextoperation{8\cdot 2}}\\ \amp= 8-\sqrt{\nextoperation{25-\highlight{16}}}\\ \amp= 8-\nextoperation{\sqrt{\highlight{9}}}\\ \amp= 8-\highlight{3}\\ \amp= \highlight{5} \end{align*} -
\(\dfrac{2^4+3\cdot 6}{5-18\div 2}\text{.}\) For this expression, the first thing we want to do is to recognize that the main fraction bar serves as a separator that groups the numerator and groups the denominator. Another way this expression could be written is \((2^4+3\cdot6)\div(15-18\div 2)\text{.}\) This implies we'll simplify the numerator and denominator separately according to the order of operations (since there are implicit parentheses around each of these). As a final step we'll simplify the resulting fraction (which is division).
\begin{align*} \frac{2^4+3\cdot 6}{5-18\div 2} \amp= \frac{\nextoperation{2^4}+3\cdot 6}{5-\nextoperation{18\div 2}}\\ \amp=\frac{\highlight{16}+\nextoperation{3\cdot 6}}{\nextoperation{5-\highlight{9}}}\\ \amp=\frac{\nextoperation{16+\highlight{18}}}{\highlight{-4}}\\ \amp=\frac{\highlight{34}}{-4}\\ \amp=-\frac{17}{2} \end{align*}
Checkpoint 1.5.9. More Practice with Order of Operations.
Subsection 1.5.4 Negation and Distinguishing \((-a)^m\) from \(-a^m\)
We noted in the order of operations that using the negative sign to negate a number has the same priority as multiplication and division. To understand why this is, observe that \(-1\cdot 23=-23\text{,}\) just for one example. So negating \(23\) gives the same result as multiplying \(23\) by \(-1\text{.}\) For this reason, negation has the same priority in the order of operations as multiplication. This can be a source of misunderstandings.
How would you write a math expression that takes the number \(-4\) and squares it?
It does matter. The second option, \((-4)^2\) is squaring the number \(-4\text{.}\) The parentheses emphasize this.
But the expression \(-4^2\) is different. There are two actions in this expression: a negation and and exponentiation. According to the order of operations, the exponentiation has higher priority than the negation, so the exponent of \(2\) in \(-4^2\) applies to the \(4\) before the negative sign (multiplication by \(-1\)) is taken into account.
and this is not the same as \((-4)^2\text{,}\) which is positive \(16\text{.}\)
Warning 1.5.10. Negative Numbers Raised to Powers.
You may find yourself needing to raise a negative number to a power, and using a calculator to do the work for you. If you do not understand the issue described here, then you may get incorrect results.
For example, entering
-4^2
into a calculator will result in \(-16\text{,}\) the negative of \(4^2\text{.}\)But entering
(-4)^2
into a calculator will result in \(16\text{,}\) the square of \(-4\text{.}\)
Go ahead and try entering these into your own calculator.
Checkpoint 1.5.11. Negating and Raising to Powers.
Remark 1.5.12.
You might observe in the previous example that there is no difference between \(-4^3\) and \((-4)^3\text{.}\) It's true that the results are the same, \(-64\text{,}\) but the two expressions still do say different things. With \(-4^3\text{,}\) you raise to a power first, then negate. With \((-4)^3\text{,}\) you negate first, then raise to a power.
As was discussed in Subsection 1.1.6, if the base of a power is negative, then whether or not the result is positive or negative depends on if the exponent is even or odd. It depends on whether or not the factors can all be paired up to “cancel” negative signs, or if there will be a lone factor left by itself.
Subsection 1.5.5 More Examples
Here are some example exercises that involve applying the order of operations to more complicated expressions.
Carefully follow these examples, step by step. Then, try to work through the checkpoint exercises on your own. Afterwards, check your answers and then read through the worked out solution, if you don't obtain the correct answer, to see if you can determine your mistake.
Example 1.5.13.
Simplify \(10-4(5-7)^3\text{.}\)
For the expression \(10-4(5-7)^3\text{,}\) we have simplify what's inside parentheses first, then we'll apply the exponent, then multiply, and finally subtract:
Checkpoint 1.5.14.
Example 1.5.15.
Simplify \(6-(-8)^2\div 4+1\text{.}\)
To simplify \(6-(-8)^2\div 4+1\text{,}\) we'll first apply the exponent of \(2\) to \(-8\text{,}\) making sure to recall that \((-8)^2=64\text{.}\) After this, we'll apply division. As a final step, we'll be have subtraction and addition, which we'll apply working left-to-right:
Checkpoint 1.5.16.
Checkpoint 1.5.17.
Exercises 1.5.6 Exercises
Review and Warmup
1.
Multiply the following.
\((-10)\cdot(-1)\)
\((-4)\cdot4\)
\(8\cdot(-4)\)
\((-5)\cdot0\)
2.
Multiply the following.
\((-10)\cdot(-2)\)
\((-6)\cdot2\)
\(8\cdot(-1)\)
\((-4)\cdot0\)
3.
Multiply the following.
\((-3)\cdot(-6)\cdot(-2)\)
\(6\cdot(-7)\cdot(-3)\)
\((-85)\cdot(-77)\cdot0\)
4.
Multiply the following.
\((-2)\cdot(-4)\cdot(-5)\)
\(5\cdot(-7)\cdot(-1)\)
\((-83)\cdot(-65)\cdot0\)
5.
Compute \(-5^{3}\text{.}\)
Calculate the power \((-4)^{3}\text{.}\)
Find \(-6^{2}\text{.}\)
Calculate \(-2^{2}\text{.}\)
6.
Compute \(-6^{3}\text{.}\)
Calculate the power \(-2^{2}\text{.}\)
Find \((-1)^{64}\text{.}\)
Calculate \((-8)^{2}\text{.}\)
Order of Operations Skills
7.
Evaluate the following.
\(\displaystyle{ 5+8(8)= }\)
8.
Evaluate the following.
\(\displaystyle{ 8+5(8)= }\)
9.
Evaluate the following.
\(\displaystyle{ 2(5+3)= }\)
10.
Evaluate the following.
\(\displaystyle{ 5(2+4)= }\)
11.
Evaluate the following.
\(\displaystyle{ (2\cdot3)^{2}= }\)
12.
Evaluate the following.
\(\displaystyle{ (2\cdot2)^{2}= }\)
13.
Evaluate the following.
\(\displaystyle{ 3\cdot4^{3}= }\)
14.
Evaluate the following.
\(\displaystyle{ 4\cdot3^{2}= }\)
15.
Evaluate the following.
\(\displaystyle{ (6-4)\cdot5= }\)
16.
Evaluate the following.
\(\displaystyle{ (13-5)\cdot2= }\)
17.
Evaluate the following.
\(\displaystyle{ 21-5\cdot3= }\)
18.
Evaluate the following.
\(\displaystyle{ 26-5\cdot5= }\)
19.
Evaluate the following.
\(\displaystyle{ 1+4\cdot8= }\)
20.
Evaluate the following.
\(\displaystyle{ 3+3\cdot10= }\)
21.
Evaluate the following.
\(\displaystyle{ 2-5\cdot7= }\)
22.
Evaluate the following.
\(\displaystyle{ 3-4\cdot9= }\)
23.
Evaluate the following.
\(\displaystyle{ 3-3(-6)= }\)
24.
Evaluate the following.
\(\displaystyle{ 4-5(-8)= }\)
25.
Evaluate the following.
\(\displaystyle{ -[5-(4-7)^{2}]= }\)
26.
Evaluate the following.
\(\displaystyle{ -[1-(3-5)^{2}]= }\)
27.
Evaluate the following.
\(\displaystyle{ 9-8 [ 8-(2+3\cdot5)]= }\)
28.
Evaluate the following.
\(\displaystyle{ 5-3 [ 2-(9+3\cdot5)]= }\)
29.
Evaluate the following.
\(\displaystyle{ 4+3(20-2\cdot2^{3})= }\)
30.
Evaluate the following.
\(\displaystyle{ 4+2(42-5\cdot2^{3})= }\)
31.
Evaluate the following.
\(\displaystyle{ -3 [ 5-(5-2\cdot3)^{2}]= }\)
32.
Evaluate the following.
\(\displaystyle{ -4 [ 2-(9-5\cdot3)^{2}]= }\)
33.
Evaluate the following.
\(\displaystyle{ 19-3[3^{2}-(8-4)] = }\)
34.
Evaluate the following.
\(\displaystyle{ 48-2[5^{2}-(7-4)] = }\)
35.
Evaluate the following.
\(\displaystyle{ (17-4)^{2}+2(17-4^{2}) = }\)
36.
Evaluate the following.
\(\displaystyle{ (20-4)^{2}+4(20-4^{2}) = }\)
37.
Evaluate the following.
\(\displaystyle{ (2\cdot3)^{2} - 2\cdot3^{2} = }\)
38.
Evaluate the following.
\(\displaystyle{ (2\cdot3)^{2} - 2\cdot3^{2} = }\)
39.
Evaluate the following.
\(\displaystyle{ 4\cdot4^{2}-150\div5^{2}\cdot4+5 = }\)
40.
Evaluate the following.
\(\displaystyle{ 5\cdot3^{2}-16\div2^{2}\cdot4+9 = }\)
41.
Evaluate the following.
\(\displaystyle{ 4(8-3)^{2} - 4(8-3^{2}) = }\)
42.
Evaluate the following.
\(\displaystyle{ 2(7-3)^{2} - 2(7-3^{2}) = }\)
43.
Evaluate the following.
\(\displaystyle{ \frac{8+2}{7-5}= }\)
44.
Evaluate the following.
\(\displaystyle{ \frac{5+30}{11-6}= }\)
45.
Evaluate the following.
\(\displaystyle{ \frac{10^{2}-4^{2}}{3+11} = }\)
46.
Evaluate the following.
\(\displaystyle{ \frac{6^{2}-3^{2}}{5+4} = }\)
47.
Evaluate the following.
\(\displaystyle{ \frac{1-(-4)^{3}}{1-6} = }\)
48.
Evaluate the following.
\(\displaystyle{ \frac{1-(-4)^{3}}{6-11} = }\)
49.
Evaluate the following.
\(\displaystyle{ \frac{(-6)\cdot(-7)-(-2)\cdot3}{(-8)^{2}+(-66)} = }\)
50.
Evaluate the following.
\(\displaystyle{ \frac{(-6)\cdot(-1)-(-8)\cdot9}{(-8)^{2}+(-66)} = }\)
51.
Evaluate the following.
\(\displaystyle{ -\left| 4-8 \right| = }\)
52.
Evaluate the following.
\(\displaystyle{ -\left| 4-6 \right| = }\)
53.
Evaluate the following.
\(\displaystyle{ 5-9\left\lvert 3-9 \right\rvert + 1 = }\)
54.
Evaluate the following.
\(\displaystyle{ 5-7\left\lvert 1-7 \right\rvert + 1 = }\)
55.
Evaluate the following.
\(\displaystyle{ -9^{2}-\left\lvert 2\cdot(-7)\right\rvert = }\)
56.
Evaluate the following.
\(\displaystyle{ -8^{2}-\left\lvert 8\cdot(-3)\right\rvert = }\)
57.
Evaluate the following.
\(\displaystyle{ 4-4\left\lvert -7+(4-5)^{3}\right\rvert = }\)
58.
Evaluate the following.
\(\displaystyle{ 5-2\left\lvert -3+(3-5)^{3}\right\rvert = }\)
59.
Evaluate the following.
\(\displaystyle{ \frac{\left\lvert 27+(-4)^{3}\right\rvert }{-1} = }\)
60.
Evaluate the following.
\(\displaystyle{ \frac{\left\lvert 27+(-2)^{3}\right\rvert }{-1} = }\)
61.
Evaluate the following.
\(\displaystyle{ \left| \frac{27+(-2)^{3}}{-1} \right| = }\)
62.
Evaluate the following.
\(\displaystyle{ \left| \frac{27+(-4)^{3}}{-1} \right| = }\)
63.
Evaluate the following.
\(\displaystyle{ \frac{3\left\lvert 25-52 \right\rvert}{-8-(-1)^2} = }\)
64.
Evaluate the following.
\(\displaystyle{ \frac{-2\left\lvert 6-13 \right\rvert}{3-(-1)^2} = }\)
65.
Evaluate the following.
\(\displaystyle{ {{\frac{2}{7}}}+8\cdot{{\frac{8}{35}}}= }\)
66.
Evaluate the following.
\(\displaystyle{ {{\frac{4}{5}}}+2\cdot{{\frac{4}{25}}}= }\)
67.
Evaluate the following.
\(\displaystyle{ \left({{\frac{1}{2}}}-{{\frac{1}{4}}}\right)-5\left({{\frac{1}{4}}}-{{\frac{1}{2}}}\right)= }\)
68.
Evaluate the following.
\(\displaystyle{ \left({{\frac{7}{8}}}-{{\frac{9}{40}}}\right)-5\left({{\frac{9}{40}}}-{{\frac{7}{8}}}\right)= }\)
69.
Evaluate the following.
\(\displaystyle{ \left| {{\frac{7}{4}}}-{{\frac{5}{12}}}\right| -5\left| {{\frac{5}{12}}}-{{\frac{7}{4}}}\right| = }\)
70.
Evaluate the following.
\(\displaystyle{ \left| {{\frac{7}{10}}}-{{\frac{7}{20}}}\right| -5\left| {{\frac{7}{20}}}-{{\frac{7}{10}}}\right| = }\)
71.
Evaluate the following.
\(\displaystyle{ {{\frac{8}{9}}}+2\left({{\frac{5}{9}}}\right)^{2}= }\)
72.
Evaluate the following.
\(\displaystyle{ {{\frac{8}{9}}}+6\left({{\frac{1}{3}}}\right)^{2}= }\)
73.
Evaluate the following.
\(\displaystyle{{{\frac{1}{5}}} + {{\frac{5}{3}}} \div {{\frac{5}{3}}} - {{\frac{5}{4}}}=}\)
74.
Evaluate the following.
\(\displaystyle{{{\frac{1}{4}}} + {{\frac{2}{5}}} \div {{\frac{4}{5}}} - {{\frac{2}{5}}}=}\)
75.
Evaluate the following.
\(\displaystyle{ 3\sqrt{78 - 74}= }\)
76.
Evaluate the following.
\(\displaystyle{ 3\sqrt{19+62}= }\)
77.
Evaluate the following.
\(\displaystyle{ 4\sqrt{1+6\cdot4}= }\)
78.
Evaluate the following.
\(\displaystyle{ 4\sqrt{0+2\cdot2}= }\)
79.
Evaluate the following.
\(\displaystyle{ 8-4\sqrt{44+37}= }\)
80.
Evaluate the following.
\(\displaystyle{ 5-5\sqrt{86 - 70}= }\)
81.
Evaluate the following.
\(\displaystyle{ \sqrt{121} -3\sqrt{-7+11}= }\)
82.
Evaluate the following.
\(\displaystyle{ \sqrt{4} -4\sqrt{8+73}= }\)
83.
Evaluate the following.
\(\displaystyle{ \sqrt{-16+5^2}= }\)
84.
Evaluate the following.
\(\displaystyle{ \sqrt{12+2^2}= }\)
85.
Evaluate the following.
\(\displaystyle{ \sqrt{8^2+6^2}= }\)
86.
Evaluate the following.
\(\displaystyle{ \sqrt{9^2+12^2}= }\)
87.
Evaluate the following.
\(\displaystyle{ \frac{\sqrt{64}+6}{\sqrt{64}-6}= }\)
88.
Evaluate the following.
\(\displaystyle{ \frac{\sqrt{64}+7}{\sqrt{64}-7}= }\)
89.
Evaluate the following.
\(\displaystyle{ \frac{ \sqrt{-55+8\cdot7} + \left\lvert -12 - 50 \right\rvert }{-73-(-4)^3}=}\)
90.
Evaluate the following.
\(\displaystyle{ \frac{ \sqrt{82+9\cdot2} + \left\lvert -15 - 10 \right\rvert }{-20-(-3)^3}=}\)
91.
Evaluate the following.
\(\displaystyle{ 2[18-5(3+6)] = }\)
92.
Evaluate the following.
\(\displaystyle{ 2[16-7(1+6)] = }\)
93.
Evaluate the following.
\(\displaystyle{ -4^{2}-9[ 3-( 6-3^{3} ) ] = }\)
94.
Evaluate the following.
\(\displaystyle{ -4^{2}-7[ 7-( 4-3^{3} ) ] = }\)