TransWikia.com

How to compute the factors in Bezout's Identity

Mathematica Asked by John Blutarsky on April 22, 2021

If I have two polynomials $p(x),q(x)$, PolynomialGCD[p,q,x] can give me their greatest common divisor. But how to compute the polynomials $a(x),b(x)$ such that $d(x)=a(x)p(x)+b(x)q(x)$? I’m having trouble programming the division algorithm, but if someone is able to do that, I might be able to reverse engineer the steps to build a,b.

One Answer

Use PolynomialExtendedGCD. Here's an example from the Mathematica documentation:

{f, g} = {2 x^5 - 2 x, (x^2 - 1)^2};
{d, {a, b}} = PolynomialExtendedGCD[f, g, x]
d == {f, g}.{a, b} // Simplify

Answered by Daniel Huber on April 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP