# Expression arrange by base

I have an expression with multiple powers, for example

N^α/(B*N)^β


Any simplification like FullSimplify leads to

$$N^\alpha (NB)^{-\beta}$$

How do I separate the different bases? I want to have the expression organized like

$$N^{\alpha - \beta} B^{-\beta}$$

and in a more complicated expression with many different bases, I want them all separated. None of the functions described here is suitable for this.

Try this:

expr = n^a/(n*b)^c;
expr // PowerExpand

(*  b^-c n^(a - c)   *)


Do not use the capital N since in Mma it is a service word.

Have fun!

• I do not want to have the the terms sorted by powers, but rather by bases - this appears not to do what I want. – FooBar Nov 22 '19 at 14:09
• I do not see any difference between the result and the form you wish up to Mma internal ordering. The latter is out of reach, unless you use the functions of the Hold group. – Alexei Boulbitch Nov 22 '19 at 14:42
• You don't see a difference in the ordering between $N^{\alpha - \beta} B^{-\beta}$ and $N^\alpha (NB)^{-\beta}$? – FooBar Nov 22 '19 at 15:21
• No, I do not see the difference between b^-c n^(a - c)  that I obtained and n^(a - c) b^-c  that you wish. – Alexei Boulbitch Nov 22 '19 at 15:32