I have the answer to
(-1 + 3 phi - 2 phi^3 - 6 phi^4 - 20 phi^6 + 6 phi^7 + 3 phi^8 + phi^9)/.{phi^3->1-
phi^2}
that is not the problem. I am looking for a method that continues to apply this reduction until there are only linear and quadratic terms involving phi in one step. I have a lot of these reductions and some are a lot more complicated.
I have to apply this substitution, expand, then apply again for each reduction in powers of phi until I have no more than quadratic terms. So for example the phi^9 powers is eliminated by /.{phi^9->(1-phi^2)^3}
, expand and continue.
ReplaceRepeated
(aka//.
) will do this $\endgroup$PolynomialReduce[
is quite good for this purpose. $\endgroup$