# Behavior of PowerExpand

I want to simplify certain expressions involving integer powers. The expressions are more or less of the form of

(a-b)^n (-(a-b))^-n


Applying PowerExpand to this does not do anything. However,

PowerExpand[(c)^n (-(c))^-n]


does simplify to (-1)^-n. I have tried various other methods of simplification (and adding assumptions) to reproduce the "c" simplification, but I've failed. How can I perform this simplification (and am I missing something on why PowerExpand does not want to do this)?

• Try: Simplify[(a - b)^n (-(a - b))^-n, Assumptions -> {a - b > 0, n \[Element] Integers}] – Mariusz Iwaniuk Feb 15 '18 at 12:07
• @Mariusz Iwaniuk It is not clear, why Mma needs the condition a - b > 0 , while only a!=b should be enough – Alexei Boulbitch Feb 15 '18 at 14:49
• @Mariusz, thanks indeed that works. And thanks to Alexei for pointing out what might be the reason that Mma is more careful with the expression a-b, i.e. to handle the a=b case. (Although if Mma were consistent we would also expect that the assumption c>0 or c!=0 would be necessary to simplify the c expression, but it isn't. Indeed it seems hard to find out consistent rules for what simplifications are necessary. Here both a>b and b>a work but if we specify a!=b the simplification somehow fails. – Kvothe Feb 15 '18 at 15:16
• Practically I also fail to solve the issue as unfortunately the expressions that I need to simplify are slightly more complex than I presented them here. It would be quite cumbersome to specify for each individual term that a-b isn't 0 (of course for some reason, even though that is the information Mma needs, it would still not be sufficient and we should instead lie to Mma and say a>b or a<b). Does anyone know a way to systematically circumvent this edge case. Can we, using patterns, somehow add the assumption that any symbol that we take a negative power of is positive and real? – Kvothe Feb 15 '18 at 15:23
• @AlexeiBoulbitch. I also do not know why MMA needs the condition a - b > 0!. – Mariusz Iwaniuk Feb 15 '18 at 15:37

## 2 Answers

I will just explain why PowerExpand is not doing what you wanted. The reason PowerExpand works in the second case is because of:

PowerExpand[(-c)^-n]


(-1)^-n c^-n

Since $(-1)^{-n}$ gets extracted, we can multiply $c^n c^{-n}$ which is just 1:

c^n c^(-n)


1

For the first case:

PowerExpand[(-(a-b))^-n]


(-a + b)^-n

Here PowerExpand does not extract a $(-1)^{-n}$ factor, and so no further simplification occurs.

This works.

FullSimplify[
ComplexExpand[(a - b)^n (-a + b)^(-n), TargetFunctions -> {Re, Im}],
Element[n, Integers]]

(*   (-1)^n   *)


Although this is not defined for a==b , it is the limit

Limit[(a - b)^n (-a + b)^-n , b -> a]

(*   (-1)^n    *)

• Really late reply. I wanted to accept your answer but I noticed that if we now change around which power is positive, i.e. apply your function to (a - b)^(-n) (-a + b)^(n). The output will additionally have an imaginary term involving Arctan. The term is $0$ for $a!=b$ due to the oddness of the ArcTan but again it is difficult to convince Mathematica of that. – Kvothe Sep 5 '18 at 9:53