# How to distribute exponentiation over multiplication?

I would expect the following:

FullSimplify[(a*b)^i, a > 0 && b > 0 && i > 0]


to give me a^i * b^i as output. Much like (a*b)^2 is immediately reduced to a^2 * b^2. How can I achieve this?

• Generally speaking LeafCount[(a b)^i] < LeafCount[a^i b^i], so it would require some special simplification rule for Simplify to give you what you want. As I understand it, the (a b)^2 case is not being simplified, but simply processed that way by the parser before evaluation. Apr 4, 2019 at 17:46
• Distribute[(a*b)^i,Times, Power]
– chuy
Apr 4, 2019 at 17:47

As mentioned in the comments, the default ComplexityFunction considers a^i b^i to be more complex than (a b)^i, hence your desired form will not be returned.

Besides using PowerExpand, you could also use a ComplexityFunction that penalizes complex expressions in the base of Power objects:

cf[expr_] := LeafCount[expr] + Total @ Cases[expr, Power[a_, _] :> 10 LeafCount[a], All]
FullSimplify[
(a b)^i,
a>0 && b>0 && i>0,
ComplexityFunction -> cf
]


a^i b^i

(a*b)^i // PowerExpand


a^i b^i

As @MarcoB points out, there are many assumptions here, detailed in the documentation: in this case, it is assumed that i is an integer and a and b are positive real numbers.

• ... with the usual caveat that PowerExpand makes some assumptions (real values of variables), which happen to be upheld in this particular case. Apr 4, 2019 at 17:44

The simple ComplexityFunction

cf[e_] := LeafCount[e] + 10 Count[e, _Times]


also works:

FullSimplify[(a b)^i, a > 0 && b > 0 && i > 0, ComplexityFunction -> cf]
(* a^i b^i *)


If (a b)^i lies lower in the expression, then its level must be specified. For instance,

cf2[e_] := LeafCount[e] + 10 Count[e, _Times, {2}]
FullSimplify[1 + (a b)^i, a > 0 && b > 0 && i > 0, ComplexityFunction -> cf2]
(* 1 + a^i b^i *)