How this calculation works
The ordinary Euclidean algorithm keeps dividing until the polynomial remainder becomes zero. Its extended version also tracks how each remainder is built from the two original inputs. This page performs those operations over exact rational coefficients, normalizes the final nonzero remainder to a monic GCD and scales both tracked coefficients consistently. The result includes one Bézout pair s,t and a coefficient-by-coefficient verification of A*s+B*t=g.
A(x)*s(x)+B(x)*t(x)=g(x), where g is the monic GCD over Q[x] for a nonzero input pair.A worked example
For A=x²+1 and B=x−1, division gives A=(x+1)B+2. After making the constant remainder monic, s=1/2 and t=−(x+1)/2 give (x²+1)/2−(x−1)(x+1)/2=1. The rational GCD is therefore one. A constant remainder of two is not a nonunit common factor in Q[x], because every nonzero rational constant is invertible there.
Good to know
Supports two rational polynomials of degree at most twelve with coefficients within ±10⁶. Polynomial operations and the identity check remain exact under coefficient-growth limits. It works in Q[x], not Z[x] or a finite coefficient field. Bézout pairs are not unique. One zero input is supported by normalizing the other polynomial; when both inputs are zero, the page explicitly uses g=s=t=0 rather than claiming a nonzero monic GCD exists.
Reference: SymPy polynomial reference — extended polynomial GCD (opens in a new tab) ↗
The coefficient field changes what counts as a unit
Over the rational numbers, two nonzero constants such as two and three are both units, so a polynomial GCD is conventionally scaled to leading coefficient one. Over integer coefficients, content and divisibility require a different treatment. A rational Bézout pair can therefore be valid even when its fractions would not be acceptable coefficients in a claimed integer-polynomial identity. The page names its coefficient field to keep that distinction explicit.
For A=x²−1 and B=x−1, the second input already divides the first and the monic GCD is x−1. For A=0 and B=2x+2, normalization gives g=x+1 with coefficient t=1/2. Swapping the inputs changes which tracked coefficient carries that identity. These zero and divisibility cases are genuine algebraic cases, not failures of the algorithm or reasons to divide by a zero remainder.
The Partial fraction decomposition calculator with repeated factors instead solves an exact coefficient identity for the numerators of rational summands.
A verified Bézout pair is not generally a unique answer
If s,t satisfy A*s+B*t=g, adding (B/g)*h to s and subtracting (A/g)*h from t produces another valid pair for any rational polynomial h. The Euclidean chain supplies one convenient representative. Comparing two implementations by requiring identical coefficient polynomials can therefore reject two equally correct answers. Recombining each pair and checking the same normalized GCD is the stronger comparison.
When the GCD is one, the identity can imply a polynomial inverse modulo another polynomial over the same coefficient field. This page still returns the rational-polynomial identity itself. The existing finite polynomial quotient-ring calculator instead works modulo a prime coefficient modulus and a polynomial modulus; changing that field changes which coefficients, factors and inverses are available. Keeping these operations separate avoids presenting a rational Bézout result as an inverse in an unrelated finite ring.
A few questions, answered
Why scale s and t when making the GCD monic?
Scaling only the last remainder would break A*s+B*t=g. The same nonzero rational normalization must be applied to both tracked coefficient polynomials.
What is returned for two zero inputs?
This page uses the explicit convention g=s=t=0 and marks that no nonzero monic GCD is determined. The displayed zero identity holds, but it is not an ordinary nonzero-input normalization.