This function computes the polynomial coefficients of Bézout’s Identity (also known as Extended Greatest Common Divisor). Given two polynomials A(x),B(x), egcd computes 3 polynomials U(x),V(x) and D(x) such that :
U(x)*A(x)+V(x)*B(x)=D(x)=GCD(A(x),B(x)) |
egcd takes 2 or 3 arguments: the polynomials A and B as
expressions in terms of a variable, if the variable is not specified
it will default to x. Alternatively, A and B may be given
as list-polynomials.
Input :
^
2+2*x+1,x^
2-1)Output :
Input :
Output :
Input :
^
2-2*y+1,y^
2-y+2,y)Output :
Input :
Output :