|
From: Richard F. <fa...@gm...> - 2021-06-09 16:03:35
|
I think that Michel is right, but maybe there is a related simpler explanation... Perhaps this boils down to whether one is computing over polynomials with integer coefficients or rational number coefficients. For many users of Maxima, this is simply not something they think about (Rings, Fields, etc). For others, such considerations are central to their interests. consider gcd(x^2-1,x+1) which most people with an opinion would expect to return x+1. what about gcd (x^2/2-1/2, x+1) ? maxima returns (x+1)/2. How it computes: by removing the "content" of each argument, namely 1/2, 1, and computing the gcd of the "primitive part" of the polynomials separately. Then sticking 1/2 back on. But if we are talking about computing over rationals, and are seeking the "greatest" common divisor, which is "greater"? x+1 or (x+1)/2 ? and for that matter, there are other common divisors, such as 2*x+2, since 1/2*(2*x+2) is x+1, etc. Which is the greatest? The route taken by Maxima is to basically convert these questions to questions of polynomials over the integers, where the results are pretty much undisputed, and then adjust somehow in recognition of the possibility that the user had " something else" in mind. What, for instance, should gcd() return when it is given an argument that is clearly not a polynomial? What do you expect is the most useful return value for --- gcd(1/x,x+1) ? Try it and see if Maxima gives the result you think it should. If I am not mistaken, the same thinking affects resultant(). Whether it should be adjusted or not by removing contents. If I am mistaken, I hope you enjoyed the short essay on gcd(). RJF On 6/9/21 7:40 AM, Michel Talon wrote: > > Le 09/06/2021 à 16:09, Michel Talon a écrit : >> >> At what point has the polynomial been normalized i don't know. > > In fact it is in (rform (rform poly)). It happens that rform invokes > > ratf which gives the "rational" representation from the "general" > representation and here: > > (ratf poly) returns: > > ((MRAT SIMP ($X) (#:X763)) (#:X763 2 1 1 -2 0 6) . 2) > > For rationals fractions, P/Q are represented as dotted pair (P.Q) > where polynomials P and Q are > > as described previously. It is clear that taking the rational > representation has reduced coefficients > > to a common denominator. You can see this straightforwardly in the > maxima command: > > (%i7) rat(x^2/2-x+3); > 2 > x - 2 x + 6 > (%o7)/R/ ------------ > 2 > > This is the real origin of the discrepancy you have found in the > computation of the discriminant to what you > > expect. > > > |