How can I simplify trivial
expressions under the Power
?
Here is one example:
(z2p-z2p z3)^-ϵ
The expected output:
z2p^-ϵ (1 - z3)^-ϵ
Currently I am trying to look at the FullForm
and decide the rule like below:
(z2p-z2p z3)^-ϵ /. Plus[x_,Times[-1,x_,y_]] -> x(1-y) //PowerExpand
However, how can I extend it to a general case where there could be multiple terms connected with +-
? Or is there a better way to handle?
EDIT::
In a general scenario one would have factors multiplied with these kind of terms.
Example:
expr= ((1 - z2p)^-e (1 - z3)^-e z3^-e (z2p - z2p z3)^-e)/
( z2p (-1 + z3)^2 (1 - z2p + z2p z3))
Basically how should one proceed to simplify/Factor out these terms?
(-z2p)^-ϵ (z3 - 1)^-ϵ
is an equally valid output. What criterion should be used to decide between the two? $\endgroup$Reals
). Even Mathematica loves to write2 (1 - x) y // Simplify
as-2 (-1 + x) y
(probably it takes less strings/internal operations to write second one? ). I personally dont like this output but this hurts less than the examples in this question. It is really annoying that it can not do the simplification/Factor. I expectedPowerExpand
would have factor out everything usingAssumptions
but not. $\endgroup$