1
$\begingroup$

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.

$\endgroup$
  • 1
    $\begingroup$ ReplaceRepeated (aka //.) will do this $\endgroup$ – KraZug Feb 17 '19 at 20:18
  • $\begingroup$ PolynomialReduce[ is quite good for this purpose. $\endgroup$ – Daniel Lichtblau Feb 18 '19 at 13:54
0
$\begingroup$
expr /. {ToRules[
   Reduce[{(-1 + 3 phi - 2 phi^3 - 6 phi^4 - 20 phi^6 + 6 phi^7 + 
        3 phi^8 + phi^9) == expr, phi^3 == 1 - phi^2}, expr]]}

{1 - 24 phi + 23 phi^2, 1 - 24 phi + 23 phi^2, 1 - 24 phi + 23 phi^2}

Reduce is used to find the simplest possible form for the expr under the given condition (phi^3 == 1 - phi^2), and expr /. {ToRules[...]} is used to isolate the expression of interest from Reduce's result.

Note that this returns a list of results: any result here should be a valid form of the expression under some condition. In this case, they're all the same, but they may not always be. You can grab one with First or you can keep them all (or use DeleteDuplicates or so on).

$\endgroup$
2
$\begingroup$

This

Simplify[-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]

gives this

(*1 - 24*phi + 23*phi^2*)
$\endgroup$
2
$\begingroup$

Several methods can be used. The simplest use only polynomial operations. The code

p = -1 + 3 phi - 2 phi^3 - 6 phi^4 - 20 phi^6 + 6 phi^7 + 3 phi^8 + phi^9;
q = phi^3 - 1 + phi^2;  r = 1 - 24*phi + 23*phi^2;   (* r is the result *)
{r == PolynomialReduce[p, q, phi][[2]], r == PolynomialRemainder[p, q, phi]}

returns {True, True}.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.