Sub topic 9
Negative numbers and exponents: -3^2 versus (-3)^2
This chapter assumes you can add, subtract, multiply, and divide signed integers. It also assumes you know the order of operations from earlier chapters: grouping first, then exponents, then multiplication and division, then addition and subtraction. Here you will see why -3^2 and (-3)^2 have different values, how to evaluate each one, and which errors come up most often.
The two expressions
The expressions -3^2 and (-3)^2 look almost identical, but they have different values:
-3^2equals -9.(-3)^2equals 9.
The difference comes from what the exponent attaches to. An exponent applies only to the symbol directly next to it. In 3^2 the base is 3. A minus sign written in front of 3^2 is a separate operation applied afterward. It is not part of the base.
When you write (-3)^2, the parentheses make -3 a single value, so that value is the base.
Two meanings of the minus sign
The minus sign does two jobs:
- Subtraction is a binary operation. It sits between two numbers, as in
7 - 3. - Negation is a unary operation. It acts on one number, as in the
-in-3. Negation flips the sign of the value after it.
In -3^2 the minus sign is negation applied to the whole expression 3^2. Negation has the same rank as multiplying by -1, so it is evaluated after the exponent:
- Evaluate the exponent:
3^2 = 9. - Negate the result:
-9.
In (-3)^2 the parentheses force negation to happen first:
- Evaluate inside the parentheses:
-3. - Apply the exponent:
(-3) × (-3) = 9.
A negative number is not "stuck" to its digits unless you group it. Writing -3^2 is the same as writing -(3^2).
Checking in Python
Python follows the same rule. The exponent operator ** binds tighter than a unary minus on its left.
print(-3 ** 2) # -9: the exponent applies to 3 first, then the minus sign
print((-3) ** 2) # 9: the parentheses make -3 the baseThe same pattern works across several cases:
for text in ["-3 ** 2", "(-3) ** 2", "-3 ** 3", "(-3) ** 3",
"10 - 3 ** 2", "(10 - 3) ** 2", "-2 * -3 ** 2"]:
print(text, "=", eval(text))The loop prints these values:
-3 ** 2is -9.(-3) ** 2is 9.-3 ** 3is -27.(-3) ** 3is -27.10 - 3 ** 2is 1.(10 - 3) ** 2is 49.-2 * -3 ** 2is 18.
Use eval here only because the strings are fixed and written by you. Never use it on text a user typed.
Why the odd and even exponents behave differently
Parentheses change the result only sometimes. Compare these:
| Expression | Base | Result |
|---|---|---|
| `-3^2` | 3 | -9 |
| `(-3)^2` | -3 | 9 |
| `-3^3` | 3 | -27 |
| `(-3)^3` | -3 | -27 |
With an odd exponent, both readings give -27. With an even exponent, they differ. The reason is that multiplying an even number of negative factors gives a positive product, and an odd number gives a negative product:
(-3)^2 = (-3)(-3) = 9(-3)^3 = (-3)(-3)(-3) = 9 × (-3) = -27(-3)^4 = 81
So (-3)^n alternates in sign as n increases. The expression -3^n is always negative, because you negate a positive number.
Do not conclude that the parentheses are "optional" for odd exponents. They are not. The two expressions are equal there by coincidence of sign, and you should still write them correctly.
Worked examples
Example 1: a leading minus in a longer expression
Evaluate 4 - 3^2.
- Exponent first:
3^2 = 9. - Subtract:
4 - 9 = -5.
Here the minus sign is subtraction, not negation. It has nothing to do with the base.
Example 2: subtracting a negative base
Evaluate 4 - (-3)^2.
- Parentheses and exponent:
(-3)^2 = 9. - Subtract:
4 - 9 = -5.
Both examples give -5, because 4 - 3^2 and 4 - (-3)^2 involve the same number 9. The next example separates the two cases.
Example 3: negation versus subtraction of a negative
Evaluate 4 - -3^2.
- Exponent:
3^2 = 9. - Negation:
-9. - Subtract:
4 - (-9) = 13.
Compare this with 4 - (-3)^2 = -5. The value changes from 13 to -5 depending on whether the base includes the sign.
Example 4: a negative fraction as the base
Evaluate (-2/3)^2 and -(2/3)^2.
from fractions import Fraction
print(Fraction(-2, 3) ** 2) # 4/9: the base is -2/3
print(-Fraction(2, 3) ** 2) # -4/9: the exponent applies to 2/3, then negate
print(Fraction(-2, 3) ** 3) # -8/27: an odd exponent keeps the negative signThe reasoning mirrors integers. In (-2/3)^2 the whole fraction, sign included, is multiplied by itself: (-2/3)(-2/3) = 4/9. In -(2/3)^2 the square gives 4/9, and the leading minus sign makes it -4/9.
Common errors
- Reading
-3^2as 9. Many calculators and spreadsheets handle this differently from a written textbook expression. Excel, for example, evaluates=-3^2as 9 because it applies negation before the exponent. Python and most programming languages give -9. When you see-3^2in written math, read it as -9. When you type it into a tool, add parentheses to remove any doubt. - Dropping parentheses when entering a negative base. On a calculator, type
(-3)^2, not-3^2, if you mean 9. - Confusing the sign with the operation. In
5 - -3, the first minus is subtraction and the second is negation. The result is5 - (-3) = 8. - Squaring a negative inside a sum. In
(x - 3)^2the exponent applies to the whole difference, not just to 3. - Assuming an odd exponent hides the problem.
-3^3and(-3)^3are both -27, but only because of how signs multiply.
Summary of the rule
An exponent applies to the nearest base only. A bare minus sign in front of a power is evaluated after the exponent. Parentheses are the only way to put the sign inside the base.
Exercise
Evaluate each expression by hand, then confirm with Python: (a) -4^2, (b) (-4)^2, (c) 5 - (-2)^3, (d) -(1/2)^2 + 1.
Show answer
(a) The base is 4, so 4^2 = 16, and negating gives -16. (b) The base is -4, so (-4)(-4) = 16. (c) (-2)^3 = -8, then 5 - (-8) = 13. (d) (1/2)^2 = 1/4, negating gives -1/4, and adding 1 gives 3/4. In Python: print(-4 2), print((-4) 2), print(5 - (-2) 3), and print(-Fraction(1, 2) 2 + 1) after importing Fraction from fractions.
Exercise
A classmate says that -5^2 equals 25 "because a negative times a negative is positive." Explain the mistake and give the correct value.
Show answer
Only one 5 appears in the base, and there is no second negative number to multiply by. The expression means -(5^2), so you square 5 to get 25 and then negate, giving -25. If the intended value were 25, the expression would need to be written (-5)^2.