Using Mathematica (v.7), basically I want to give an expression like this
(x + x^2 + x^3)^4
to
x^4 (1 + x + x^2)^4
What would be the best way to take a term, such as a GCD, from an expression that was raised to power and in factorized form; then put this term outside the brackets and store the value of the exponent to which it was raised. He would have to know that value rises to power before taking it out. Here is my attempt.
In[28]:= example = (x + x^2 + x^3)^4 Out[28]= (x + x^2 + x^3)^4 In[37]:= gcdVar = PolynomialGCD[Sequence @@ Level[example, {2}]] Out[37]= x In[40]:= step1 = Map[Divide[
I examined all the various functions related to this area: Collect, Factor, Expand, Simplify, Solve. I do not think that any of them can make the conclusion that I need. Is there a built-in, more efficient, scalable, and shorter way to do this, perhaps using template / form matching?
source share