Section A.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 A.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 A.5.1.4.
Subsection A.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 A.5.2.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+\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\div21\amp=4+\nextoperation{10\div2}1\\ \amp=\nextoperation{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=\nextoperation{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=\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 A.5.2.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 A.5.2.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.
Checkpoint A.5.2.8. Practice with order of operations.
Subsection A.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{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 have been executed). For example, \(\abs{2}=2\text{,}\) and \(\sqrt{9}=3\text{.}\)
Example A.5.3.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{\nextoperation{57}}\\ \amp= 43\nextoperation{\abs{\highlight{2}}}\\ \amp= 4\nextoperation{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{\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}{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{\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 A.5.3.10. More Practice with Order of Operations.
Subsection A.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 A.5.4.11. 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 A.5.4.12. Negating and Raising to Powers.
Remark A.5.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 A.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.
Subsection A.5.5 More 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.
Example A.5.5.14.
Simplify \(104(57)^3\text{.}\)
For the expression \(104(57)^3\text{,}\) we have simplify what's inside parentheses first, then we'll apply the exponent, then multiply, and finally subtract:
Checkpoint A.5.5.15.
Example A.5.5.16.
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 lefttoright:
Checkpoint A.5.5.17.
Checkpoint A.5.5.18.
Exercises A.5.6 Exercises
Review and Warmup
1.
Multiply the following.
\((9)\cdot(1)\)
\((7)\cdot3\)
\(9\cdot(4)\)
\((8)\cdot0\)
2.
Multiply the following.
\((9)\cdot(2)\)
\((5)\cdot7\)
\(9\cdot(7)\)
\((7)\cdot0\)
3.
Multiply the following.
\((1)\cdot(6)\cdot(2)\)
\(5\cdot(6)\cdot(3)\)
\((90)\cdot(68)\cdot0\)
4.
Multiply the following.
\((1)\cdot(4)\cdot(4)\)
\(4\cdot(6)\cdot(5)\)
\((88)\cdot(56)\cdot0\)
5.
Compute \(8^{2}\text{.}\)
Calculate the power \(3^{2}\text{.}\)
Find \(6^{2}\text{.}\)
Calculate \((1)^{19}\text{.}\)
6.
Compute \(1^{40}\text{.}\)
Calculate the power \((2)^{4}\text{.}\)
Find \(4^{4}\text{.}\)
Calculate \(8^{2}\text{.}\)
Order of Operations Skills
7.
Evaluate the following.
\(\displaystyle{ 6+7(3)= }\)
8.
Evaluate the following.
\(\displaystyle{ 2+4(4)= }\)
9.
Evaluate the following.
\(\displaystyle{ 5(3+3)= }\)
10.
Evaluate the following.
\(\displaystyle{ 4(4+5)= }\)
11.
Evaluate the following.
\(\displaystyle{ (3\cdot2)^{2}= }\)
12.
Evaluate the following.
\(\displaystyle{ (4\cdot4)^{2}= }\)
13.
Evaluate the following.
\(\displaystyle{ 5\cdot3^{2}= }\)
14.
Evaluate the following.
\(\displaystyle{ 5\cdot2^{3}= }\)
15.
Evaluate the following.
\(\displaystyle{ (122)\cdot5= }\)
16.
Evaluate the following.
\(\displaystyle{ (82)\cdot3= }\)
17.
Evaluate the following.
\(\displaystyle{ 143\cdot2= }\)
18.
Evaluate the following.
\(\displaystyle{ 173\cdot5= }\)
19.
Evaluate the following.
\(\displaystyle{ 6+4\cdot8= }\)
20.
Evaluate the following.
\(\displaystyle{ 7+2\cdot6= }\)
21.
Evaluate the following.
\(\displaystyle{ 45\cdot8= }\)
22.
Evaluate the following.
\(\displaystyle{ 53\cdot10= }\)
23.
Evaluate the following.
\(\displaystyle{ 52(7)= }\)
24.
Evaluate the following.
\(\displaystyle{ 15(9)= }\)
25.
Evaluate the following.
\(\displaystyle{ [1(25)^{2}]= }\)
26.
Evaluate the following.
\(\displaystyle{ [10(27)^{2}]= }\)
27.
Evaluate the following.
\(\displaystyle{ 75 [ 10(1+4\cdot3)]= }\)
28.
Evaluate the following.
\(\displaystyle{ 73 [ 4(8+4\cdot5)]= }\)
29.
Evaluate the following.
\(\displaystyle{ 6+3(592\cdot3^{3})= }\)
30.
Evaluate the following.
\(\displaystyle{ 6+2(1104\cdot3^{3})= }\)
31.
Evaluate the following.
\(\displaystyle{ 5 [ 4(52\cdot5)^{2}]= }\)
32.
Evaluate the following.
\(\displaystyle{ 5 [ 10(34\cdot2)^{2}]= }\)
33.
Evaluate the following.
\(\displaystyle{ 423[4^{2}(51)] = }\)
34.
Evaluate the following.
\(\displaystyle{ 742[6^{2}(42)] = }\)
35.
Evaluate the following.
\(\displaystyle{ (92)^{2}+3(92^{2}) = }\)
36.
Evaluate the following.
\(\displaystyle{ (133)^{2}+4(133^{2}) = }\)
37.
Evaluate the following.
\(\displaystyle{ (4\cdot3)^{2}  4\cdot3^{2} = }\)
38.
Evaluate the following.
\(\displaystyle{ (4\cdot5)^{2}  4\cdot5^{2} = }\)
39.
Evaluate the following.
\(\displaystyle{ 8\cdot4^{2}125\div5^{2}\cdot4+5 = }\)
40.
Evaluate the following.
\(\displaystyle{ 9\cdot2^{2}36\div3^{2}\cdot4+9 = }\)
41.
Evaluate the following.
\(\displaystyle{ 5(94)^{2}  5(94^{2}) = }\)
42.
Evaluate the following.
\(\displaystyle{ 6(62)^{2}  6(62^{2}) = }\)
43.
Evaluate the following.
\(\displaystyle{ \frac{5+1}{32}= }\)
44.
Evaluate the following.
\(\displaystyle{ \frac{4+6}{72}= }\)
45.
Evaluate the following.
\(\displaystyle{ \frac{8^{2}3^{2}}{3+8} = }\)
46.
Evaluate the following.
\(\displaystyle{ \frac{8^{2}2^{2}}{7+3} = }\)
47.
Evaluate the following.
\(\displaystyle{ \frac{27(4)^{3}}{310} = }\)
48.
Evaluate the following.
\(\displaystyle{ \frac{27(2)^{3}}{712} = }\)
49.
Evaluate the following.
\(\displaystyle{ \frac{(2)\cdot(9)(10)\cdot9}{(6)^{2}+(38)} = }\)
50.
Evaluate the following.
\(\displaystyle{ \frac{(2)\cdot(3)(6)\cdot7}{(6)^{2}+(38)} = }\)
51.
Evaluate the following.
\(\displaystyle{ \left 15 \right = }\)
52.
Evaluate the following.
\(\displaystyle{ \left 12 \right = }\)
53.
Evaluate the following.
\(\displaystyle{ 27\left\lvert 49 \right\rvert + 3 = }\)
54.
Evaluate the following.
\(\displaystyle{ 36\left\lvert 16 \right\rvert + 3 = }\)
55.
Evaluate the following.
\(\displaystyle{ 5^{2}\left\lvert 8\cdot(5)\right\rvert = }\)
56.
Evaluate the following.
\(\displaystyle{ 4^{2}\left\lvert 6\cdot(9)\right\rvert = }\)
57.
Evaluate the following.
\(\displaystyle{ 84\left\lvert 5+(45)^{3}\right\rvert = }\)
58.
Evaluate the following.
\(\displaystyle{ 98\left\lvert 1+(35)^{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 1+(2)^{3}\right\rvert }{1} = }\)
61.
Evaluate the following.
\(\displaystyle{ \left \frac{1+(4)^{3}}{3} \right = }\)
62.
Evaluate the following.
\(\displaystyle{ \left \frac{1+(4)^{3}}{3} \right = }\)
63.
Evaluate the following.
\(\displaystyle{ \frac{3\left\lvert 512 \right\rvert}{6(3)^2} = }\)
64.
Evaluate the following.
\(\displaystyle{ \frac{3\left\lvert 17 \right\rvert}{7(1)^2} = }\)
65.
Evaluate the following.
\(\displaystyle{ {{\frac{8}{7}}}+8\cdot{{\frac{3}{7}}}= }\)
66.
Evaluate the following.
\(\displaystyle{ {{\frac{8}{3}}}+2\cdot{{\frac{2}{3}}}= }\)
67.
Evaluate the following.
\(\displaystyle{ \left({{\frac{9}{10}}}{{\frac{7}{50}}}\right)2\left({{\frac{7}{50}}}{{\frac{9}{10}}}\right)= }\)
68.
Evaluate the following.
\(\displaystyle{ \left({{\frac{3}{2}}}{{\frac{1}{8}}}\right)2\left({{\frac{1}{8}}}{{\frac{3}{2}}}\right)= }\)
69.
Evaluate the following.
\(\displaystyle{ \left {{\frac{3}{2}}}{{\frac{5}{6}}}\right 2\left {{\frac{5}{6}}}{{\frac{3}{2}}}\right = }\)
70.
Evaluate the following.
\(\displaystyle{ \left {{\frac{3}{8}}}{{\frac{9}{16}}}\right 2\left {{\frac{9}{16}}}{{\frac{3}{8}}}\right = }\)
71.
Evaluate the following.
\(\displaystyle{ {{\frac{1}{5}}}+4\left({{\frac{3}{5}}}\right)^{2}= }\)
72.
Evaluate the following.
\(\displaystyle{ {{\frac{3}{5}}}+8\left({{\frac{2}{5}}}\right)^{2}= }\)
73.
Evaluate the following.
\(\displaystyle{{{\frac{3}{4}}} + {{\frac{1}{3}}} \div {{\frac{1}{3}}}  {{\frac{4}{5}}}=}\)
74.
Evaluate the following.
\(\displaystyle{{{\frac{4}{3}}} + {{\frac{3}{5}}} \div {{\frac{1}{5}}}  {{\frac{5}{2}}}=}\)
75.
Evaluate the following.
\(\displaystyle{ 4\sqrt{94  93}= }\)
76.
Evaluate the following.
\(\displaystyle{ 5\sqrt{36+28}= }\)
77.
Evaluate the following.
\(\displaystyle{ 5\sqrt{8+8\cdot3}= }\)
78.
Evaluate the following.
\(\displaystyle{ 2\sqrt{73+3\cdot9}= }\)
79.
Evaluate the following.
\(\displaystyle{ 72\sqrt{61  25}= }\)
80.
Evaluate the following.
\(\displaystyle{ 43\sqrt{2+7}= }\)
81.
Evaluate the following.
\(\displaystyle{ \sqrt{36} 3\sqrt{9+130}= }\)
82.
Evaluate the following.
\(\displaystyle{ \sqrt{49} 5\sqrt{6+58}= }\)
83.
Evaluate the following.
\(\displaystyle{ \sqrt{33+4^2}= }\)
84.
Evaluate the following.
\(\displaystyle{ \sqrt{36+10^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{81}+3}{\sqrt{81}3}= }\)
88.
Evaluate the following.
\(\displaystyle{ \frac{\sqrt{4}+6}{\sqrt{4}6}= }\)
89.
Evaluate the following.
\(\displaystyle{ \frac{ \sqrt{8+6\cdot4} + \left\lvert 16  7 \right\rvert }{67(4)^3}=}\)
90.
Evaluate the following.
\(\displaystyle{ \frac{ \sqrt{1+8\cdot3} + \left\lvert 18  7 \right\rvert }{2(2)^3}=}\)
91.
Evaluate the following.
\(\displaystyle{ 4[175(3+8)] = }\)
92.
Evaluate the following.
\(\displaystyle{ 4[153(1+8)] = }\)
93.
Evaluate the following.
\(\displaystyle{ 8^{2}9[ 5( 64^{3} ) ] = }\)
94.
Evaluate the following.
\(\displaystyle{ 10^{2}5[ 9( 44^{3} ) ] = }\)
Challenge
95.
In this challenge, your job is to create expressions, using addition, subtraction, multiplication, and parentheses. You may use the numbers, \(1, 2, 3\text{,}\) and \(4\) in your expression, using each number only once. For example, you could make the expression: \(1+2 \cdot 3  4\text{.}\)
The greatest value that it is possible to create under these conditions is .
The least value that it is possible to create under these conditions is .