Previous Up Next

2.25.12  Solving au+bv=c over polynomials: abcuv

abcuv solves the polynomial equation

C(x)=U(x)*A(x)+V(x)*B(x

where A,B,C are given polynomials and U and V are unknown polynomials. C must be a multiple of the gcd of A and B for a solution to exist. abcuv takes 3 expressions as argument, and an optional variable specification (which defaults to x) and returns a list of 2 expressions (U and V). Alternatively, the polynomials A,B,C may be entered as list-polynomials.

Input :

abcuv(x^2+2*x+1 ,x^2-1,x+1)

Output :

[1/2,1/-2]

Input :

abcuv(x^2+2*x+1 ,x^2-1,x^3+1)

Output :

[1/2*x^2+1/-2*x+1/2,-1/2*x^2-1/-2*x-1/2]

Input :

abcuv([1,2,1],[1,0,-1],[1,0,0,1])

Output :

[poly1[1/2,1/-2,1/2],poly1[1/-2,1/2,1/-2]]

Previous Up Next