# Simplify $w^{3n}, w^{6n}, w^{3 + 3n}, w^{4+3n}$, etc. using $w^3=1$

I having an expression containing terms that are powers of $$w$$. How can I simplify these terms using the assumption $$w^3=1$$?

Simplify[expr, w^3==1 && n ∈ PositiveIntegers]


doesn't work for terms that have symbolic variable, e.g. $$n$$, in the exponent.

EDIT: Example expression:

( -a*w^3 + b*(n+1)*w^6 + 9*w^(3+3*n)*Sum[d[i], {i,1,n}]^2 - w^(3+6*n)*Sum[c[i], {i,1,n}] ) / (s^2*w^(4 + 3*n) )

• Kindly provide us expr so we have an example to work with Jun 13, 2019 at 14:52
• @JackLaVigne I added an example for the expression. Jun 13, 2019 at 15:15
• You only have to give a rule w^n_- >If[n==3 ,1,w^(n-3)] (sorry actually No MMA acces) Jun 13, 2019 at 16:34

Since $$w^3=1$$, one can use $$w^\alpha=w^{\alpha \text{ mod } 3}$$ to simplify arbitrary powers of $$w$$. This can be implemented as a simple rule:

wrule = w^(x_) :> w^Refine[Mod[x, 3], Assumptions->Element[n, Integers]];


Examples:

{w^1, w^2, w^3, w^4, w^(3n), w^(6n), w^(3+3n), w^(4+3 n), w^(-4-3n)} /. wrule


{w, w^2, 1, w, 1, 1, 1, w, w^2}

• Nice solution but I believe you need to treat negative integers differently. Applying w^-4/.wrule results in w^2. I think it should result in 1/w (i.e., w^-1). Jun 14, 2019 at 22:22
• @JackLaVigne If w^3==1 then w^-1 == 1 * w^-1 == w^3 * w^-1 == w^2. Thus both results are actually the same. Jun 14, 2019 at 22:34
• You are so right, thank you for pointing that out. Jun 14, 2019 at 22:38

A good strategy when attempting to replace portions of an expression is to look at the FullForm.

Below is an example expression:

expr = w^4 + w^(3 n) + w^(6 n) + w^(3 + 3 n) + w^(4 + 3 n)


and the associated FullForm

FullForm[expr]


By examining the FullForm of expr we see three forms where w is raised to a power involving integers: directly, with a times or with a plus and times.

Use patterns with ReplaceAll to accomplish the job.

expr //. {
Power[w, Plus[integer_Integer /; integer > 2, rest_]] ->
Power[w, Plus[integer - 3, rest]],
Power[w, integer_Integer] -> Power[w, integer - 3],
Power[w, Times[integer_Integer, n]] ->
Power[w, Times[integer - 3, n]]
}


## Update

Upon request, the following expression was given as an example.

expr = (-a*w^3 + b*(n + 1)*w^6 +
9*w^(3 + 3*n)*Sum[d[i], {i, 1, n}]^2 -
w^(3 + 6*n)*Sum[c[i], {i, 1, n}])/(s^2*w^(4 + 3*n))


Now one additional rule to handle negative integers is required.

expr //. {
Power[w, Plus[integer_Integer /; integer > 2, rest_]] ->
Power[w, Plus[integer - 3, rest]],
Power[w, Plus[integer_Integer /; integer < -2, rest_]] ->
Power[w, Plus[integer + 3, rest]],
Power[w, integer_Integer] -> Power[w, integer - 3],
Power[w, Times[integer_Integer, n]] ->
Power[w, Times[integer - 3, n]]
}


One might want to go further and assume that n` is an integer. I leave that as an exercise for you.