Exponent Laws
A handful of rules let you combine and simplify powers without multiplying everything out. Each one follows directly from "an exponent counts copies of the base", so you never need to memorise them blindly: you can always rebuild them by counting.
The laws at a glance
For any base , (not zero where we divide) and whole-number exponents , :
| Law | Rule | Example |
|---|---|---|
| Product | ||
| Quotient | ||
| Power of a power | ||
| Power of a product | ||
| Power of a quotient |
Why they work: count the copies
Product law. is three 2s times four 2s:
So exponents add when you multiply powers of the same base.
Quotient law. In , two of the six 5s on top cancel with the two below, leaving . Exponents subtract.
Power of a power. means written three times: . Exponents multiply.
Power of a product. . Regroup the factors: .
Let Python confirm each one:
a, b, m, n = 2, 5, 3, 4
print("product :", a**m * a**n, "==", a**(m + n))
print("quotient:", 5**6 // 5**2, "==", 5**(6 - 2))
print("power :", (3**2)**3, "==", 3**(2 * 3))
print("product^:", (a * b)**m, "==", a**m * b**m)
from fractions import Fraction
q = Fraction(2, 3)
print("quotient^:", q**2, "==", Fraction(2**2, 3**2))product : 128 == 128
quotient: 625 == 625
power : 729 == 729
product^: 1000 == 1000
quotient^: 4/9 == 4/9
The mistakes everyone makes
The laws only work in the shapes shown above. Three look-alikes are false:
A quick numeric test catches all of them:
a, b = 3, 4
print("(a+b)^2 =", (a + b) ** 2)
print("a^2 + b^2 =", a**2 + b**2, " <- not equal")
print("a^2+2ab+b^2 =", a**2 + 2*a*b + b**2)
print("2^3 + 2^4 =", 2**3 + 2**4)
print("2^(3+4) =", 2**(3 + 4), " <- not equal")(a+b)^2 = 49
a^2 + b^2 = 25 <- not equal
a^2+2ab+b^2 = 49
2^3 + 2^4 = 24
2^(3+4) = 128 <- not equal
Tip: When you're unsure about an algebra step, plug in small numbers like 2 and 3. If the two sides disagree, the step is wrong. (If they agree, it might still be wrong, but usually it is fine.)
Simplifying with letters
The same rules work with variables. SymPy applies them automatically:
from sympy import symbols, simplify
x, y = symbols("x y")
print(x**3 * x**5)
print((x**2)**4)
print(simplify(x**7 / x**3))
print((2 * x * y**2)**3)x**8
x**8
x**4
8*x**3*y**6
SymPy prints powers with **, Python style, so x**8 means . The Algebra course uses these rules constantly. The last line is the power-of-a-product law: .
In software
- Fast exponentiation. To compute , you do not need 15 multiplications: square four times (), using . This "square-and-multiply" trick powers RSA and other cryptography, where exponents have hundreds of digits. Python's built-in
pow(base, exp, mod)uses it. - Bit shifts. Multiplying by shifts a binary number left by places; is why two shifts add up.
- Units. Area scales by the square and volume by the cube: if you scale a 3D model by 2, its volume grows by .
Exercises
Exercise 1: Combine
Simplify each to a single power, then compute it: , , .
Answer
, , .
Solution
Exercise 2: Letters
Simplify and .
Answer
and .
Solution
Exercise 3: True or false?
Decide which are true: (a) (b) (c) .
Answer
(a) true, (b) true, (c) false.
Solution
(a) Power of a product read backwards: . (b) . This is a lucky special case (two equal terms), not a general law. (c) but .
print(2**3 * 3**3 == 6**3, 2**3 + 2**3 == 2**4, (5 + 1)**2 == 5**2 + 1**2)True True False
Exercise 4: Square and multiply
Write fast_pow(x, n) that computes by repeated squaring, counting multiplications. Compare with the naive for .
Answer
fast_pow(3, 16) = 43046721 with 4 multiplications (naive needs 15).
Solution
Look at the bits of : square the base each step and multiply it into the result when the current bit is 1.
def fast_pow(x, n):
result, mults = 1, 0
while n > 0:
if n & 1:
if result != 1:
mults += 1
result *= x
n >>= 1
if n:
x *= x
mults += 1
return result, mults
print(fast_pow(3, 16), 3 ** 16)(43046721, 4) 43046721
in binary, so the base is squared four times (, , , ) and only the last value lands in the result.
Test yourself
Simplify .
Which equals ?
Which statement is false?