On Wednesday, May 27, 2015 at 8:21:51 PM UTC-6, ES-SAMAALI Hamza wrote:
>
> I want to find the bezout coefficient for those 2 polynomials : 
>
> f = 1+x-x^2-x^4+x^5 and g = -1+x^2+x^3-x^6 when I use the gcd function in 
> sage the output is : 
>
> sage: gcd(f,g)
> sage: 1
>
> but when I use xgcd(f,g) it gives me the following : 
>
> (-27, 9*x^5 - 18*x^2 - 9*x - 9, 9*x^4 - 9*x^3 - 18*x + 18)
>
> I want xgcd to give me 1 instead of -27 so the polynomials will be the 
> bezout coefficients
>
> P.S: I can't divide the polynomials by -27 because i'm working in ZZ
>
Unfortunately, restricting to ZZ means that 27 is the best you can do. This 
follows from the fact that the resultant of these two polynomials is -27.

In that sense, gcd(f,g) is misleading for polynomials over ZZ. On the other 
hand, ZZ['x'] is not a principal ideal domain, so defining GCD as an 
element of Z['x'] is problematic. This is probably why it's giving a result 
that is consistent with the result in QQ['x'].
 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to