2
$\begingroup$

I have a question regarding the relationship between two polynomials. (I'm still a beginner and don't know so many commands.) Is there any option to show me the relation between two polynomials? As an example, if

$f=x^2+2x+3$,

$g=3x^3+6x+9$

then to have an output like $3f=g$.

$\endgroup$
6
  • 4
    $\begingroup$ You can divide them with Simplify[(3x^3+6x+9)/(x^3+2x+3)] (assuming you mean $x^3$ instead of $x^2$ for $f$) $\endgroup$
    – Adam
    Aug 28, 2022 at 16:43
  • 3
    $\begingroup$ polys = {f == x^3 + 2 x + 3, g == 3 x^3 + 6 x + 9}; Eliminate[polys, x] $\endgroup$
    – Bob Hanlon
    Aug 28, 2022 at 17:07
  • 1
    $\begingroup$ @BobHanlon This just give me the Output: False $\endgroup$
    – Fynn13
    Aug 28, 2022 at 17:09
  • $\begingroup$ Clear any previous definitions, i.e., Clear[f, g, x] $\endgroup$
    – Bob Hanlon
    Aug 28, 2022 at 17:13
  • 1
    $\begingroup$ f == x^3 + 2 x + 3; g == 3 x^3 + 6 x + 9; and {q, r} = PolynomialQuotientRemainder[g, f, x]. Also explore, PolynomialReduce, GroebnerBasis, PolynomialGCD. $\endgroup$
    – Syed
    Aug 28, 2022 at 17:49

1 Answer 1

3
$\begingroup$
  • When f=x^3 + 2 x + 3

GroebnerBasis work for another complex cases.

Clear[f, g, basis];
{f, g} = {x^3 + 2 x + 3, 3 x^3 + 6 x + 9};
basis = GroebnerBasis[{f, g}, x]

{3 + 2 x + x^3}

It means that f and g have comment divisor.

PolynomialReduce[f, basis, {x}][[1]]
PolynomialReduce[g, basis, {x}][[1]]

{1} {3}

That is g=3f.

  • When f=x^2 + 2 x + 3
Clear[f, g, basis];
{f, g} = {x^2 + 2 x + 3, 3 x^3 + 6 x + 9};
basis = GroebnerBasis[{f, g}, x]

{1}

It measns that f and g are coprime

{d, {a, b}} = PolynomialExtendedGCD[f, g, x]
{f, g} . {a, b} == d
% // Simplify

True.

f*1/54 (15 - 9 x + 3 x^2) + g*1/162 (3 - 3 x) == 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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