Section1.4Order 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.
Subsection1.4.1Grouping 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.
Exercise1.4.4
Try simplifying this expression, focusing on executing the content inside the grouping symbols first.
Subsection1.4.2Beyond 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.
Example1.4.6
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+\overbrace{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\div21\amp=4+\overbrace{10\div2}1\\ \amp=\overbrace{4+\highlight{5}}1\\ \amp=\highlight{9}1\\ \amp=\highlight{8} \end{align*} 
\(710+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*} 710+4\amp=\overbrace{710}+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=\overbrace{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= (\overbrace{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\overbrace{(2)^3}\\ \amp= 4(\highlight{8})\\ \amp= \highlight{32} \end{align*}
Remark1.4.7
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.4.6, 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.
Exercise1.4.8Practice with order of operations
Subsection1.4.3Absolute 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 examples has an implied grouping symbol aside from parentheses and brackets: absolute value bars, radicals, and fraction bars.
 Absolute Value Bars
The absolute value bars, as in \(\abs{25}\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{123}\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}{52}\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 the grouping symbols have been executed). For example, \(\abs{2}=2\text{,}\) and \(\sqrt{9}=3\text{.}\)
Example1.4.9
Use the order of operations to simplify the following expressions.

\(43\abs{57}\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*} 43\abs{57} \amp= 43\abs{\overbrace{57}}\\ \amp= 43\overbrace{\abs{\highlight{2}}}\\ \amp= 4\overbrace{3(\highlight{2})} \\ \amp= 4\highlight{6}\\ \amp= \highlight{2} \end{align*}We may not do \(43=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^28\cdot 2}\text{.}\) This expression has an expression inside the radical of \(5^28\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^28\cdot 2} \amp= 8\sqrt{\overbrace{5^2}8\cdot 2}\\ \amp= 8\sqrt{\highlight{25}\overbrace{8\cdot 2}}\\ \amp= 8\sqrt{\overbrace{25\highlight{16}}}\\ \amp= 8\overbrace{\sqrt{\highlight{9}}}\\ \amp= 8\highlight{3}\\ \amp= \highlight{5} \end{align*} 
\(\dfrac{2^4+3\cdot 6}{518\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(1518\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}{518\div 2} \amp= \frac{\overbrace{2^4}+3\cdot 6}{5\underbrace{18\div 2}}\\ \amp=\frac{\highlight{16}+\overbrace{3\cdot 6}}{5\highlight{9}}\\ \amp=\frac{16+\highlight{18}}{\highlight{4}}\\ \amp=\frac{\highlight{34}}{4}\\ \amp=\frac{17}{2} \end{align*}
Exercise1.4.10More Practice with Order of Operations
Subsection1.4.4Negation and Distinguishing \((a)^m\) from \(a^m\)
We noted in the 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?
Well, it does matter. Certainly the second option, \((4)^2\) is squaring the number \(4\text{.}\) The parentheses empasize this.
But the expression \(4^2\) is something 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\) is going to apply to the \(4\) before the negative sign (multiplication by \(1\)) ever gets taken into account. We would have:
and this is not the same as \((4)^2\text{,}\) which is positive \(16\text{.}\)
Warning1.4.11Negative 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.
Exercise1.4.12Negating and Raising to Powers
Remark1.4.13
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.5, 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.
Subsection1.4.5More Examples
Here are some example exercises that involve applying the order of operations to more complicated expressions. Try these exercises and read the steps given in each solution.
Exercise1.4.14Complications
Simplify \(104(57)^3\text{.}\)
Exercise1.4.15Complications
Exercise1.4.16Complications
Simplify \(6(8)^2\div 4+1\text{.}\)
Exercise1.4.17Complications
Exercise1.4.18Complications
Subsection1.4.6Exercises
Practice order of operations by simplifying these expressions.
1
Evaluate this expression:
\(\displaystyle{ 6+5(9)= }\)
2
Evaluate this expression:
\(\displaystyle{ 9+2(2)= }\)
3
Evaluate this expression:
\(\displaystyle{ 4(2+3)= }\)
4
Evaluate this expression:
\(\displaystyle{ 3(3+5)= }\)
5
Evaluate this expression:
\(\displaystyle{ (3\cdot2)^{2}= }\)
6
Evaluate this expression:
\(\displaystyle{ (3\cdot3)^{2}= }\)
7
Evaluate this expression:
\(\displaystyle{ 4\cdot2^{2}= }\)
8
Evaluate this expression:
\(\displaystyle{ 4\cdot4^{2}= }\)
9
Evaluate this expression:
\(\displaystyle{ (125)\cdot5= }\)
10
Evaluate this expression:
\(\displaystyle{ (95)\cdot3= }\)
11
Evaluate this expression:
\(\displaystyle{ 182\cdot5= }\)
12
Evaluate this expression:
\(\displaystyle{ 102\cdot4= }\)
13
Evaluate this expression:
\(\displaystyle{ 3+2\cdot8= }\)
14
Evaluate this expression:
\(\displaystyle{ 4+5\cdot10= }\)
15
Evaluate this expression:
\(\displaystyle{ 34\cdot7= }\)
16
Evaluate this expression:
\(\displaystyle{ 32\cdot10= }\)
17
Evaluate this expression:
\(\displaystyle{ 45(7)= }\)
18
Evaluate this expression:
\(\displaystyle{ 53(9)= }\)
19
Evaluate this expression:
\(\displaystyle{ [8(47)^{2}]= }\)
20
Evaluate this expression:
\(\displaystyle{ [5(18)^{2}]= }\)
21
Evaluate this expression:
\(\displaystyle{ 53 [ 9(3+2\cdot5)]= }\)
22
Evaluate this expression:
\(\displaystyle{ 62 [ 4(10+2\cdot3)]= }\)
23
Evaluate this expression:
\(\displaystyle{ 2+4(455\cdot2^{3})= }\)
24
Evaluate this expression:
\(\displaystyle{ 2+3(263\cdot2^{3})= }\)
25
Evaluate this expression:
\(\displaystyle{ 4 [ 1(55\cdot2)^{2}]= }\)
26
Evaluate this expression:
\(\displaystyle{ 4 [ 8(106\cdot2)^{2}]= }\)
27
Evaluate this expression:
\(\displaystyle{ 294[3^{2}(75)] = }\)
28
Evaluate this expression:
\(\displaystyle{ 1063[6^{2}(65)] = }\)
29
Evaluate this expression:
\(\displaystyle{ (82)^{2}+2(82^{2}) }\)
30
Evaluate this expression:
\(\displaystyle{ (62)^{2}+4(62^{2}) }\)
31
Evaluate this expression:
\(\displaystyle{ (2\cdot5)^{2}  2\cdot5^{2} = }\)
32
Evaluate this expression:
\(\displaystyle{ (3\cdot4)^{2}  3\cdot4^{2} = }\)
33
Evaluate this expression:
\(\displaystyle{ 6\cdot3^{2}150\div5^{2}\cdot2+9 = }\)
34
Evaluate this expression:
\(\displaystyle{ 7\cdot5^{2}45\div3^{2}\cdot2+5 = }\)
35
Evaluate this expression:
\(\displaystyle{ 5(84)^{2}  5(84^{2}) = }\)
36
Evaluate this expression:
\(\displaystyle{ 2(74)^{2}  2(74^{2}) = }\)
37
Evaluate this expression:
\(\displaystyle{ \frac{9+16}{116} }\)
38
Evaluate this expression:
\(\displaystyle{ \frac{6+18}{41} }\)
39
Evaluate this expression:
\(\displaystyle{ \frac{6^{2}2^{2}}{3+5} = }\)
40
Evaluate this expression:
\(\displaystyle{ \frac{7^{2}5^{2}}{7+5} = }\)
41
Evaluate this expression:
\(\displaystyle{ \frac{1(2)^{3}}{36} = }\)
42
Evaluate this expression:
\(\displaystyle{ \frac{1(2)^{3}}{710} = }\)
43
Evaluate this expression:
\(\displaystyle{ \frac{(6)\cdot(1)(10)\cdot3}{(2)^{2}+(6)} = }\)
44
Evaluate this expression:
\(\displaystyle{ \frac{(4)\cdot(5)(6)\cdot9}{(2)^{2}+(6)} = }\)
45
Evaluate this expression:
\(\displaystyle{ \left 45 \right = }\)
46
Evaluate this expression:
\(\displaystyle{ \left 59 \right = }\)
47
Evaluate this expression:
\(\displaystyle{ 15\left\lvert 45 \right\rvert + 8 = }\)
48
Evaluate this expression:
\(\displaystyle{ 12\left\lvert 18 \right\rvert + 8 = }\)
49
Evaluate this expression:
\(\displaystyle{ 7^{2}\left\lvert 6\cdot(5)\right\rvert = }\)
50
Evaluate this expression:
\(\displaystyle{ 6^{2}\left\lvert 4\cdot(3)\right\rvert = }\)
51
Evaluate this expression:
\(\displaystyle{ 52\left\lvert 5+(47)^{3}\right\rvert = }\)
52
Evaluate this expression:
\(\displaystyle{ 66\left\lvert 1+(47)^{3}\right\rvert = }\)
53
Evaluate this expression:
\(\displaystyle{ \frac{\left\lvert 27+(2)^{3}\right\rvert }{1} = }\)
54
Evaluate this expression:
\(\displaystyle{ \frac{\left\lvert 27+(4)^{3}\right\rvert }{1} = }\)
55
Evaluate this expression:
\(\displaystyle{ \left \frac{27+(4)^{3}}{1} \right = }\)
56
Evaluate this expression:
\(\displaystyle{ \left \frac{1+(2)^{3}}{1} \right = }\)
57
Evaluate this expression:
\(\displaystyle{ \frac{2\left\lvert 820 \right\rvert}{7(2)^2} = }\)
58
Evaluate this expression:
\(\displaystyle{ \frac{5\left\lvert 17 \right\rvert}{10(2)^2} = }\)
59
Evaluate this expression:
\(\displaystyle{ {{\frac{4}{3}}}+8\cdot{{\frac{2}{3}}}= }\)
60
Evaluate this expression:
\(\displaystyle{ {{\frac{2}{3}}}+2\cdot{{\frac{1}{6}}}= }\)
61
Evaluate this expression:
\(\displaystyle{ \left({{\frac{7}{6}}}{{\frac{7}{12}}}\right)4\left({{\frac{7}{12}}}{{\frac{7}{6}}}\right)= }\)
62
Evaluate this expression:
\(\displaystyle{ \left({{\frac{7}{2}}}{{\frac{9}{10}}}\right)4\left({{\frac{9}{10}}}{{\frac{7}{2}}}\right)= }\)
63
Evaluate this expression:
\(\displaystyle{ \left {{\frac{9}{10}}}{{\frac{1}{8}}}\right 4\left {{\frac{1}{8}}}{{\frac{9}{10}}}\right = }\)
64
Evaluate this expression:
\(\displaystyle{ \left {{\frac{3}{2}}}{{\frac{1}{2}}}\right 4\left {{\frac{1}{2}}}{{\frac{3}{2}}}\right = }\)
65
Evaluate this expression:
\(\displaystyle{ {{\frac{1}{3}}}+4\left({{\frac{2}{3}}}\right)^{2}= }\)
66
Evaluate this expression:
\(\displaystyle{ {{\frac{2}{3}}}+8\left({{\frac{2}{3}}}\right)^{2}= }\)
67
Evaluate this expression:
\(\displaystyle{{{\frac{2}{3}}} + {{\frac{1}{4}}} \div {{\frac{3}{4}}}  {{\frac{1}{2}}}=}\)
68
Evaluate this expression:
\(\displaystyle{{{\frac{2}{3}}} + {{\frac{2}{3}}} \div {{\frac{4}{5}}}  {{\frac{1}{2}}}=}\)
69
Evaluate this expression:
\(\displaystyle{ 3\sqrt{91  27}= }\)
70
Evaluate this expression:
\(\displaystyle{ 4\sqrt{33  17}= }\)
71
Evaluate this expression:
\(\displaystyle{ 4\sqrt{34+7\cdot5}= }\)
72
Evaluate this expression:
\(\displaystyle{ 5\sqrt{55+3\cdot3}= }\)
73
Evaluate this expression:
\(\displaystyle{ 95\sqrt{58  42}= }\)
74
Evaluate this expression:
\(\displaystyle{ 62\sqrt{100  99}= }\)
75
Evaluate this expression:
\(\displaystyle{ \sqrt{9} 3\sqrt{4+68}= }\)
76
Evaluate this expression:
\(\displaystyle{ \sqrt{16} 5\sqrt{10+35}= }\)
77
Evaluate this expression:
\(\displaystyle{ \sqrt{75+10^2}= }\)
78
Evaluate this expression:
\(\displaystyle{ \sqrt{13+7^2}= }\)
79
Evaluate this expression:
\(\displaystyle{ \sqrt{9^2+12^2}= }\)
80
Evaluate this expression:
\(\displaystyle{ \sqrt{12^2+5^2}= }\)
81
Evaluate this expression:
\(\displaystyle{ \frac{\sqrt{64}+6}{\sqrt{64}6}= }\)
82
Evaluate this expression:
\(\displaystyle{ \frac{\sqrt{81}+3}{\sqrt{81}3}= }\)
83
Evaluate this expression:
\(\displaystyle{ \frac{ \sqrt{9+3\cdot9} + \left\lvert 11  3 \right\rvert }{130(5)^3} }\)
84
Evaluate this expression:
\(\displaystyle{ \frac{ \sqrt{14+6\cdot3} + \left\lvert 14  40 \right\rvert }{9(1)^3} }\)
85
Evaluate this expression:
\(\displaystyle{ 2[165(5+4)] = }\)
86
Evaluate this expression:
\(\displaystyle{ 4[207(3+4)] = }\)
87
Evaluate this expression:
\(\displaystyle{ 6^{2}7[ 5( 72^{3} ) ] = }\)
88
Evaluate this expression:
\(\displaystyle{ 6^{2}3[ 9( 52^{3} ) ] = }\)